[jBPM] - XML error on process variable
by David Harris
David Harris [https://community.jboss.org/people/dmwpepper] created the discussion
"XML error on process variable"
To view the discussion, visit: https://community.jboss.org/message/810374#810374
--------------------------------------------------------------
I have a basic .java file that passes in a parameter:
package com.sample.quickstarts;
import java.util.HashMap;
import java.util.Map;
import org.drools.runtime.StatefulKnowledgeSession;
import org.drools.runtime.process.ProcessInstance;
import org.jbpm.test.JbpmJUnitTestCase;
import org.junit.Test;
public class JavaServiceQuickstartTest extends JbpmJUnitTestCase{
@Test
public void testProcess () {
StatefulKnowledgeSession ksession = createKnowledgeSession("sample.bpmn2");
Map<String, Object> params = new HashMap<String, Object>();
params.put("person", new Person("krisv"));
ksession.startProcess("com.sample.bpmn2.hello", params);
}
}
In the .bpmn2 properties area, I added a Person object for the parameter I'm passing ('params.put("person", new Person("krisv"));')
When I execute the process, I get the following:
0 25/04 13:36:17,316[main] ERROR drools.xml.ExtensibleXmlParser.error - (null: 15, 54): cvc-datatype-valid.1.2.1: '' is not
a valid value for 'QName'.
0 25/04 13:36:17,316[main] ERROR drools.xml.ExtensibleXmlParser.error - (null: 15, 54): cvc-attribute.3: The value '' of
attribute 'structureRef' on element 'itemDefinition' is not valid with respect to its type, 'QName'.
person: krisv
I expected 'person:krisv'. Why is there a drools xml error and how can I get rid off it?
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/810374#810374]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
11 years, 2 months
[EJB3] - Cannot make my maven test client to speak with my EJB, missing jar?
by eildosa
eildosa [https://community.jboss.org/people/eildosa] created the discussion
"Cannot make my maven test client to speak with my EJB, missing jar?"
To view the discussion, visit: https://community.jboss.org/message/735377#735377
--------------------------------------------------------------
Hi, here is my problem, I made an EJB with maven and 2 test clients,
* a test client without maven, only added jnp-client and the EJB to it's class path, work like a charm
* a test client using MAVEN, added the EJB through the POM and jnp-client, does not work
this is my EJB :
[img] http://img11.hostingpics.net/pics/480421EJB1.png http://img11.hostingpics.net/pics/480421EJB1.png[/img]
it's POM :
[code]
<project xmlns=" http://maven.apache.org/POM/4.0.0 http://maven.apache.org/POM/4.0.0" xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=" http://maven.apache.org/POM/4.0.0 http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.thongvan.mp</groupId>
<artifactId>MyFirstMavenEjb</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>ejb</packaging>
<name>MyFirstMavenEjb</name>
<url> http://maven.apache.org http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>6.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
<!-- setting default EJB2 to EJB3 -->
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ejb-plugin</artifactId>
<version>2.1</version>
<configuration>
<ejbVersion>3.0</ejbVersion>
</configuration>
</plugin>
</plugins>
</build>
</project>
[/code]
this is my first test client, the one without maven wich has no problem whatsoever to speak with the EJB
[img] http://img11.hostingpics.net/pics/974963EJB0.png http://img11.hostingpics.net/pics/974963EJB0.png[/img]
this is my second test client, using maven, it cannot speak with the EJB, all I'm getting is :
[code]
Context lookup finished
Exception in thread "main" java.lang.ClassCastException: javax.naming.Reference cannot be cast to com.thongvan.mp.MyFirstMavenEjb.TestMavenEjb
at com.thongvan.mp.TestClientMavenEjb.App.main(App.java:27)
[/code]
[img] http://img11.hostingpics.net/pics/651692EJB2.png http://img11.hostingpics.net/pics/651692EJB2.png[/img]
It's POM :
[code]
<project xmlns=" http://maven.apache.org/POM/4.0.0 http://maven.apache.org/POM/4.0.0" xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=" http://maven.apache.org/POM/4.0.0 http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.thongvan.mp</groupId>
<artifactId>TestClientMavenEjb</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>TestClientMavenEjb</name>
<url> http://maven.apache.org http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<!-- pour la dependance jnp-client, besoin de la version 5.0.3.GA -->
<repositories>
<repository>
<id>Jboss</id>
<url> https://repository.jboss.org/nexus/content/repositories/releases/ https://repository.jboss.org/nexus/content/repositories/releases/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.jboss.naming</groupId>
<artifactId>jnp-client</artifactId>
<version>5.0.3.GA</version>
</dependency>
<dependency>
<groupId>com.thongvan.mp</groupId>
<artifactId>MyFirstMavenEjb</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
[/code]
Both clients have the same main :
[code]
public static void main( String args[] ) throws NamingException
{
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
env.put(Context.PROVIDER_URL, "localhost");
env.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces" );
Context ctx = new InitialContext(env);
System.out.println("Context lookup finished");
TestMavenEjb proxy = (TestMavenEjb)(ctx.lookup("TestMavenEjbBean/remote-com.thongvan.mp.MyFirstMavenEjb.TestMavenEjb"));
System.out.println(proxy.getClass());
System.out.println("do something!");
proxy.doSomething();
}
[/code]
So, anybody has even the slightest idea about why the maven test client is not working?
Jboss 5.1.0.GA
Eclipse indigo
Maven 3.0.4
Also I did some poking around by printing a toString on both context lookup here is what I got :
[b]Maven project (not working)[/b]
Reference Class Name: Proxy for: com.thongvan.mp.MyFirstMavenEjb.TestMavenEjb
Type: ProxyFactoryKey
Content: ProxyFactory/MyFirstMavenEjb/TestMavenEjbBean/TestMavenEjbBean/remote
Type: EJB Container Name
Content: jboss.j2ee:jar=MyFirstMavenEjb.jar,name=TestMavenEjbBean,service=EJB3
Type: Proxy Factory is Local
Content: false
Type: Remote Business Interface
Content: com.thongvan.mp.MyFirstMavenEjb.TestMavenEjb
Type: Remoting Host URL
Content: socket://localhost:3873/
[b]regular project (working)[/b]
Proxy to jboss.j2ee:jar=MyFirstMavenEjb.jar,
name=TestMavenEjbBean,
service=EJB3 implementing [interface com.thongvan.mp.MyFirstMavenEjb.TestMavenEjb]
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/735377#735377]
Start a new discussion in EJB3 at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
11 years, 2 months
[jBPM] - Problems with Local Task Service
by Shobhit Tyagi
Shobhit Tyagi [https://community.jboss.org/people/roxy1987] created the discussion
"Problems with Local Task Service"
To view the discussion, visit: https://community.jboss.org/message/809857#809857
--------------------------------------------------------------
Guys,
I have a process with 2 tasks. I am using local task service. The process starts fine and completion of 1st task is also clean. but the 2nd task is not assigned. neither it is listed in the database. What could be the reason?
Following is my code for initiate process and complete task.
Initiate :
StatefulKnowledgeSession ksession;
long processInstanceId = -1;
try
{
ksession = BpmRepositoryConfig.createSession(processName);
KnowledgeRuntimeLogger logger1 = KnowledgeRuntimeLoggerFactory.newThreadedFileLogger(ksession, "testlog", 1000);
LocalHTWorkItemHandler handler = new LocalHTWorkItemHandler(ksession);
org.jbpm.task.service.TaskService service = BpmRepositoryConfig.getService();
TaskService taService = BpmRepositoryConfig.getTaskService(ksession, service);
handler.setClient(taService);
ksession.getWorkItemManager().registerWorkItemHandler("Human Task", handler);
JPAWorkingMemoryDbLogger logger2 = new JPAWorkingMemoryDbLogger(ksession);
ProcessInstance prcInstance = ksession.startProcess(processDefId, mapParameters);
processInstanceId = prcInstance.getId();
}
catch (Exception e)
{
e.printStackTrace();
}
Complete :
StatefulKnowledgeSession ksession = BpmRepositoryConfig.createSession(processName);
org.jbpm.task.service.TaskService tservice = BpmRepositoryConfig.getService();
TaskService taskService = BpmRepositoryConfig.getTaskService(ksession,tservice);
try
{
for(long task : taskId)
{
taskService.start(task, userId);
taskService.complete(task, userId, null);
}
}
catch (Exception e)
{
e.printStackTrace();
}
Other methods :
public static org.jbpm.task.service.TaskService getService()
{
EntityManagerFactory emf = Persistence.createEntityManagerFactory("org.jbpm.task");
org.jbpm.task.service.TaskService tservice = new org.jbpm.task.service.TaskService(emf, SystemEventListenerFactory.getSystemEventListener());
TaskServiceSession taskSession = tservice.createSession();
taskSession.addUser(new User("Administrator"));
taskSession.addUser(new User("krisv"));
taskSession.addUser(new User("john"));
taskSession.addUser(new User("mary"));
return tservice;
}
public static TaskService getTaskService(StatefulKnowledgeSession ksession,org.jbpm.task.service.TaskService taskService)
{
TaskService client = new LocalTaskService(taskService);
LocalHTWorkItemHandler localHTWorkItemHandler = new LocalHTWorkItemHandler(client, ksession);
ksession.getWorkItemManager().registerWorkItemHandler("Human Task", localHTWorkItemHandler);
return client;
}
Thanks.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/809857#809857]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
11 years, 2 months
[JBoss Web Services] - nullpointer exception while querying simpleType in Dynamicclient
by Gayatri G
Gayatri G [https://community.jboss.org/people/gayatrig] created the discussion
"nullpointer exception while querying simpleType in Dynamicclient"
To view the discussion, visit: https://community.jboss.org/message/810269#810269
--------------------------------------------------------------
I am trying to Query the docuement elements which are having simpleType in it and resulting NullPointerException on call MessagePartInfo.getTypeClass()
below is the snippets of the definitions
<xs:element name="Get">
<xs:complexType>
<xs:sequence>
<xs:element name="MOType" type="MoType" fixed="Subscription@ http://schemas.ericsson.com/ema/UserProvisioning/BcsSub/1.0/%22 http://schemas.ericsson.com/ema/UserProvisioning/BcsSub/1.0/" />
...
...
...
'Get' contains an element 'MoType' which is derived as an simpleType like below in the same schema definitions
<xs:simpleType name="MoType">
<xs:restriction base="xs:string">
<xs:pattern value="[A-Za-z][_A-Za-z0-9] https://community.jboss.org/mailto:*@.* *@.*" />
</xs:restriction>
</xs:simpleType>
My client code :
Class :SoapCxfClientBrowser
public void processMessageParts(OperationData od, List<MessagePartInfo> parts) {
if(logger.isDebugEnabled()) {
logger.debug("Number of message parts: " + parts.size());
}
for (MessagePartInfo messagePartInfo : parts) {
if(logger.isDebugEnabled()) {
logger.debug("MessagePartInfo: " + messagePartInfo);
logger.debug("TypeClass: " + messagePartInfo.getTypeClass());
logger.debug("PartClass: "
+ messagePartInfo.getTypeClass().getCanonicalName());
}
processTypeInfo(od, messagePartInfo.getTypeClass());
}
}
Error i am seeying :
2013-04-23 15:33:13,976 DEBUG [com.hp.opencall.seeconnector.soapcxf.impl.SoapCxfClientBrowser] (HDScanner) MessagePartInfo: [MessagePartInfo name={ http://schemas.ericsson.com/cai3g1.2/ http://schemas.ericsson.com/cai3g1.2/}parameters, ConcreteName={ http://schemas.ericsson.com/cai3g1.2/ http://schemas.ericsson.com/cai3g1.2/}Get
2013-04-23 15:33:13,976 DEBUG [com.hp.opencall.seeconnector.soapcxf.impl.SoapCxfClientBrowser] (HDScanner) TypeClass: null
2013-04-23 15:33:13,976 DEBUG [com.hp.opencall.seeconnector.soapcxf.impl.SoapCxfDynamicProxyClientImpl] (HDScanner) Error processing WSDL: java.lang.NullPointerException
java.lang.NullPointerException
at com.hp.opencall.seeconnector.soapcxf.impl.SoapCxfClientBrowser.processMessageParts(SoapCxfClientBrowser.java:157)
at com.hp.opencall.seeconnector.soapcxf.impl.SoapCxfClientBrowser.processOperations(SoapCxfClientBrowser.java:139)
at com.hp.opencall.seeconnector.soapcxf.impl.SoapCxfClientBrowser.processBindingInfos(SoapCxfClientBrowser.java:112)
at com.hp.opencall.seeconnector.soapcxf.impl.SoapCxfClientBrowser.processServiceInfos(SoapCxfClientBrowser.java:99)
at com.hp.opencall.seeconnector.soapcxf.impl.SoapCxfClientBrowser.processClient(SoapCxfClientBrowser.java:87)
at com.hp.opencall.seeconnector.soapcxf.impl.SoapCxfClientBrowser.init(SoapCxfClientBrowser.java:65)
at com.hp.opencall.seeconnector.soapcxf.impl.SoapCxfDynamicProxyClientImpl.init(SoapCxfDynamicProxyClientImpl.java:130)
at com.hp.opencall.seeconnector.soapcxf.impl.CSImslet.init(CSImslet.java:130)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at com.hp.opencall.imsc.coreimpl.ImsletWrapper.initImslet(ImsletWrapper.java:181)
at com.hp.opencall.imsc.coreimpl.ImsAppImpl.initImslet(ImsAppImpl.java:216)
at com.hp.opencall.imsc.startup.loaders.ImscLoaderBase.registerImslet(ImscLoaderBase.java:132)
at com.hp.opencall.imsc.startup.JBossImsletService.startService(JBossImsletService.java:59)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:376)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:322)
at sun.reflect.GeneratedMethodAccessor82.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:189)
at $Proxy38.start(Unknown Source)
at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:42)
at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:37)
at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
at org.jboss.system.microcontainer.ServiceControllerContext.install(ServiceControllerContext.java:286)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
at org.jboss.system.ServiceController.doChange(ServiceController.java:688)
at org.jboss.system.ServiceController.start(ServiceController.java:460)
at org.jboss.system.deployers.ServiceDeployer.start(ServiceDeployer.java:163)
at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:99)
at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:46)
at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1178)
at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1210)
at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:702)
at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)
at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:362)
at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:255)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:351)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:178)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:165)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:267)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:679)
Could somebody help me to resolve this issue and by letting me know the route cause for this.
Thanks in Advance
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/810269#810269]
Start a new discussion in JBoss Web Services at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
11 years, 2 months