[jBPM] - Re: JBPM5, Spring, BTM and Tomcat
by snyperboss
snyperboss [http://community.jboss.org/people/snyperboss] created the discussion
"Re: JBPM5, Spring, BTM and Tomcat"
To view the discussion, visit: http://community.jboss.org/message/640252#640252
--------------------------------------------------------------
Hi,
This is how I create the session using the above spring configuration.
<pre><span style=' color: Blue;'>public</span> <span style=' color: Blue;'>static</span> StatefulKnowledgeSession createSession() <span style=' color: Blue;'>throws</span> Exception {
<span style=' color: Green;'>/*
* Create the knowledgebase using the required bpmn and drl files
*/</span>
KnowledgeBase kbase = readKnowledgeBase(<span style=' color: Maroon;'>"SampleHumanTaskFormVariables.bpmn"</span>);
<span style=' color: Green;'>//EntityManagerFactory emf = Persistence.createEntityManagerFactory( "org.jbpm.persistence.jpa" );</span>
EntityManagerFactory emf = (EntityManagerFactory) HumanTaskStartupServlet.context.getBean(<span style=' color: Maroon;'>"entityManagerFactoryJbpmPersistanceJpa"</span>);
Environment env = KnowledgeBaseFactory.newEnvironment();
env.set( EnvironmentName.ENTITY_MANAGER_FACTORY, emf );
env.set( EnvironmentName.TRANSACTION_MANAGER, HumanTaskStartupServlet.context.getBean(<span style=' color: Maroon;'>"bitronixTransactionManager"</span>) );
env.set( EnvironmentName.TRANSACTION, HumanTaskStartupServlet.context.getBean(<span style=' color: Maroon;'>"bitronixTransactionManager"</span>) );
env.set( EnvironmentName.GLOBALS, <span style=' color: Blue;'>new</span> MapGlobalResolver() );
Properties properties = <span style=' color: Blue;'>new</span> Properties();
properties.put(<span style=' color: Maroon;'>"drools.processInstanceManagerFactory"</span>, <span style=' color: Maroon;'>"org.jbpm.persistence.processinstance.JPAProcessInstanceManagerFactory"</span>);
properties.put(<span style=' color: Maroon;'>"drools.processSignalManagerFactory"</span>, <span style=' color: Maroon;'>"org.jbpm.persistence.processinstance.JPASignalManagerFactory"</span>);
KnowledgeSessionConfiguration config = KnowledgeBaseFactory.newKnowledgeSessionConfiguration(properties);
<span style=' color: Blue;'>return</span> JPAKnowledgeService.newStatefulKnowledgeSession(kbase, config, env);
}
</pre>
Thanks!
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/640252#640252]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years
[JBoss Web Services] - Issue in WebSerice: javax.xml.bind.JAXBException
by Sivaraj R
Sivaraj R [http://community.jboss.org/people/sivar] created the discussion
"Issue in WebSerice: javax.xml.bind.JAXBException"
To view the discussion, visit: http://community.jboss.org/message/640250#640250
--------------------------------------------------------------
Hi, i am new to webservice. i have developed a EJB and exposed it as webservice. i have deployed my EJB in JBOSS 5. Business Logic and inteface is as below package com.sample; @Remote @WebService public interface SampleEJBRemote { @WebMethod public SampleResult getDetails(String name, String value); } business class: @Stateless @WebService(endpointInterface="com.sample.SampleEJBRemote") public class SampleEJB implements SampleEJBRemote { public SampleResult getDetails(String name, String value){ Map resultObj = getData(); SampleResult result = new SampleResult(); result.setOutput(resultObj); } private Map getData(){ HashMap propsMap = new HashMap(); for(int i =0 ; i < 10; i++){ HashMap prop = new HashMap(); prop.put("name",i + "Count"); propsMap.put(i,prop); } return propsMap; } } For the above code i created an ear and deployed in JBOSS and it works fine for EJB mode. When i invoke the same method using WebService i am getting the below error: [javax.xml.bind.JAXBException: class java.util.HashMap nor any of its super class is known to this context.] i have generated the client proxy for webservice using wsgen tool. Kindly help me. As i am new to this WebService's and EJB's . Regards Sivaraj R
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/640250#640250]
Start a new discussion in JBoss Web Services at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years
[JBoss Portal] - Hibernate exception with orgService.getUserHandler().findUserByName(userid)
by bharath sadanagiri
bharath sadanagiri [http://community.jboss.org/people/jayabharath] created the discussion
"Hibernate exception with orgService.getUserHandler().findUserByName(userid)"
To view the discussion, visit: http://community.jboss.org/message/638399#638399
--------------------------------------------------------------
Hi,
In gatein-3.1.0, to add the user to gate-in database I am finding the user in portal database whether exists or not but
orgService.getUserHandler().findUserByName is throwing the following exception.
Do I need to do any thing more set-up?
Thanks,
Bharath
ExoContainer container = getContainer();
IdentityRegistry identityRegistry = (IdentityRegistry) container.getComponentInstanceOfType(IdentityRegistry.class);
Authenticator authenticator = (Authenticator) container.getComponentInstanceOfType(Authenticator.class);
OrganizationService orgService = (OrganizationService)getContainer().getComponentInstanceOfType(OrganizationService.class);
User user = orgService.getUserHandler().findUserByName(userId);
2011-11-25 07:57:26,674 INFO [org.exoplatform.services.organization.idm.UserDAOImpl] (http-10.19.47.197-8122-2) Cannot obtain user: sadanajeinci;
org.picketlink.idm.common.exception.IdentityException: IdentityObjectType[USER] not present in the store.
at org.picketlink.idm.impl.store.hibernate.HibernateIdentityStoreImpl.getHibernateIdentityObjectType(HibernateIdentityStoreImpl.java:2586)
at org.picketlink.idm.impl.store.hibernate.HibernateIdentityStoreImpl.findIdentityObject(HibernateIdentityStoreImpl.java:659)
at org.picketlink.idm.impl.repository.WrapperIdentityStoreRepository.findIdentityObject(WrapperIdentityStoreRepository.java:155)
at org.picketlink.idm.impl.api.session.managers.PersistenceManagerImpl.findUser(PersistenceManagerImpl.java:426)
at org.exoplatform.services.organization.idm.UserDAOImpl.getPopulatedUser(UserDAOImpl.java:638)
at org.exoplatform.services.organization.idm.UserDAOImpl.findUserByName(UserDAOImpl.java:283)
at com.adp.sbs.si.jaas.SBSJAASLoginModule.addUserToPlatformUsers(SBSJAASLoginModule.java:154)
at com.adp.sbs.si.jaas.SBSJAASLoginModule.login(SBSJAASLoginModule.java:115)
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:597)
at javax.security.auth.login.LoginContext.invoke(LoginContext.java:769)
at javax.security.auth.login.LoginContext.access$000(LoginContext.java:186)
at javax.security.auth.login.LoginContext$4.run(LoginContext.java:683)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:680)
at javax.security.auth.login.LoginContext.login(LoginContext.java:579)
at org.jboss.security.plugins.auth.JaasSecurityManagerBase.defaultLogin(JaasSecurityManagerBase.java:553)
at org.jboss.security.plugins.auth.JaasSecurityManagerBase.authenticate(JaasSecurityManagerBase.java:487)
at org.jboss.security.plugins.auth.JaasSecurityManagerBase.isValid(JaasSecurityManagerBase.java:365)
at org.jboss.security.plugins.JaasSecurityManager.isValid(JaasSecurityManager.java:160)
at org.jboss.web.tomcat.security.JBossWebRealm.authenticate(JBossWebRealm.java:399)
at org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAuthenticator.java:258)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:417)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:95)
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
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:158)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:599)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:451)
at java.lang.Thread.run(Thread.java:662)
Caused by: org.hibernate.HibernateException: createCriteria is not valid without active transaction
at org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:339)
at $Proxy189.createCriteria(Unknown Source)
at org.picketlink.idm.impl.store.hibernate.HibernateIdentityStoreImpl.getHibernateIdentityObjectType(HibernateIdentityStoreImpl.java:2560)
... 36 more
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/638399#638399]
Start a new discussion in JBoss Portal at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years