Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] OSGI Manifest

Defect opened.

Thanks for the prompt response.  And for correcting the verbiage.

I'm following the POC as a baseline for eclipselink + osgi, and I'm getting the following error when I create my own activator.  (I'm trying with eclipselink 1.1-M2)


Caused by: java.lang.NoClassDefFoundError: javax/sql/DataSource
    at org.eclipse.persistence.internal.jpa.deployment.PersistenceUnitProcessor.processPersistenceXML(PersistenceUnitProcessor.java:361)
    at org.eclipse.persistence.internal.jpa.deployment.PersistenceUnitProcessor.processPersistenceArchive(PersistenceUnitProcessor.java:314)
    at org.eclipse.persistence.internal.jpa.deployment.PersistenceUnitProcessor.getPersistenceUnits(PersistenceUnitProcessor.java:237)
    at org.eclipse.persistence.internal.jpa.deployment.JPAInitializer.initPersistenceUnits(JPAInitializer.java:146)
    at org.eclipse.persistence.internal.jpa.deployment.JPAInitializer.initialize(JPAInitializer.java:135)

I don't see the import for javax.sql in the eclipselink jpa osgi 1.1-M2 bundle. 
I'm not sure if that's intentional or not.  Or If I've done something wrong :)

Cheers,
Eric G.



On Tue, Oct 14, 2008 at 10:18 AM, Tom Ware <tom.ware@xxxxxxxxxx> wrote:
Hi Eric,

 You are correct.  At the moment, we are not including version numbers of the packages we export.  It would be a good idea to enter a bugzilla issue to have this resolved.

 I believe the reason we do not see a lot of traffic on the mailing lists about this issue is that if you import the EclipseLink bundles as bundles (rather than as packages) things should work.  That may provide a workaround for you.

-Tom

Eric Gulatee wrote:
All,

I'm currently having trouble deploying the osgi bundles with spring on the spring dm server platform.
It seems to be due to the osgi manifests not containing version information. It would seem spring has an optional import on versions 1 through 2.
And since there isn't version info in the 1.1-M2 manifests, it's failing to be imported.  [What I've been told]

For anyone interested, here's the thread on springsource's forums.
http://forum.springframework.org/showthread.php?t=61456

Cheers,
Eric Gulatee.


------------------------------------------------------------------------

_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users
_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users

<?xml version="1.0" encoding="UTF-8" ?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence";
	version="1.0">
	<persistence-unit name="TestJPA">
		<class>da.db.model.Test</class>
	</persistence-unit>
</persistence>
package da.db.osgi;


import java.util.Properties;

import javax.persistence.EntityManagerFactory;

import org.eclipse.persistence.jpa.osgi.Activator;
import org.eclipse.persistence.jpa.osgi.PersistenceProvider;
import org.osgi.framework.BundleContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;


public class JPAActivator  extends Activator
{

	Logger logger = LoggerFactory.getLogger(JPAActivator.class);
	
	public JPAActivator()
	{
	}
	
	@Override
	public void start(BundleContext ctx)
		throws Exception
	{
		logger.info("Starting JPA Bundle");
		super.start(ctx);
		
		try
		{
			Properties properties = new Properties();
			properties.put("eclipselink.classloader", this.getClass().getClassLoader());

			PersistenceProvider pp  =new PersistenceProvider();
			EntityManagerFactory emf = pp.createEntityManagerFactory("TestJPA", properties);
			
		}
		catch (Exception e)
		{
			logger.error("", e);
		}
	}
	
	@Override
	public void stop(BundleContext ctx)
		throws Exception
	{
		logger.info("Stopping JPA Bundle");
		super.stop(ctx);
		
		
	}
}

Back to the top