|
|
Re: Configure OM2M to connect to the server [message #1781220 is a reply to message #1780942] |
Sat, 03 February 2018 09:08 |
Sting Yong Messages: 2 Registered: January 2018 |
Junior Member |
|
|
Hi Guillaume,
Thank you for your reply.
I started a TCP server using command "java -jar h2-1.4.196.jar -webAllowOthers -tcpAllowOthers" and it showed that the TCP server is running at tcp://127.0.1.1:41903
(The port may change every time I started a new TCP server). After I successfully started the server, I tested the connection using the web console of h2 so I think my h2 server was started correctly.
I then modified dburl in the config.ini file :
org.eclipse.om2m.dbUrl=jdbc\:h2\:tcp\://127.0.1.1\:41903/~/indb
However, there were always errors as below when I started "sh start.sh" in cmd:
Error in creation of EntityManagerFactory
javax.persistence.PersistenceException: Exception [EclipseLink-4019] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.DatabaseException
Exception Description: Error while obtaining information about the database. Refer to the nested exception for more details.
at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:766)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.getAbstractSession(EntityManagerFactoryDelegate.java:204)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.getDatabaseSession(EntityManagerFactoryDelegate.java:182)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.getDatabaseSession(EntityManagerFactoryImpl.java:527)
at org.eclipse.persistence.jpa.PersistenceProvider.createEntityManagerFactoryImpl(PersistenceProvider.java:140)
at org.eclipse.persistence.jpa.PersistenceProvider.createEntityManagerFactory(PersistenceProvider.java:177)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:79)
at org.eclipse.om2m.persistence.eclipselink.internal.DBServiceJPAImpl.init(DBServiceJPAImpl.java:103)
at org.eclipse.om2m.persistence.eclipselink.Activator$1.run(Activator.java:51)
Caused by: Exception [EclipseLink-4019] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.DatabaseException
Exception Description: Error while obtaining information about the database. Refer to the nested exception for more details.
at org.eclipse.persistence.exceptions.DatabaseException.errorRetrieveDbMetadataThroughJDBCConnection(DatabaseException.java:368)
at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.setOrDetectDatasource(DatabaseSessionImpl.java:238)
at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource(DatabaseSessionImpl.java:741)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:239)
at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:685)
... 8 more
Caused by: org.h2.jdbc.JdbcSQLException: Connection is broken: "unexpected status 16777216" [90067-186]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:345)
at org.h2.message.DbException.get(DbException.java:179)
at org.h2.message.DbException.get(DbException.java:155)
at org.h2.engine.SessionRemote.done(SessionRemote.java:637)
at org.h2.engine.SessionRemote.close(SessionRemote.java:568)
at org.h2.jdbc.JdbcConnection.close(JdbcConnection.java:384)
at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.setOrDetectDatasource(DatabaseSessionImpl.java:235)
... 11 more
[2018-01-30 20:41:19,565 ERROR] - org.eclipse.om2m.persistence.eclipselink.internal.DBServiceJPAImpl
ERROR initializing Database: EntityManagerFactory is null!
I did also tried jdbc\:h2\:tcp\://127.0.0.1\:8082/~/sample or changing the dbuser and password, but similar errors showed up as above when I started running CSE. It seemed like OM2M was not able to find my h2 database. Should I delete the default embedded h2 database when configuring OM2M to connect to server? Can anyone tell me where I did it wrong?
[Updated on: Sat, 03 February 2018 09:09] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.02544 seconds