[Solved] SFS2x and OpenJPA
Posted: 08 Nov 2010, 23:16
Hi,
Tried to include openJPA with SFS2X It seems to me like the persistence.xml file inside the jar located inside the META-INF folder cannot be found by OpenJPA, I used a test case inside Eclipse with the same project and everything goes green, db is reached and entries are made.
Here is the error :
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
>> Zone: xxx
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
08 nov. 2010 19:31:11,554 INFO [main] entities.managers.SFSZoneManager - Creating room: (default) The Lobby
08 nov. 2010 19:31:11,556 INFO [main] v2.api.SFSApi - Room created: [ Room: The Lobby, Id: 1, Group: default, isGame: false ]
08 nov. 2010 19:31:11,578 INFO [main] Extensions - {xxxGame}: LumeGame : Testing JPA
08 nov. 2010 19:31:12,241 ERROR [main] entities.managers.SFSExtensionManager -
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Exception: org.apache.openjpa.persistence.ArgumentException
Message: A JDBC Driver or DataSource class name must be specified in the ConnectionDriverName property.
Description: Extension initialization failed.
+--- --- ---+
Stack Trace:
+--- --- ---+
org.apache.openjpa.jdbc.schema.DataSourceFactory.newDataSource(DataSourceFactory.java:76)
org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.createConnectionFactory(JDBCConfigurationImpl.java:839)
org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.getDBDictionaryInstance(JDBCConfigurationImpl.java:597)
org.apache.openjpa.jdbc.meta.MappingRepository.endConfiguration(MappingRepository.java:1489)
org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:507)
org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:432)
org.apache.openjpa.lib.conf.PluginValue.instantiate(PluginValue.java:104)
org.apache.openjpa.conf.MetaDataRepositoryValue.instantiate(MetaDataRepositoryValue.java:68)
org.apache.openjpa.lib.conf.ObjectValue.instantiate(ObjectValue.java:83)
org.apache.openjpa.conf.OpenJPAConfigurationImpl.newMetaDataRepositoryInstance(OpenJPAConfigurationImpl.java:939)
org.apache.openjpa.conf.OpenJPAConfigurationImpl.getMetaDataRepositoryInstance(OpenJPAConfigurationImpl.java:930)
org.apache.openjpa.kernel.AbstractBrokerFactory.makeReadOnly(AbstractBrokerFactory.java:639)
org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:206)
org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156)
org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:227)
org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:154)
org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:60)
sfs2x.extensions.games.lume.LumeExtension.TestJPAConnexion(LumeExtension.java:49)
sfs2x.extensions.games.lume.LumeExtension.init(LumeExtension.java:33)
com.smartfoxserver.v2.entities.managers.SFSExtensionManager.createExtension(SFSExtensionManager.java:307)
com.smartfoxserver.v2.entities.managers.SFSZoneManager.createZone(SFSZoneManager.java:395)
com.smartfoxserver.v2.entities.managers.SFSZoneManager.initializeZones(SFSZoneManager.java:220)
com.smartfoxserver.v2.SmartFoxServer.start(SmartFoxServer.java:193)
com.smartfoxserver.v2.Main.main(Main.java:31)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
com.exe4j.runtime.LauncherEngine.launch(Unknown Source)
com.exe4j.runtime.WinLauncher.main(Unknown Source)
com.install4j.runtime.launcher.WinLauncher.main(Unknown Source)
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Any input on making this orm work would be nice. In fact is SFS2x made to work with orm's or should we stick to direct calls to the database ? it seems to me like using openJpa would help making asynchronous db operations more optimized.
Tried to include openJPA with SFS2X It seems to me like the persistence.xml file inside the jar located inside the META-INF folder cannot be found by OpenJPA, I used a test case inside Eclipse with the same project and everything goes green, db is reached and entries are made.
Here is the error :
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
>> Zone: xxx
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
08 nov. 2010 19:31:11,554 INFO [main] entities.managers.SFSZoneManager - Creating room: (default) The Lobby
08 nov. 2010 19:31:11,556 INFO [main] v2.api.SFSApi - Room created: [ Room: The Lobby, Id: 1, Group: default, isGame: false ]
08 nov. 2010 19:31:11,578 INFO [main] Extensions - {xxxGame}: LumeGame : Testing JPA
08 nov. 2010 19:31:12,241 ERROR [main] entities.managers.SFSExtensionManager -
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Exception: org.apache.openjpa.persistence.ArgumentException
Message: A JDBC Driver or DataSource class name must be specified in the ConnectionDriverName property.
Description: Extension initialization failed.
+--- --- ---+
Stack Trace:
+--- --- ---+
org.apache.openjpa.jdbc.schema.DataSourceFactory.newDataSource(DataSourceFactory.java:76)
org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.createConnectionFactory(JDBCConfigurationImpl.java:839)
org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.getDBDictionaryInstance(JDBCConfigurationImpl.java:597)
org.apache.openjpa.jdbc.meta.MappingRepository.endConfiguration(MappingRepository.java:1489)
org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:507)
org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:432)
org.apache.openjpa.lib.conf.PluginValue.instantiate(PluginValue.java:104)
org.apache.openjpa.conf.MetaDataRepositoryValue.instantiate(MetaDataRepositoryValue.java:68)
org.apache.openjpa.lib.conf.ObjectValue.instantiate(ObjectValue.java:83)
org.apache.openjpa.conf.OpenJPAConfigurationImpl.newMetaDataRepositoryInstance(OpenJPAConfigurationImpl.java:939)
org.apache.openjpa.conf.OpenJPAConfigurationImpl.getMetaDataRepositoryInstance(OpenJPAConfigurationImpl.java:930)
org.apache.openjpa.kernel.AbstractBrokerFactory.makeReadOnly(AbstractBrokerFactory.java:639)
org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:206)
org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156)
org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:227)
org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:154)
org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:60)
sfs2x.extensions.games.lume.LumeExtension.TestJPAConnexion(LumeExtension.java:49)
sfs2x.extensions.games.lume.LumeExtension.init(LumeExtension.java:33)
com.smartfoxserver.v2.entities.managers.SFSExtensionManager.createExtension(SFSExtensionManager.java:307)
com.smartfoxserver.v2.entities.managers.SFSZoneManager.createZone(SFSZoneManager.java:395)
com.smartfoxserver.v2.entities.managers.SFSZoneManager.initializeZones(SFSZoneManager.java:220)
com.smartfoxserver.v2.SmartFoxServer.start(SmartFoxServer.java:193)
com.smartfoxserver.v2.Main.main(Main.java:31)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
com.exe4j.runtime.LauncherEngine.launch(Unknown Source)
com.exe4j.runtime.WinLauncher.main(Unknown Source)
com.install4j.runtime.launcher.WinLauncher.main(Unknown Source)
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Any input on making this orm work would be nice. In fact is SFS2x made to work with orm's or should we stick to direct calls to the database ? it seems to me like using openJpa would help making asynchronous db operations more optimized.