[jBPM] - Where is the problem? In the file or in the installation?
by stellina_rosa
stellina_rosa [http://community.jboss.org/people/stellina_rosa] created the discussion
"Where is the problem? In the file or in the installation?"
To view the discussion, visit: http://community.jboss.org/message/595731#595731
--------------------------------------------------------------
Hello everybody!
I've installed JBPM5 (i followed the instruction on this community) and i tried to execute the "HelloProcess".. but there is an error:
java.lang.IllegalArgumentException: Unable to instantiate service for Class 'org.drools.compiler.BPMN2ProcessProvider'
at org.drools.util.ServiceRegistryImpl.get(ServiceRegistryImpl.java:162)
at org.drools.compiler.BPMN2ProcessFactory.loadProvider(BPMN2ProcessFactory.java:29)
at org.drools.compiler.BPMN2ProcessFactory.getBPMN2ProcessProvider(BPMN2ProcessFactory.java:21)
at org.drools.compiler.BPMN2ProcessFactory.configurePackageBuilder(BPMN2ProcessFactory.java:12)
at org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:469)
at org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:28)
at com.sample.ProcessTest.readKnowledgeBase(ProcessTest.java:33)
at com.sample.ProcessTest.main(ProcessTest.java:20)
Caused by: java.lang.IllegalArgumentException: Unable to instantiate 'org.jbpm.bpmn2.BPMN2ProcessProviderImpl'
at org.drools.util.ServiceRegistryImpl$ReflectionInstantiator.newInstance(ServiceRegistryImpl.java:211)
at org.drools.util.ServiceRegistryImpl$ReflectionInstantiator.call(ServiceRegistryImpl.java:203)
at org.drools.util.ServiceRegistryImpl.get(ServiceRegistryImpl.java:160)
... 7 more
Caused by: java.lang.ClassNotFoundException: org.jbpm.bpmn2.BPMN2ProcessProviderImpl
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.drools.util.ServiceRegistryImpl$ReflectionInstantiator.newInstance(ServiceRegistryImpl.java:208)
... 9 more
I dont't understand it.. could anyone help me?
thanks
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/595731#595731]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years
[jBPM] - TaskServer, persistence file and session
by Odelya Holiday
Odelya Holiday [http://community.jboss.org/people/odelyaholiday] created the discussion
"TaskServer, persistence file and session"
To view the discussion, visit: http://community.jboss.org/message/588542#588542
--------------------------------------------------------------
Hi!
I was wondering, I so in the emergency demo application that the TaskServer retrieves the persistence file for the the task server to start like this:
emf = Persistence.createEntityManagerFactory("org.jbpm.task");
taskService = new TaskService(emf, SystemEventListenerFactory.getSystemEventListener());
In the persistence examples, I saw that actually we create the session with the persistence like this:
EntityManagerFactory emf = Persistence.createEntityManagerFactory("org.drools.persistence.jpa");
Environment env = KnowledgeBaseFactory.newEnvironment();
env.set(EnvironmentName.ENTITY_MANAGER_FACTORY, emf);
env.set(EnvironmentName.GLOBALS, new MapGlobalResolver());
env.set(EnvironmentName.TRANSACTION_MANAGER, TransactionManagerServices.getTransactionManager());
ksession = JPAKnowledgeService.newStatefulKnowledgeSession(kbase, null, env);
If I am using persistence for the ksession, do I still need to start the TaskService with a new persistence,or the same persistence can be used for both like this:
EntityManagerFactory emf = Persistence.createEntityManagerFactory("org.drools.persistence.jpa");
taskService = new TaskService(emf, SystemEventListenerFactory.getSystemEventListener());
Environment env = KnowledgeBaseFactory.newEnvironment();
env.set(EnvironmentName.ENTITY_MANAGER_FACTORY, emf);
env.set(EnvironmentName.GLOBALS, new MapGlobalResolver());
env.set(EnvironmentName.TRANSACTION_MANAGER, TransactionManagerServices.getTransactionManager());
ksession = JPAKnowledgeService.newStatefulKnowledgeSession(kbase, null, env);
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/588542#588542]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years
[jBPM] - Re: JBPM 4.3 - org.jbpm.api.JbpmException: couldn't acquire block of ids
by T-9000 Skynet
T-9000 Skynet [http://community.jboss.org/people/t-9000] created the discussion
"Re: JBPM 4.3 - org.jbpm.api.JbpmException: couldn't acquire block of ids"
To view the discussion, visit: http://community.jboss.org/message/595664#595664
--------------------------------------------------------------
Hi All,
I am getting the same error but when I am saving the process variables.
ExecutionService.setVariable(executionId, "Title", entityObject.getTitle());
org.jbpm.api.JbpmException: couldn't acquire block of ids
at org.jbpm.pvm.internal.id.DatabaseDbidGenerator.getNextId(DatabaseDbidGenerator.java:65)
at org.jbpm.pvm.internal.lob.Lob.<init>(Lob.java:81)
at org.jbpm.pvm.internal.type.variable.BlobVariable.setObject(BlobVariable.java:54)
at org.jbpm.pvm.internal.type.Variable.setValue(Variable.java:95)
at org.jbpm.pvm.internal.type.variable.BlobVariable.setValue(BlobVariable.java:66)
at org.jbpm.pvm.internal.model.ScopeInstanceImpl.setVariable(ScopeInstanceImpl.java:174)
at org.jbpm.pvm.internal.model.ScopeInstanceImpl.setVariables(ScopeInstanceImpl.java:185)
at org.jbpm.pvm.internal.cmd.SetExecutionVariablesCmd.execute(SetExecutionVariablesCmd.java:46)
at org.jbpm.pvm.internal.cmd.SetExecutionVariablesCmd.execute(SetExecutionVariablesCmd.java:31)
at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)
at org.jbpm.pvm.internal.tx.SpringCommandCallback.doInTransaction(SpringCommandCallback.java:45)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:128)
at org.jbpm.pvm.internal.tx.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:49)
at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.executeInNewEnvironment(EnvironmentInterceptor.java:53)
at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:40)
at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:56)
at org.jbpm.pvm.internal.svc.ExecutionServiceImpl.setVariable(ExecutionServiceImpl.java:146)
at com.iquniverse.core.service.impl.CoreExecutionServiceImpl.setVariable(CoreExecutionServiceImpl.java:114)
at com.iquniverse.service.impl.ProcessServiceImpl.dialogSave(ProcessServiceImpl.java:113)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:592)
at org.directwebremoting.impl.ExecuteAjaxFilter.doFilter(ExecuteAjaxFilter.java:34)
at org.directwebremoting.impl.DefaultRemoter$1.doFilter(DefaultRemoter.java:428)
at org.directwebremoting.impl.DefaultRemoter.execute(DefaultRemoter.java:431)
at org.directwebremoting.impl.DefaultRemoter.execute(DefaultRemoter.java:283)
at org.directwebremoting.servlet.PlainCallHandler.handle(PlainCallHandler.java:52)
at org.directwebremoting.servlet.UrlProcessor.handle(UrlProcessor.java:101)
at org.directwebremoting.servlet.DwrServlet.doPost(DwrServlet.java:146)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:378)
at org.springframework.security.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:10
9)
at org.springframework.security.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:
83)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
at org.springframework.security.ui.SessionFixationProtectionFilter.doFilterHttp(SessionFixationProtectionFilter.
java:67)
at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
at org.springframework.security.ui.ExceptionTranslationFilter.doFilterHttp(ExceptionTranslationFilter.java:101)
at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
at org.springframework.security.providers.anonymous.AnonymousProcessingFilter.doFilterHttp(AnonymousProcessingFi
lter.java:105)
at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
at org.springframework.security.wrapper.SecurityContextHolderAwareRequestFilter.doFilterHttp(SecurityContextHold
erAwareRequestFilter.java:91)
at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
at org.springframework.security.ui.AbstractProcessingFilter.doFilterHttp(AbstractProcessingFilter.java:278)
at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
at org.springframework.security.ui.logout.LogoutFilter.doFilterHttp(LogoutFilter.java:89)
at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
at org.springframework.security.context.HttpSessionContextIntegrationFilter.doFilterHttp(HttpSessionContextInteg
rationFilter.java:235)
at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
at org.springframework.security.concurrent.ConcurrentSessionFilter.doFilterHttp(ConcurrentSessionFilter.java:99)
at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
at org.springframework.security.util.FilterChainProxy.doFilter(FilterChainProxy.java:175)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
at java.lang.Thread.run(Thread.java:595)
Caused by: org.hibernate.ObjectDeletedException: deleted object would be re-saved by cascade (remove deleted object from
associations): [org.jbpm.pvm.internal.lob.Lob#60012]
at org.hibernate.impl.SessionImpl.forceFlush(SessionImpl.java:1014)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.j
ava:165)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener
.java:94)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java
:70)
at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:507)
at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:499)
at org.hibernate.engine.CascadingAction$1.cascade(CascadingAction.java:218)
at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:268)
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:216)
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:169)
at org.hibernate.engine.Cascade.cascade(Cascade.java:130)
at org.hibernate.event.def.AbstractFlushingEventListener.cascadeOnFlush(AbstractFlushingEventListener.java:131)
at org.hibernate.event.def.AbstractFlushingEventListener.prepareEntityFlushes(AbstractFlushingEventListener.java
:122)
at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListen
er.java:65)
at org.hibernate.event.def.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:35)
at org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:969)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1562)
at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:283)
at org.hibernate.impl.CriteriaImpl.uniqueResult(CriteriaImpl.java:305)
at org.jbpm.pvm.internal.id.AcquireDbidBlockCmd.execute(AcquireDbidBlockCmd.java:25)
at org.jbpm.pvm.internal.id.AcquireDbidBlockCmd.execute(AcquireDbidBlockCmd.java:12)
at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)
at org.jbpm.pvm.internal.tx.SpringCommandCallback.doInTransaction(SpringCommandCallback.java:45)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:128)
at org.jbpm.pvm.internal.tx.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:49)
at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.executeInExistingEnvironment(EnvironmentInterceptor.java:47)
at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:42)
at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:56)
at org.jbpm.pvm.internal.id.DatabaseDbidGenerator.acquireDbidBlock(DatabaseDbidGenerator.java:76)
at org.jbpm.pvm.internal.id.DatabaseDbidGenerator.getNextId(DatabaseDbidGenerator.java:63)
... 84 more
16:05:49,151 WARN [BaseCallMarshaller] --Erroring: batchId[15] message[org.jbpm.api.JbpmException: couldn't acquire blo
ck of ids]
I did change hibernate.hbm2ddl.auto=create but still no luck..
how did you guys resolve the issue??
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/595664#595664]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years
[jBPM] - Storing long String (>255 Characters) in Process Variables is not Possible(?)
by Silvio Meier
Silvio Meier [http://community.jboss.org/people/k0k0pelli] created the discussion
"Storing long String (>255 Characters) in Process Variables is not Possible(?)"
To view the discussion, visit: http://community.jboss.org/message/595635#595635
--------------------------------------------------------------
I’m currently working on a process containing a mail task with JBPM 4.4. I need to generate a localized mail using a preferred language (either German or English). My first approach was to use a separate mail template for each language and then to set the corresponding template by using an expression within the process definition. However, this approach did not succeed, as the process definition could not be deployed because no expressions are allowed in the reference to the mail template. Thus, I had to discard this solution.
Instead I’m currently using a set of variables that are finally used to compose the mail in the template using expression. Nevertheless, some of the text parts are longer than 255 characters, so I cannot use simple strings to be stored as process variables because it results in a data truncation exception thrown by the jdbc driver.
I found out that it should be possible to store a string that is longer than 255 characters by converting it to a char array. jBPM should handle these char[] variables as long text fields in the data base (hibernate type “text”).
However, this seems also not to work, because the internal representation (class org.jbpm.pvm.internal.type.variable.TextVariable) of the char array uses a char[] which is directly passed to hibernate as is. On the other hand, the internal hibernate representation of a long text field (org.hibernate.type.TextType) expects a String object for a text field. This leads to the following exception when trying to store the char[] variable:
Caused by: java.lang.ClassCastException: [C cannot be cast to java.lang.String
at org.hibernate.type.TextType.toString(TextType.java:94)
at org.hibernate.type.NullableType.nullSafeToString(NullableType.java:117)
at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:158)
at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:131)
at org.hibernate.persister.entity.AbstractEntityPersister.dehydrate(AbstractEntityPersister.java:2015)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2261)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2678)
at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:79)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:167)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1028)
at org.jbpm.pvm.internal.tx.HibernateSessionResource.prepare(HibernateSessionResource.java:56)
at org.jbpm.pvm.internal.tx.StandardTransaction.commit(StandardTransaction.java:107)
at org.jbpm.pvm.internal.tx.StandardTransaction.complete(StandardTransaction.java:64)
at org.jbpm.pvm.internal.tx.StandardTransactionInterceptor.execute(StandardTransactionInterceptor.java:57)
at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.executeInNewEnvironment(EnvironmentInterceptor.java:53)
at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:40)
at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:56)
at org.jbpm.pvm.internal.svc.SkipInterceptor.execute(SkipInterceptor.java:43)
at org.jbpm.pvm.internal.svc.ExecutionServiceImpl.createVariables(ExecutionServiceImpl.java:174)
I think the only way to get it work for character arrays is to implement a converter (org.jbpm.pvm.internal.type.Converter), which is registered in the xml file jbpm.variable.types.xml, and to adapt the isStorable(Object ) method in the type org.jbpm.pvm.internal.type.variable.TextVariable.
Are there any other (simpler) suggestions to work around this problem?
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/595635#595635]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years
[EJB3] - Numeric values in varchar field & use enum ?
by Thomas Clifford
Thomas Clifford [http://community.jboss.org/people/tjclifford01] created the discussion
"Numeric values in varchar field & use enum ?"
To view the discussion, visit: http://community.jboss.org/message/593853#593853
--------------------------------------------------------------
Hi.
An application sql table I'm working on has a varchar(4) field that, according to the information I had, is only supposed to
hold two values, '0' or '1'.
I coded the value for that column as an enum in ejb3 previously, believing it would be specified in the database as
a tinyint or int. But the column has '1bbb' (b for blank), and none of them have '0bbb'.
I've tried to code it in the enum as:
0("0"), 1("1");
which gave me a compile error, and also tried:
"0"("0"), "1"("1");
which also gave a compile error.
Does anyone know if it's possible to code an enum such that a varchar field will hold numbers ?
I've argued that the field should be a tinyint, but to no avail. It's complicated.
I believe I'll have to code it as a String in the ejb and associated beans.....
Thanks.....
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/593853#593853]
Start a new discussion in EJB3 at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years
[Beginner's Corner] - Pack jars into folders for unique deployment of EAR application
by dhivesh
dhivesh [http://community.jboss.org/people/dhivesh] created the discussion
"Pack jars into folders for unique deployment of EAR application"
To view the discussion, visit: http://community.jboss.org/message/595609#595609
--------------------------------------------------------------
Hi,
I wanted to know if it's possible to deploy an EAR application which exclusively contains jar's, but have some singularities that are described below.
The issue is that I would like to divide the jar's into various folders inside the lib folder of the application, in order to have the libraries more structured.
I wouldn't like to mix up all the jars in the lib folder or create various EAR applications (one for each group of jars). Also, I don't want to put the jar's in the server runtime because this would mean that restarts of the server are necessary each time there is a change (and the server contains various applications that shouldn't be affected).
I've tried to apply this solution, but when I reference the libraries from another application at runtime (not in compilation time) these are not found. Is there a possible way of structuring libraries this way? A valid solution for me would also be encapsulating various EARs if it exists with JBOSS (this way I would create various EAR's, one for each group of jars, and encapsulate them into a single deployment).
Thanks to everyone in advance.
Best regards,
Dhivesh
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/595609#595609]
Start a new discussion in Beginner's Corner at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years
[EJB3] - UNRESOLVED Demands 'persistence.unit:unitName=...
by Matthias Becker
Matthias Becker [http://community.jboss.org/people/drake2711] created the discussion
"UNRESOLVED Demands 'persistence.unit:unitName=..."
To view the discussion, visit: http://community.jboss.org/message/595352#595352
--------------------------------------------------------------
Hi
i am new to JBoss and EJBs in general so plase help :)
Every time i try to deploy my application i get erros indicateing that the persistance unit cannot be found:
* UNRESOLVED Demands 'persistence.unit:unitName=EsbMonitorEAR-0.0.1-SNAPSHOT.ear/#EsbMonitorPU' **
* 14:51:40,882 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] Error installing to Start: name=*persistence.unit:unitName=EsbMonitorEAR-0.0.1-SNAPSHOT.ear/#EsbMonitorPU* state=Create: javax.persistence.PersistenceException: [PersistenceUnit: EsbMonitorPU] class or package not found
and the following kind of demands:
* and demands:
14:51:27,287 INFO [org.jboss.ejb3.deployers.JBossASKernel] persistence.unit:unitName=*EsbMonitorEAR-0.0.1-SNAPSHOT.ear/#EsbMonitorPU*; Required: Described
where does this name come from?
The persistence.xml (i had to place it in the META-INF of the EAR-file) looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="EsbMonitorPU" transaction-type="JTA">
<jta-data-source>java:jdbc/esb_monitor_dev</jta-data-source>
<class>...</class>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties>
<property name="eclipselink.ddl-generation" value="create-tables"/>
<property name="hibernate.hbm2ddl.auto" value="update" />
<property name="jboss.entity.manager.jndi.name" value="java:/EsbMonitorPU"/>
<property name="jboss.entity.manager.factory.jndi.name" value="java:/EsbMonitorPUFactory"/>
</properties>
</persistence-unit>
</persistence>
This is the DS-File wich is localed in the server\default\deploy directory:
<datasources>
<local-tx-datasource>
<!-- The jndi name of the DataSource, it is prefixed with java:/ -->
<!-- Datasources are not available outside the virtual machine -->
<jndi-name>jdbc/esb_monitor_dev</jndi-name>
<!-- for in-process persistent db, saved when jboss stops. The
org.jboss.jdbc.DerbyDatabase mbean is necessary for properly db shutdown -->
<connection-url>jdbc:derby://localhost:3301/esb_monitor_dev;create=true</connection-url>
<!-- The driver class -->
<driver-class>org.apache.derby.jdbc.ClientDriver</driver-class>
<!-- The login and password -->
<user-name>ESB</user-name>
<password>sa</password>
<!-- The minimum connections in a pool/sub-pool. Pools are lazily constructed on first use -->
<min-pool-size>5</min-pool-size>
<!-- The maximum connections in a pool/sub-pool -->
<max-pool-size>20</max-pool-size>
<!-- The time before an unused connection is destroyed -->
<idle-timeout-minutes>5</idle-timeout-minutes>
<!-- Whether to check all statements are closed when the connection is returned to the pool,
this is a debugging feature that should be turned off in production -->
<track-statements/>
<!-- This mbean can be used when using in process persistent derby -->
</local-tx-datasource>
</datasources>
And this is how i refer to the PUs:
@PersistenceUnit(unitName="EsbMonitorPU")
private EntityManagerFactory factory;
@PersistenceContext(unitName = "EsbMonitorPU")
private EntityManager em;
protected final EntityManager getEntityManager() {
if (em == null) {
em = factory.createEntityManager();
}
return em;
}
I assembled all this code from various sources in the iNet but nothing works so far.
Any Ideas? How ist this courios "*EsbMonitorEAR-0.0.1-SNAPSHOT.ear/#EsbMonitorPU*" name assembled? Is my Maven configuration responsible for that? If so i dont understand how...
I use JBoss 6.0.0Final
Thank you
BTW: If i run it directly from Eclipse, everything works fine...
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/595352#595352]
Start a new discussion in EJB3 at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years