【问题标题】:Hibernate / postgreSQL休眠/postgreSQL
【发布时间】:2013-06-30 11:19:04
【问题描述】:

我在 eclipse-Juno/EE 上使用 Hibernate 3.6.4 和 postgreSQL9.2。

我无法运行——不断收到以下错误日志:

16:07:18,605 INFO  [main] Main  - javax.xml.transform.TransformerFactory=null
16:07:18,636 INFO  [main] Main  - java.endorsed.dirs=C:\Program Files\Java\jre7\lib\endorsed
16:07:18,746 INFO  [main] Main  - launchFile: C:\Users\AYSE\workspace\.metadata\.plugins\org.eclipse.wst.xsl.jaxp.launching\launch\launch.xml

16:07:20,478 FATAL [main] Main  - No embedded stylesheet instruction for file: file:/C:/Users/AYSE/workspace/HiberAyse/src/hibernate.cfg.xml

org.eclipse.wst.xsl.jaxp.debug.invoker.TransformationException: No embedded stylesheet instruction for file: 
file:/C:/Users/AYSE/workspace/HiberAyse/src/hibernate.cfg.xml

at org.eclipse.wst.xsl.jaxp.debug.invoker.internal.JAXPSAXProcessorInvoker.transform(JAXPSAXProcessorInvoker.java:225)
at org.eclipse.wst.xsl.jaxp.debug.invoker.internal.JAXPSAXProcessorInvoker.transform(JAXPSAXProcessorInvoker.java:186)
at org.eclipse.wst.xsl.jaxp.debug.invoker.internal.Main.main(Main.java:73)

Caused by: org.eclipse.wst.xsl.jaxp.debug.invoker.TransformationException: No embedded stylesheet instruction for file: 
file:/C:/Users/AYSE/workspace/HiberAyse/src/hibernate.cfg.xml
at org.eclipse.wst.xsl.jaxp.debug.invoker.internal.JAXPSAXProcessorInvoker.transform(JAXPSAXProcessorInvoker.java:214)
... 2 more

根据我的查找,这看起来是与创建我希望在代码中使用的 SessionFactory 实例相关的错误。

我的设置、配置和代码都应该没问题——我按照一步一步的视频把它们放在一起。

提前感谢您的帮助。

对 Hibernate 来说太新了。

在另一个问题中,我将询问 Hibernate-and-which-DB。

//=======================

编辑:这都是混合的——我收到一个错误消息,但不是这个。这是通过在 cfg 文件上运行它——正如 lifus 在他的 cmets 和下面的 ans 中指出的那样。我会去看更多,然后回来看看我想出了什么。

【问题讨论】:

  • 您在运行程序时将注意力集中在 hibernate.cfg.xml 上,对吧?如果是这样,请专注于 java 类并再次运行。
  • 如果尝试过“版本”,右键单击以在主方法类、项目文件夹和包文件夹上运行。
  • 这很奇怪,因为 Eclipse 正在尝试“转换”您的 xml。 This might be helpful
  • 谢谢,会看看。我重新安装了数据库并在该设置上讨价还价

标签: hibernate postgresql installation


【解决方案1】:

原因:org.eclipse.wst.xsl.jaxp.debug.invoker.TransformationException:没有嵌入的文件样式表指令: 文件:/C:/Users/AYSE/workspace/HiberAyse/src/hibernate.cfg.xml

安装 xsl 插件时,Eclipse 为 trying to transform hibernate.cfg.xml since it's default behavior for xml files。这必须是 Eclipse XSL 开发工具(org.eclipse.wst.xsl.* folders/jars in plugin folder)。

当您尝试运行您的休眠项目时,请确保焦点位于 .java 文件。

另外,您可以关注these steps(and comments in case if this don't work for you either)optionally these steps in case if you are not working with multiple projects at the same time

【讨论】:

  • 当焦点位于hibernate.cfg.xml 而不是.java file 时,也会发生同样的错误。
猜你喜欢
  • 2014-10-09
  • 2013-04-28
  • 2014-12-09
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-11-13
  • 2016-10-08
  • 2011-11-26
相关资源
最近更新 更多