[Beginner's Corner] - EJB Persistence with JBoss 6 v2
by Steve Dobson
Steve Dobson [http://community.jboss.org/people/dobbo314] created the discussion
"EJB Persistence with JBoss 6 v2"
To view the discussion, visit: http://community.jboss.org/message/591456#591456
--------------------------------------------------------------
JBoss 6.0.0 Final installed and configured to use MySQL as it's backend database. Well it seams to work.
Had trouble deploying a simple EJB so I stripped things down to the minimum I could. The EJB JAR file as almost nothing in it:
0 Sun Mar 06 10:49:58 GMT 2011 META-INF/
106 Sun Mar 06 10:49:56 GMT 2011 META-INF/MANIFEST.MF
1038 Sun Mar 06 10:34:42 GMT 2011 META-INF/persistence.xml
0 Sun Mar 06 10:48:48 GMT 2011 org/
0 Sun Mar 06 10:48:48 GMT 2011 org/dobbo/
0 Sun Mar 06 10:48:48 GMT 2011 org/dobbo/stadia/
0 Sun Mar 06 10:48:48 GMT 2011 org/dobbo/stadia/data/
1482 Sun Mar 06 10:48:48 GMT 2011 org/dobbo/stadia/data/Name.class
Here is the important part of the EJB which is a test case for how I wish to develop my idea:
@Entity
@Inheritance(strategy=InheritanceType.SINGLE_TABLE)
@Table(name="sName")
public class Name
implements Serializable {
private UUID theUUID = null;
private String theName = null;
public UUID getUUID() {
return theUUID;
}
public void setUUID(UUID newUUID) {
theUUID = newUUID;}
@Id
@Column(name="ident", length=36)
public String getIdentity() {
return getUUID().toString();
}
public void setUUID(String newUUID) {
setUUID(UUID.fromString(newUUID));
}
@Column(name="name", length=50)
public final String getName() {
return theName;
}
public void setName(String newName) {
theName = newName;
}
}
And the persistance.xml file that was included in the JAR:
q java:/stadiaDS org.hibernate.ejb.HibernatePersistence
false
10:50:39,015 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] Error installing to Parse: name=vfs:///home/jboss/jboss-6.0.0.Final/server/default/deploy/stadia-ejbs.jar state=PreParse mode=Manual requiredState=Parse: org.jboss.deployers.spi.DeploymentException: Error creating managed object for vfs:///home/jboss/jboss-6.0.0.Final/server/default/deploy/stadia-ejbs.jar
at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49) [:2.2.0.GA]
at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(AbstractParsingDeployerWithOutput.java:383) [:2.2.0.GA]
at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(AbstractParsingDeployerWithOutput.java:343) [:2.2.0.GA]
at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(AbstractParsingDeployerWithOutput.java:315) [:2.2.0.GA]
at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.deploy(AbstractParsingDeployerWithOutput.java:255) [:2.2.0.GA]
at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:179) [:2.2.0.GA]
at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1832) [:2.2.0.GA]
at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1550) [:2.2.0.GA]
at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1491) [:2.2.0.GA]
at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:379) [jboss-dependency.jar:2.2.0.GA]
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2044) [jboss-dependency.jar:2.2.0.GA]
at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1083) [jboss-dependency.jar:2.2.0.GA]
at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1322) [jboss-dependency.jar:2.2.0.GA]
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1246) [jboss-dependency.jar:2.2.0.GA]
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1139) [jboss-dependency.jar:2.2.0.GA]
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:939) [jboss-dependency.jar:2.2.0.GA]
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:654) [jboss-dependency.jar:2.2.0.GA]
at org.jboss.deployers.plugins.deployers.DeployersImpl.change(DeployersImpl.java:1983) [:2.2.0.GA]
at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:1076) [:2.2.0.GA]
at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:679) [:2.2.0.GA]
at org.jboss.system.server.profileservice.deployers.MainDeployerPlugin.process(MainDeployerPlugin.java:106) [:6.0.0.Final]
at org.jboss.profileservice.dependency.ProfileControllerContext$DelegateDeployer.process(ProfileControllerContext.java:143) [:0.2.2]
at org.jboss.profileservice.deployment.hotdeploy.HDScanner$HDScanAction.deploy(HDScanner.java:240) [:0.2.2]
at org.jboss.profileservice.deployment.hotdeploy.HDScanner$HDScanAction.complete(HDScanner.java:192) [:0.2.2]
at org.jboss.profileservice.management.TwoPCActionWrapper.doComplete(TwoPCActionWrapper.java:57) [:0.2.2]
at org.jboss.profileservice.management.actions.AbstractTwoPhaseModificationAction.complete(AbstractTwoPhaseModificationAction.java:74) [:0.2.2]
at org.jboss.profileservice.management.actions.AbstractTwoPhaseModificationAction.prepare(AbstractTwoPhaseModificationAction.java:95) [:0.2.2]
at org.jboss.profileservice.management.ModificationSession.prepare(ModificationSession.java:87) [:0.2.2]
at org.jboss.profileservice.management.AbstractActionController.internalPerfom(AbstractActionController.java:234) [:0.2.2]
at org.jboss.profileservice.management.AbstractActionController.performWrite(AbstractActionController.java:213) [:0.2.2]
at org.jboss.profileservice.management.AbstractActionController.perform(AbstractActionController.java:150) [:0.2.2]
at org.jboss.profileservice.management.AbstractActionController.perform(AbstractActionController.java:135) [:0.2.2]
at org.jboss.profileservice.deployment.hotdeploy.HDScanner.scan(HDScanner.java:146) [:0.2.2]
at org.jboss.profileservice.deployment.hotdeploy.HDScanner.run(HDScanner.java:90) [:0.2.2]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) [:1.6.0_22]
at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317) [:1.6.0_22]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150) [:1.6.0_22]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98) [:1.6.0_22]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:180) [:1.6.0_22]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:204) [:1.6.0_22]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_22]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_22]
at java.lang.Thread.run(Thread.java:662) [:1.6.0_22]
Caused by: org.jboss.xb.binding.JBossXBException: Failed to parse source: vfs:///home/jboss/jboss-6.0.0.Final/server/default/deploy/stadia-ejbs.jar/META-INF/persistence.xml@8,17
at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:224) [jbossxb.jar:2.0.3.GA]
at org.jboss.xb.binding.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:178) [jbossxb.jar:2.0.3.GA]
at org.jboss.xb.util.JBossXBHelper.parse(JBossXBHelper.java:257) [jbossxb.jar:2.0.3.GA]
at org.jboss.xb.util.JBossXBHelper.parse(JBossXBHelper.java:231) [jbossxb.jar:2.0.3.GA]
at org.jboss.deployers.vfs.spi.deployer.SchemaResolverDeployer.parse(SchemaResolverDeployer.java:137) [:2.2.0.GA]
at org.jboss.deployers.vfs.spi.deployer.SchemaResolverDeployer.parse(SchemaResolverDeployer.java:121) [:2.2.0.GA]
at org.jboss.deployers.vfs.spi.deployer.AbstractVFSParsingDeployer.parseAndInit(AbstractVFSParsingDeployer.java:352) [:2.2.0.GA]
at org.jboss.deployers.vfs.spi.deployer.AbstractVFSParsingDeployer.parseAndInit(AbstractVFSParsingDeployer.java:334) [:2.2.0.GA]
at org.jboss.deployers.vfs.spi.deployer.AbstractVFSParsingDeployer.parse(AbstractVFSParsingDeployer.java:251) [:2.2.0.GA]
at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(AbstractParsingDeployerWithOutput.java:369) [:2.2.0.GA]
... 41 more
Caused by: org.xml.sax.SAXException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'provider'. One of '{"http://java.sun.com/xml/ns/persistence":non-jta-data-source, "http://java.sun.com/xml/ns/persistence":mapping-file, "http://java.sun.com/xml/ns/persistence":jar-file, "http://java.sun.com/xml/ns/persistence":class, "http://java.sun.com/xml/ns/persistence":exclude-unlisted-classes, "http://java.sun.com/xml/ns/persistence":shared-cache-mode, "http://java.sun.com/xml/ns/persistence":validation-mode, "http://java.sun.com/xml/ns/persistence":properties}' is expected. @ vfs:///home/jboss/jboss-6.0.0.Final/server/default/deploy/stadia-ejbs.jar/META-INF/persistence.xml[8,17]
at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.error(SaxJBossXBParser.java:416) [jbossxb.jar:2.0.3.GA]
at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source) [xercesImpl.jar:6.0.0.Final]
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) [xercesImpl.jar:6.0.0.Final]
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) [xercesImpl.jar:6.0.0.Final]
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) [xercesImpl.jar:6.0.0.Final]
at org.apache.xerces.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(Unknown Source) [xercesImpl.jar:6.0.0.Final]
at org.apache.xerces.impl.xs.XMLSchemaValidator.reportSchemaError(Unknown Source) [xercesImpl.jar:6.0.0.Final]
at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source) [xercesImpl.jar:6.0.0.Final]
at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(Unknown Source) [xercesImpl.jar:6.0.0.Final]
at org.apache.xerces.xinclude.XIncludeHandler.startElement(Unknown Source) [xercesImpl.jar:6.0.0.Final]
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source) [xercesImpl.jar:6.0.0.Final]
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) [xercesImpl.jar:6.0.0.Final]
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) [xercesImpl.jar:6.0.0.Final]
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) [xercesImpl.jar:6.0.0.Final]
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) [xercesImpl.jar:6.0.0.Final]
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) [xercesImpl.jar:6.0.0.Final]
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) [xercesImpl.jar:6.0.0.Final]
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) [xercesImpl.jar:6.0.0.Final]
at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:209) [jbossxb.jar:2.0.3.GA]
... 50 more
10:50:39,319 WARN [org.jboss.profileservice.deployment.hotdeploy.HDScanner] Scan failed: org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):
So my questions:
What have I done wrong, not done, missed?
Where is there a really good (i.e. simple) guide to hybernation in JBoss 6?
Many thanks for your help
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/591456#591456]
Start a new discussion in Beginner's Corner at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 1 month
[jBPM] - jbpm5 not able to run multiple instances of a process
by ritesh adval
ritesh adval [http://community.jboss.org/people/riteshadval] created the discussion
"jbpm5 not able to run multiple instances of a process"
To view the discussion, visit: http://community.jboss.org/message/580755#580755
--------------------------------------------------------------
I ran the sample tests in jbpm-bpmn2 source directory to test if multiple process instance can be run where each instance is not yet finished. It is not working for me. What I observed is that each new instance of a process is getting 1 as the process instance id?
This is what I did:
(1) I configured persistence.xml to use mysql.
(2) I start an instance of process ( https://github.com/krisv/jbpm/blob/master/jbpm-bpmn2/src/test/resources/B... BPMN2-EventBasedSplit.bpmn2) by running testEventBasedSplit() of org/jbpm/bpmn2/StandaloneBPMNProcessTest, and run it till just before sending Yes signal.
(3) I create another instance of above process and do the same as step (2),
So at this point there should be two process instance which are not yet completed.What I am observing is that two process instance in PROCESSINSTANCELOG have same process instance id. I tried creating one session StatefulKnowledgeSession with two instance and they are getting same instance id.
So when I recreate StatefulKnowledgeSession by using existing sessionid of database, I only get one process instance from the api which returns list of process instance.
Other thing I have noticed is that PROCESSINSTANCEINFO is always empty and no row is inserted there, could this be an issue?
I was able to configure history log to start saving , NODEINSTANCELOG, variable and PROCESSINSTANCELO, I am not sure why PROCESSINSTANCELOG is empty?
Maybe I am missing something, I am new to jbpm and trying to evaluate if we should use jbpm5 or stick to jbpm4.4 for sometime.
-Ritesh.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/580755#580755]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 1 month
[jBPM] - get the task id in human task handler
by Odelya Holiday
Odelya Holiday [http://community.jboss.org/people/odelyaholiday] created the discussion
"get the task id in human task handler"
To view the discussion, visit: http://community.jboss.org/message/591477#591477
--------------------------------------------------------------
Hi!
In my application I create a custom human task handler that sends web service to external program with the current human task id.
I tried to extract the task by adding after this:
client.addTask(task, content, null);
Long taskId = task.getId();
taskId is always 0!
I think that it's because I wrap my process in one transaction - so it doesn't save to database the task until the process finished.
UserTransaction ut =
(UserTransaction) new InitialContext().lookup( "java:comp/UserTransaction" );
ut.begin();
ksession.startProcess( "MyProcess" );
// commit the transaction
ut.commit()
I believe that I can't create transaction inside transaction - so how can I retrieve the task id within the human task handler in order to use it for future task complete purposes?
how do you recommend to use transactions otherwise?
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/591477#591477]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 1 month
[JBoss Cache] - Re: exception from CacheJmxWrapperMBean.getCache()
by Tarundeep Singh
Tarundeep Singh [http://community.jboss.org/people/tarundeep_singh] created the discussion
"Re: exception from CacheJmxWrapperMBean.getCache()"
To view the discussion, visit: http://community.jboss.org/message/591336#591336
--------------------------------------------------------------
Hi Peter,
Good Morning.
I was struggling with this issue until yesterday. Saw your post, took some help from it. And then I faced the same problem as you did. I actually also got lucky to resolve this issue.
This is a two step process:
1. The call to cacheJmxWrapper.getCache() will be actually returning cacheJmxWrapper.getCache() an instance of org.jboss.cache.invocation.CacheInvocationDelegate. Therefore, the type casting needs to be corrected here.
2.
> > * java.lang.ClassCastException: org.jboss.cache.invocation.CacheInvocationDelegate cannot be cast to org.jboss.cache.Cache
> >
> at $Proxy17.getCache(Unknown Source)
This actually happenned since my both applications were using there own set of JBoss Cache related jars. And since different instances of class loaders were loading these jars, these class cast exception took place. Resolution to this was to take these Jboss cache related jars from each of the applications and store them inside the application servers instance.
The issue got resolved and a single instance of Jboss cache was accessible for both the applications. :) :)
This also answers that this is not a defect in JBoss Cache. :)
Thank you.
Enjoy.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/591336#591336]
Start a new discussion in JBoss Cache at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 1 month
Hot deploy to Jboss 4
by Mike Franon
>From what I understand if you just drop the war file in
/server/servername/deploy folder, it should automatically hot deploy?
Is there another step I need to do?
I tried overwriting a current war several times with an updated
version, and I never see anything show up in logs.
Thanks
15 years, 1 month