我正在尝试将示例应用程序部署到virgo(我将第三方jar文件放在repository / usr上)。经过长时间的解析项目依赖项后,我得到了“org.springframework.orm.hibernate3.LocalSessionFactoryBean”的ClassNotFound,所以我在清单上添加了spring-orm依赖项。问题得到了解决,但这次我得到NoClassDefFound为“org / hibernate / cfg / Configuration”。所以我在清单中的bundle上添加了“com.springsource.org.hibernate.core”,但没有任何反应: ... 引起:java.lang.NoClassDefFoundError:org / hibernate / cfg / Configuration 在org.springframework.orm.hibernate3.LocalSessionFactoryBean。(LocalSessionFactoryBean.java:189) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) 在org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:126) ...省略了20个常见帧 我不知道在哪里寻找可疑的东西!帮帮我PLZ:|
答案 0 :(得分:0)
你需要Hibernate特定的罐子。 Spring-ORM jar只提供与Hibernate的集成。您仍然需要来自Hibernate的实际jar包含这些类的实现。希望这会有所帮助。
答案 1 :(得分:0)
你需要看看hibernate jar包是否提供了osgi模式,如果没有,你需要使用maven-bundle-plugin插件重新打包。您需要在META-INF文件夹中看到manifest.mf。错误或不够.mf文件:
Manifest-Version: 1.0
Implementation-Vendor: The Redisson Project
Implementation-Title: Redisson/All-in-One
Implementation-Version: 2.10.1
Implementation-Vendor-Id: org.redisson
Built-By: root
Build-Jdk: 1.7.0_55
Specification-Vendor: The Redisson Project
Specification-Title: Redisson/All-in-One
Created-By: Apache Maven 3.5.0
Implementation-URL: http://redisson.org
Specification-Version: 2.10
Main-Class: org.redisson.RedissonNode
在.mf文件中:它所依赖的所有包都在Import-Package下,并且所有用户都可以使用Export-Package下的包,上面的文件不包含这些