- 浏览: 539596 次
- 性别:
- 来自: 西安
文章分类
- 全部博客 (233)
- 设计模式 (1)
- WEBLOGIC (2)
- spring (2)
- struts (1)
- hibernate (8)
- SOA (11)
- j2ee (0)
- corba (0)
- linux (2)
- oracle (0)
- webService (17)
- javaMail (1)
- junit (3)
- java (45)
- 正则表达式 (7)
- java+xml (4)
- html (2)
- javaScript (6)
- ajax (1)
- mysql (0)
- eclipse (2)
- eclipse插件开发 (3)
- 软件工程 (5)
- ant (6)
- 开源包 (6)
- 学习网站 (7)
- Struts2 (18)
- JSP (1)
- 持续集成 (4)
- FreeMaker (6)
- 工作项目点点 (4)
- Maven2 (6)
- JQuery (1)
- 日志记录 (9)
- 工作流 (4)
- BPEL (1)
- extJs (1)
- 组件 (1)
- OSGI (10)
- ESB总线学习 (1)
- 错误解决 (2)
- JMX (3)
- 网络知识 (1)
最新评论
-
duanlongk:
这个问题解决了么?
java.lang.NoClassDefFoundError: org/apache/tuscany -
sotrip:
从上面结果来看,HelloWorld.class是由虚拟机的内 ...
如何实现自己的classloader -
zengsir2008:
哎,不太明白。。。。
OSGI DS 实例 -
ralfsumahe:
...
使用XFire开发Web Service客户端完整入门教程 -
liuqiao_0702:
...
osgi spring hibernate =
I am using only the 3rd party bundles from the revision 6343, spring-osgi-core, spring-osgi-extender, io and mock are from revision 6170. (I've got compilation errors on the new version)... anyway:
The thing is that I've got a lot of class not found errors when I try to use hibernate3 and spring-hibernate3.
Bundle H is the actual hibernate bundle, which exports all the org.hibernate packages...
Bundle A has .hbm.xml, has DAO's and is using springs HibernateTemplate by extending the class HibernateDaoSupport. Actually I just need to import org.springframework.orm.hibernate3.support package to A, but I needed some more:
org.springframework.core,
org.springframework.orm.hibernate3,
org.springframework.beans.factory,
org.springframework.dao.support.DaoSupport,
org.hibernate.proxy,
This are lots of unneccessary imports for my own bundle, it seems that a lot of them are requiered indirectly by other parts of spring(-osgi)... please double check that, because a plug-in developer for my own application, which wants to use some of my DAO's in its own bundle doesn't really want to import some stuff he doesn't know about.... he just wants to import packages that he/she is using directly....
The spring-hibernate3 bundle needed also some more imports from the actual hibernate3 bundle:
org.hibernate.exception,
org.hibernate.loader.custom,
org.hibernate.engine.query.sql,
package org.hibernate.collection
spring-hibernate3 bundle seems to be incomplete... a good solution would be to import all real hibernate3 packages... please double check that, too.
The above description is just a summary of my protocal I wrote besides I resolved the errors. Here it is (from top to the bottom):
---
Invocation of init method failed; nested exception is net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null
Caused by:
net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null
....
Caused by: java.lang.NoClassDefFoundError: org/hibernate/proxy/HibernateProxy
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
Solution:
Adding the package org.hibernate.proxy to my own bundle, where the DAO's are present. This shouldn't be the case,
because I just want to import packages that I directly use.
---
java.lang.NoClassDefFoundError: org/hibernate/exception/GenericJDBCException
Caused by:
java.lang.NoClassDefFoundError: org/hibernate/exception/GenericJDBCException
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.updateDatabaseSchema(LocalSessionFactoryBean.java:940)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.afterSessionFactoryCreation(LocalSessionFactoryBean.java:833)
...
Solution:
Adding to the imports of spring-hibernate3 manifest the package org.hibernate.exception
---
java.lang.NoClassDefFoundError: org.hibernate.loader.custom.CustomQuery
Caused by:
java.lang.NoClassDefFoundError: org.hibernate.loader.custom.CustomQuery
at $Proxy1.<clinit>(Unknown Source)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
...
Solution:
Adding to the imports of spring-hibernate3 manifest the package org.hibernate.loader.custom
---
java.lang.NoClassDefFoundError: org.hibernate.engine.query.sql.NativeSQLQuerySpecification
Caused by:
java.lang.NoClassDefFoundError: org.hibernate.engine.query.sql.NativeSQLQuerySpecification
at $Proxy1.<clinit>(Unknown Source)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
...
Solution:
Adding to the imports of spring-hibernate3 manifest the package org.hibernate.engine.query.sql
---
java.lang.NoClassDefFoundError: org.hibernate.collection.PersistentCollection
Caused by:
java.lang.NoClassDefFoundError: org.hibernate.collection.PersistentCollection
at $Proxy1.<clinit>(Unknown Source)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
...
Solution:
Adding to the imports of spring-hibernate3 manifest the package org.hibernate.collection
---
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'vorlesungsDAO' defined in OSGi bundle resource [id=2|symName=de.fhbrs.aloe.core|bundle-url:bundleentry://2/META-INF/spring/bundle-context.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [de.fhbrs.aloe.core.model.dao.VorlesungsDAO]: Constructor threw exception; nested exception is java.lang.Error: Unresolved compilation problems:
The hierarchy of the type VorlesungsDAO is inconsistent
The type org.springframework.dao.support.DaoSupport cannot be resolved. It is indirectly referenced from required .class files
The type org.springframework.dao.DataAccessException cannot be resolved. It is indirectly referenced from required .class files
Access restriction: The method save(Object) from the type HibernateTemplate is not accessible due to restriction on required library spring-hibernate3/target/classes/
Caused by:
org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [de.fhbrs.aloe.core.model.dao.VorlesungsDAO]: Constructor threw exception; nested exception is java.lang.Error: Unresolved compilation problems:
The hierarchy of the type VorlesungsDAO is inconsistent
The type org.springframework.dao.support.DaoSupport cannot be resolved. It is indirectly referenced from required .class files
The type org.springframework.dao.DataAccessException cannot be resolved. It is indirectly referenced from required .class files
Access restriction: The method save(Object) from the type HibernateTemplate is not accessible due to restriction on required library spring-hibernate3/target/classes/
Caused by:
java.lang.Error: Unresolved compilation problems:
The hierarchy of the type VorlesungsDAO is inconsistent
The type org.springframework.dao.support.DaoSupport cannot be resolved. It is indirectly referenced from required .class files
The type org.springframework.dao.DataAccessException cannot be resolved. It is indirectly referenced from required .class files
Access restriction: The method save(Object) from the type HibernateTemplate is not accessible due to restriction on required library spring-hibernate3/target/classes/
at de.fhbrs.aloe.core.model.dao.VorlesungsDAO.<init>(VorlesungsDAO.java:10)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
...
Eclipse is complaining the same thing.
DAO class:
public class myDAO extends HibernateDaoSupport implements IVorlesungsDAO { .. }
Imports from DAO bundle so far:
Import-Package: org.hibernate.proxy, org.springframework.orm.hibernate3.support;specification-version="2.1.0.SNAPSHOT-202-2"
Solution:
adding to my DAO bundle manifest the package org.springframework.dao.support.DaoSupport. This shouldn't be the case,
because I just want to import packages that I directly use.
---
next problem is the same, but with package org.springframework.beans.factory:
Caused by:
java.lang.Error: Unresolved compilation problems:
The hierarchy of the type VorlesungsDAO is inconsistent
The type org.springframework.beans.factory.InitializingBean cannot be resolved. It is indirectly referenced from required .class files
Access restriction: The method save(Object) from the type HibernateTemplate is not accessible due to restriction on required library spring-hibernate3/target/classes/
Solution:
adding to my DAO bundle manifest the package org.springframework.beans.factory. This shouldn't be the case,
because I just want to import packages that I directly use.
---
Eclipse complains:
Access restriction: The method save(Object) from the type HibernateTemplate is not accessible due to restriction on required library spring-hibernate3/target/classes/ de.fhbrs.aloe.core/src/main/java/de/fhbrs/aloe/core/model/dao
Solution:
Adding the package org.springframework.orm.hibernate3 to my own bundle, where the DAO's are present. This shouldn't be the case,
because I just want to import packages that I directly use.
---
Eclipse complains:
The project was not built since its build path is incomplete. Cannot find the class file for org.springframework.core.NestedRuntimeException. Fix the build path then try building this project
Solution:
Adding the package org.springframework.core to my own bundle, where the DAO's are present. This shouldn't be the case,
because I just want to import packages that I directly use.
The thing is that I've got a lot of class not found errors when I try to use hibernate3 and spring-hibernate3.
Bundle H is the actual hibernate bundle, which exports all the org.hibernate packages...
Bundle A has .hbm.xml, has DAO's and is using springs HibernateTemplate by extending the class HibernateDaoSupport. Actually I just need to import org.springframework.orm.hibernate3.support package to A, but I needed some more:
org.springframework.core,
org.springframework.orm.hibernate3,
org.springframework.beans.factory,
org.springframework.dao.support.DaoSupport,
org.hibernate.proxy,
This are lots of unneccessary imports for my own bundle, it seems that a lot of them are requiered indirectly by other parts of spring(-osgi)... please double check that, because a plug-in developer for my own application, which wants to use some of my DAO's in its own bundle doesn't really want to import some stuff he doesn't know about.... he just wants to import packages that he/she is using directly....
The spring-hibernate3 bundle needed also some more imports from the actual hibernate3 bundle:
org.hibernate.exception,
org.hibernate.loader.custom,
org.hibernate.engine.query.sql,
package org.hibernate.collection
spring-hibernate3 bundle seems to be incomplete... a good solution would be to import all real hibernate3 packages... please double check that, too.
The above description is just a summary of my protocal I wrote besides I resolved the errors. Here it is (from top to the bottom):
---
Invocation of init method failed; nested exception is net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null
Caused by:
net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null
....
Caused by: java.lang.NoClassDefFoundError: org/hibernate/proxy/HibernateProxy
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
Solution:
Adding the package org.hibernate.proxy to my own bundle, where the DAO's are present. This shouldn't be the case,
because I just want to import packages that I directly use.
---
java.lang.NoClassDefFoundError: org/hibernate/exception/GenericJDBCException
Caused by:
java.lang.NoClassDefFoundError: org/hibernate/exception/GenericJDBCException
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.updateDatabaseSchema(LocalSessionFactoryBean.java:940)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.afterSessionFactoryCreation(LocalSessionFactoryBean.java:833)
...
Solution:
Adding to the imports of spring-hibernate3 manifest the package org.hibernate.exception
---
java.lang.NoClassDefFoundError: org.hibernate.loader.custom.CustomQuery
Caused by:
java.lang.NoClassDefFoundError: org.hibernate.loader.custom.CustomQuery
at $Proxy1.<clinit>(Unknown Source)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
...
Solution:
Adding to the imports of spring-hibernate3 manifest the package org.hibernate.loader.custom
---
java.lang.NoClassDefFoundError: org.hibernate.engine.query.sql.NativeSQLQuerySpecification
Caused by:
java.lang.NoClassDefFoundError: org.hibernate.engine.query.sql.NativeSQLQuerySpecification
at $Proxy1.<clinit>(Unknown Source)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
...
Solution:
Adding to the imports of spring-hibernate3 manifest the package org.hibernate.engine.query.sql
---
java.lang.NoClassDefFoundError: org.hibernate.collection.PersistentCollection
Caused by:
java.lang.NoClassDefFoundError: org.hibernate.collection.PersistentCollection
at $Proxy1.<clinit>(Unknown Source)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
...
Solution:
Adding to the imports of spring-hibernate3 manifest the package org.hibernate.collection
---
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'vorlesungsDAO' defined in OSGi bundle resource [id=2|symName=de.fhbrs.aloe.core|bundle-url:bundleentry://2/META-INF/spring/bundle-context.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [de.fhbrs.aloe.core.model.dao.VorlesungsDAO]: Constructor threw exception; nested exception is java.lang.Error: Unresolved compilation problems:
The hierarchy of the type VorlesungsDAO is inconsistent
The type org.springframework.dao.support.DaoSupport cannot be resolved. It is indirectly referenced from required .class files
The type org.springframework.dao.DataAccessException cannot be resolved. It is indirectly referenced from required .class files
Access restriction: The method save(Object) from the type HibernateTemplate is not accessible due to restriction on required library spring-hibernate3/target/classes/
Caused by:
org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [de.fhbrs.aloe.core.model.dao.VorlesungsDAO]: Constructor threw exception; nested exception is java.lang.Error: Unresolved compilation problems:
The hierarchy of the type VorlesungsDAO is inconsistent
The type org.springframework.dao.support.DaoSupport cannot be resolved. It is indirectly referenced from required .class files
The type org.springframework.dao.DataAccessException cannot be resolved. It is indirectly referenced from required .class files
Access restriction: The method save(Object) from the type HibernateTemplate is not accessible due to restriction on required library spring-hibernate3/target/classes/
Caused by:
java.lang.Error: Unresolved compilation problems:
The hierarchy of the type VorlesungsDAO is inconsistent
The type org.springframework.dao.support.DaoSupport cannot be resolved. It is indirectly referenced from required .class files
The type org.springframework.dao.DataAccessException cannot be resolved. It is indirectly referenced from required .class files
Access restriction: The method save(Object) from the type HibernateTemplate is not accessible due to restriction on required library spring-hibernate3/target/classes/
at de.fhbrs.aloe.core.model.dao.VorlesungsDAO.<init>(VorlesungsDAO.java:10)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
...
Eclipse is complaining the same thing.
DAO class:
public class myDAO extends HibernateDaoSupport implements IVorlesungsDAO { .. }
Imports from DAO bundle so far:
Import-Package: org.hibernate.proxy, org.springframework.orm.hibernate3.support;specification-version="2.1.0.SNAPSHOT-202-2"
Solution:
adding to my DAO bundle manifest the package org.springframework.dao.support.DaoSupport. This shouldn't be the case,
because I just want to import packages that I directly use.
---
next problem is the same, but with package org.springframework.beans.factory:
Caused by:
java.lang.Error: Unresolved compilation problems:
The hierarchy of the type VorlesungsDAO is inconsistent
The type org.springframework.beans.factory.InitializingBean cannot be resolved. It is indirectly referenced from required .class files
Access restriction: The method save(Object) from the type HibernateTemplate is not accessible due to restriction on required library spring-hibernate3/target/classes/
Solution:
adding to my DAO bundle manifest the package org.springframework.beans.factory. This shouldn't be the case,
because I just want to import packages that I directly use.
---
Eclipse complains:
Access restriction: The method save(Object) from the type HibernateTemplate is not accessible due to restriction on required library spring-hibernate3/target/classes/ de.fhbrs.aloe.core/src/main/java/de/fhbrs/aloe/core/model/dao
Solution:
Adding the package org.springframework.orm.hibernate3 to my own bundle, where the DAO's are present. This shouldn't be the case,
because I just want to import packages that I directly use.
---
Eclipse complains:
The project was not built since its build path is incomplete. Cannot find the class file for org.springframework.core.NestedRuntimeException. Fix the build path then try building this project
Solution:
Adding the package org.springframework.core to my own bundle, where the DAO's are present. This shouldn't be the case,
because I just want to import packages that I directly use.
发表评论
-
osgi spring hibernate
2009-04-29 08:33 2698先来说说整合Hibernate的关键之处。其实用OSGi整合 ... -
osgi spring hibernate =
2009-04-23 17:27 2475接上文,为了测试已经搭好的架子,创建了一个注册实体的Bundl ... -
OpenCore: OSGi上部署Hibernate的四种方式
2009-04-23 16:33 1355本文讨论四种解决方案:1.模型对象(Domain Object ... -
[Eclipse] Access restriction: Class is not accessi
2009-04-13 09:47 2848[Eclipse] Access r ... -
Service Event Listener Bundle
2009-04-09 10:52 1500This example creates a simple b ... -
解决OSGI环境第三方包的NoClassDefFoundError
2009-04-07 17:48 2568总结了一下:1、把第三方包的class文件改造为一个bundl ... -
OSGI StartLevel explained and using 启动级别机制和使用
2009-03-17 14:52 4070OSGI StartLevel explained and u ... -
收藏一个OSGI网站
2009-03-04 16:28 1113http://www.blogjava.net/Phranco ... -
OSGI DS 实例
2009-02-16 09:16 3345一,开发生产者: 工程名:org.vwpolo.os ...
相关推荐
ta_lib-0.5.1-cp312-cp312-win32.whl
课程设计 在线实时的斗兽棋游戏,时间赶,粗暴的使用jQuery + websoket 实现实时H5对战游戏 + java.zip课程设计
ta_lib-0.5.1-cp310-cp310-win_amd64.whl
基于springboot+vue物流系统源码数据库文档.zip
GEE训练教程——Landsat5、8和Sentinel-2、DEM和各2哦想指数下载
知识图谱
333498005787635解决keil下载失败的文件.zip
【微信机器人原理与实现】 微信机器人是通过模拟微信客户端的行为,自动处理消息、发送消息的程序。在Python中实现微信机器人的主要库是WeChatBot,它提供了丰富的接口,允许开发者方便地进行微信消息的接收与发送。这个项目标题中的"基于python实现的微信机器人源码"指的是使用Python编程语言编写的微信机器人程序。 1. **Python基础**:Python是一种高级编程语言,以其简洁的语法和强大的功能深受开发者喜爱。在实现微信机器人时,你需要熟悉Python的基本语法、数据类型、函数、类以及异常处理等概念。 2. **微信API与WeChatBot库**:微信为开发者提供了微信公共平台和微信开放平台,可以获取到必要的API来实现机器人功能。WeChatBot库是Python中一个用于微信开发的第三方库,它封装了微信的API,简化了消息处理的流程。使用WeChatBot,开发者可以快速搭建起一个微信机器人。 3. **微信OAuth2.0授权**:为了能够接入微信,首先需要通过OAuth2.0协议获取用户的授权。用户授权后,机器人可以获取到微信用户的身份信息,从而进行
基于springboot实验室研究生信息管理系统源码数据库文档.zip
张力控制,色标跟踪,多轴同步,电子凸轮,横切等工艺控制案例。
在Python编程环境中,处理Microsoft Word文档是一项常见的任务。Python提供了几个库来实现这一目标,如`python-docx`,它可以让我们创建、修改和操作.docx文件。本教程将重点介绍如何利用Python进行Word文档的合并、格式转换以及转换为PDF。 1. **合并Word文档(merge4docx)** 合并多个Word文档是一项实用的功能,特别是在处理大量报告或文档集合时。在Python中,可以使用`python-docx`库实现。我们需要导入`docx`模块,然后读取每个文档并将其内容插入到主文档中。以下是一个基本示例: ```python from docx import Document def merge4docx(file_list, output_file): main_doc = Document() for file in file_list: doc = Document(file) for paragraph in doc.paragraphs: main_doc.add_paragraph(paragraph.text) m
基于springboot+Javaweb的二手图书交易系统源码数据库文档.zip
基于springboot餐品美食论坛源码数据库文档.zip
基于springboot亚运会志愿者管理系统源码数据库文档.zip
使用WPF的数据样式绑定,切换对象数据值来完成控件动态切换背景渐变动画效果。 使用动画样式渲染比线程修改性能消耗更低更稳定
基于SpringBoot的企业客源关系管理系统源码数据库文档.zip
基于springboot+vue的桂林旅游网站系统源码数据库文档.zip
基于springboot嗨玩旅游网站源码数据库文档.zip
基于springboot的流浪动物管理系统源码数据库文档.zip
基于springboot课件通中小学教学课件共享平台源码数据库文档.zip