2

i have an jee6 application with eclipselink and mongodb. i use the nosql-extension org.eclipse.persistence.nosql

when i deploy my application on a local glassfish instance everything works fine.

when i deply the application on remote glassfish i get the error below

glassfish version are the same on both locations the mongodb driver jar is in WEB-INF/lib

but on the remote-server i get an "java.lang.NoClassDefFoundError: com/mongodb/ServerAddress"

where is the problem ???

[#|2012-12-03T19:19:36.281+0000|CONFIG|glassfish3.1.2|org.eclipse.persistence.session.file:/usr/glassfish3/glassfish3/glassfish/domains/domain1/applications/ForecastWebApp-0.0.1-SNAPSHOT/WEB-INF/classes/_forecastMongoDB.connection|_ThreadID=1306;_ThreadName=Thread-2;|connecting(EISLogin(
        platform=> MongoPlatform
        user name=> ""
        MongoConnectionSpec()
))|#]

[#|2012-12-03T19:19:36.288+0000|SEVERE|glassfish3.1.2|org.eclipse.persistence.session.file:/usr/glassfish3/glassfish3/glassfish/domains/domain1/applications/ForecastWebApp-0.0.1-SNAPSHOT/WEB-INF/classes/_forecastMongoDB.ejb|_ThreadID=1306;_ThreadName=Thread-2;|java.lang.NoClassDefFoundError: com/mongodb/ServerAddress
        at org.eclipse.persistence.internal.nosql.adapters.mongo.MongoConnectionFactory.getConnection(MongoConnectionFactory.java:74)
        at org.eclipse.persistence.eis.EISConnectionSpec.connectToDataSource(EISConnectionSpec.java:150)
        at org.eclipse.persistence.nosql.adapters.mongo.MongoConnectionSpec.connectToDataSource(MongoConnectionSpec.java:150)
        at org.eclipse.persistence.eis.EISLogin.connectToDatasource(EISLogin.java:73)
        at org.eclipse.persistence.internal.databaseaccess.DatasourceAccessor.connectInternal(DatasourceAccessor.java:330)
        at org.eclipse.persistence.internal.databaseaccess.DatasourceAccessor.connect(DatasourceAccessor.java:418)
        at org.eclipse.persistence.sessions.server.ConnectionPool.buildConnection(ConnectionPool.java:216)
        at org.eclipse.persistence.sessions.server.ConnectionPool.startUp(ConnectionPool.java:504)
        at org.eclipse.persistence.sessions.server.ServerSession.connect(ServerSession.java:484)
        at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.login(DatabaseSessionImpl.java:734)
        at org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:217)
        at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:542)
        at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.getDatabaseSession(EntityManagerFactoryDelegate.java:186)
        at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.createEntityManagerImpl(EntityManagerFactoryDelegate.java:278)
        at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:304)
        at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:282)
        at org.glassfish.persistence.jpa.PersistenceUnitLoader.loadPU(PersistenceUnitLoader.java:211)
        at org.glassfish.persistence.jpa.PersistenceUnitLoader.<init>(PersistenceUnitLoader.java:120)
invariant
  • 8,758
  • 9
  • 47
  • 61

1 Answers1

2

ok, i found the problem

the org.eclipse.persistence.nosql_2.4.1.v20121003-ad44345.jar and the mongodb driver jar is in the /WEB-INF/lib

but on the remote-server org.eclipse.persistence.nosql_2.4.1.v20121003-ad44345.jar also in the ../glassfish/modules directory but no mongodb driver here

when i remove org.eclipse.persistence.nosql_2.4.1.v20121003-ad44345.jar from ../glassfish/modules directory

OR

add mongodb driver jar to ../glassfish/modules directory

everything works