[jBPM] - NullPointerException when loading the ksession (Unable to load session snapshot)
by Miloud Haimoune
Miloud Haimoune [https://community.jboss.org/people/milhaim] created the discussion
"NullPointerException when loading the ksession (Unable to load session snapshot)"
To view the discussion, visit: https://community.jboss.org/message/734562#734562
--------------------------------------------------------------
Hi all,
I am facing the following issue:
When loading the ksession from the data base (I'm using persisted ksession), after restarting the jboss AS this exception happens:
INFO [ProcessManager] Loading session data ...
14:14:40,457 ERROR [SingleSessionCommandService] Could not commit session
java.lang.RuntimeException: Unable to load session snapshot
at org.drools.persistence.SessionMarshallingHelper.loadSnapshot(SessionMarshallingHelper.java:96)
at org.drools.persistence.SingleSessionCommandService.initKsession(SingleSessionCommandService.java:238)
at org.drools.persistence.SingleSessionCommandService.<init>(SingleSessionCommandService.java:191)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.drools.persistence.jpa.KnowledgeStoreServiceImpl.buildCommandService(KnowledgeStoreServiceImpl.java:101)
at org.drools.persistence.jpa.KnowledgeStoreServiceImpl.loadStatefulKnowledgeSession(KnowledgeStoreServiceImpl.java:84)
......
Caused by: java.lang.NullPointerException
at org.drools.marshalling.impl.InputMarshaller.readActivation(InputMarshaller.java:1000)
at org.drools.marshalling.impl.InputMarshaller.readActivations(InputMarshaller.java:981)
at org.drools.marshalling.impl.InputMarshaller.readSession(InputMarshaller.java:281)
at org.drools.marshalling.impl.InputMarshaller.readSession(InputMarshaller.java:196)
at org.drools.marshalling.impl.DefaultMarshaller.unmarshall(DefaultMarshaller.java:93)
at org.drools.persistence.SessionMarshallingHelper.loadSnapshot(SessionMarshallingHelper.java:91)
it happens when jbpm try to unmarshall the filed +*rulesbytearray*+ (sessionInfo table) when loading the ksession.
I have this issue only when I update the drools or the process definition file (using guvnor) and restart the jboss AS (but not all the time).
I'm working with jbpm 5.2 final and Jboss 5.1 and persisted ksession.
Any solution or idea will be very helpful.
Thank you.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/734562#734562]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 7 months
Re: [jboss-user] [Datasource Configuration] - JBoss AS 7 - Datasource configuration for postgresql
by Craig Ringer
Craig Ringer [https://community.jboss.org/people/ringerc] commented on the document
"JBoss AS 7 - Datasource configuration for postgresql"
To view all comments on this document, visit: https://community.jboss.org/docs/DOC-17064#comment-9848
--------------------------------------------------
Note that you may instead deploy the PostgreSQL JDBC driver as a module. That's the only way you'll be able to use a -ds.xml file to define a datasource, as far as I can tell anyway.
Create the directory modules/org/postgresql/main and place postgresql-9.1-901-1.jdbc4.jar within it. Now create a module.xml file in the same place, with the content:
<module xmlns="urn:jboss:module:1.1" name="org.postgresql">
<!-- Load with jboss-cli command:
/subsystem=datasources/jdbc-driver=postgresql-driver:add(driver-name=postgresql-driver, driver-class-name=org.postgresql.Driver, driver-module-name=org.postgresql)
-->
<resources>
<resource-root path="postgresql-9.1-901-1.jdbc4.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>
</module>
Activate it as "postgresql-driver" with
jboss-cli.sh --connect command="/subsystem=datasources/jdbc-driver=postgresql-driver:add(driver-name=postgresql-driver, driver-class-name=org.postgresql.Driver, driver-module-name=org.postgresql"
You may now use this driver in -ds.xml files by specifying it as "postgresql-driver", eg:
<?xml version="1.0" encoding="UTF-8"?>
<datasources>
<datasource jndi-name="java:/datasources/some-ds" enabled="true" use-java-context="true"
pool-name="some-ds-pool">
<connection-url>jdbc:postgresql:somedb</connection-url>
<driver>postgresql-driver</driver>
<security>
<user-name>user</user-name>
<password>pass</password>
</security>
</datasource>
</datasources>
Unlike explicitly naming the jdbc jar in a data-source create command, you can now update PgJDBC without changing all your datasources.
--------------------------------------------------
12 years, 7 months