Home » Eclipse Projects » Virgo » Bundle Classpath Problem - Hibernate Mapping Files(Hibernate mapping files referenced in Spring bundle can't be found on the classpath.)
Bundle Classpath Problem - Hibernate Mapping Files [message #653934] |
Fri, 11 February 2011 22:54 |
Aaron Messages: 21 Registered: February 2011 |
Junior Member |
|
|
I'm porting an existing Spring/Hibernate app over to Virgo. I'm using Virgo 2.1.0 and Spring 3.0.5. To clarify, when I copied my project dependencies over to $VIRGO_HOME/repository/usr, those dependencies included Spring 3.0.5. I'm unclear on whether Spring 3.0.5 is being used only by my application or by the Virgo kernel as well. The 'OSGi State' admin page displays Spring 3.0.5.
My Spring bundle context includes a Hibernate session factory that is configured by:
<bean id="irisCore.sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="mappingResources">
<list>
<value>gov/noaa/nws/iris/authentication/User.hbm.xml</value>
...
</list>
</property>
<property name="hibernateProperties">
<props>
...
</props>
</property>
</bean>
When I attempt to install my bundle, I get the following error:
Error creating bean with name 'irisCore.sessionFactory' defined in URL [bundleentry://111.fwk1534925604/META-INF/spring/bundle-context.xml]: Invocation of init method failed; nested exception is java.io.FileNotFoundException: class path resource [gov/noaa/nws/iris/authentication/User.hbm.xml] cannot be opened because it does not exist
I can extract the contents of my bundle jar and see that User.hbm.xml does exist right where the Spring context says it should be:
bundle/
├── META-INF
│ ├── MANIFEST.MF
│ └── spring
│ ├── bundle-context-osgi.xml
│ └── bundle-context.xml
├── gov
│ └── noaa
│ └── nws
│ └── iris
│ ├── authentication
│ │ ├── User.class
│ │ ├── User.hbm.xml
Here is my MANIFEST.MF:
Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: Apache Maven
Built-By: aaron
Build-Jdk: 1.6.0_22
Import-Bundle: com.springsource.org.hibernate;version="[3.3.2.GA,3.3.2
.GA]"
Bundle-Vendor: NWS
Bundle-Version: 0.0.1
Tool: Bundlor 1.0.0.RELEASE
Bundle-Name: IrisCore
Bundle-ManifestVersion: 2
Bundle-SymbolicName: gov.noaa.nws.iris.IrisCore
Import-Package: com.vividsolutions.jts.geom,com.vividsolutions.jts.sim
plify,gov.noaa.nws.iris.JAXB,gov.noaa.nws.iris.authentication,gov.noa
a.nws.iris.communication,gov.noaa.nws.iris.contact,gov.noaa.nws.iris.
contact.address,gov.noaa.nws.iris.contact.email,gov.noaa.nws.iris.con
tact.phone,gov.noaa.nws.iris.fire,gov.noaa.nws.iris.geodata,gov.noaa.
nws.iris.message,gov.noaa.nws.iris.nwsoffice,gov.noaa.nws.iris.outrea
ch,gov.noaa.nws.iris.product,gov.noaa.nws.iris.product.hvtec,gov.noaa
.nws.iris.product.lsr,gov.noaa.nws.iris.product.pvtec,gov.noaa.nws.ir
is.utilities,javax.sql;version="0",org.apache.log4j,org.dom4j,org.dom
4j.io,org.geotools.referencing,org.hibernate,org.hibernate.classic,or
g.hibernate.collection,org.hibernate.criterion,org.hibernate.engine,o
rg.hibernate.id,org.hibernate.metadata,org.hibernate.persister.entity
,org.hibernate.transform,org.hibernate.type,org.hibernatespatial,org.
hibernatespatial.criterion,org.jabsorb,org.jabsorb.serializer,org.jso
n,org.springframework.dao;version="3.0.5.RELEASE",org.springframework
.orm.hibernate3;version="3.0.5.RELEASE",org.springframework.orm.hiber
nate3.support;version="3.0.5.RELEASE",org.springframework.security.ac
cess;version="3.0.4.RELEASE",org.springframework.security.access.expr
ession.method;version="3.0.4.RELEASE",org.springframework.security.ac
cess.hierarchicalroles;version="3.0.4.RELEASE",org.springframework.se
curity.access.prepost;version="3.0.4.RELEASE",org.springframework.sec
urity.authentication;version="3.0.4.RELEASE",org.springframework.secu
rity.authentication.dao;version="3.0.4.RELEASE",org.springframework.s
ecurity.authentication.encoding;version="3.0.4.RELEASE",org.springfra
mework.security.config;version="3.0.4.RELEASE",org.springframework.se
curity.core;version="3.0.4.RELEASE",org.springframework.security.core
.authority;version="3.0.4.RELEASE",org.springframework.security.core.
context;version="3.0.4.RELEASE",org.springframework.security.core.use
rdetails;version="3.0.4.RELEASE",org.springframework.security.ldap;ve
rsion="3.0.4.RELEASE",org.springframework.security.ldap.authenticatio
n;version="3.0.4.RELEASE",org.springframework.transaction.annotation;
version="3.0.5.RELEASE"
I'm not sure what's going on here. Is there another class loader coming into play that does not know about the classes loaded by the bundle class loader? Is there something fundamental I am missing?
Thank you for any suggestions.
Aaron
[Updated on: Mon, 14 February 2011 21:23] Report message to a moderator
|
|
| | | | | | | | | | |
Goto Forum:
Current Time: Thu Dec 26 20:34:53 GMT 2024
Powered by FUDForum. Page generated in 0.04505 seconds
|