[jboss-user] [JBoss jBPM] - Problem in deploying processdefinition in a war file
syedtaj
do-not-reply at jboss.com
Tue Apr 15 13:24:40 EDT 2008
Hi,
I have a war file, which has a servlet that will load on startup to deploy my process definitions like the following -
| pdSubProcess = processDefinition.parseXmlResource("AutomationService/processdefinition.xml");
| jbpmContext.deployProcessDefinition(pdSubProcess);
I get a java.net.MalformedURLException, cause the class loader is not able to find the process definition, which is strange because it is in the classes folder in WEB-INF
automation.war\WEB-INF\classes\AutomationService\processdefinition.
I saw the JBOSS code that loads the resource files, it uses the ClassLoader to deploy the resource. I mimicked that code like this
ClassLoader automationServiceLoader = AutomationServiceServlet.class.getClassLoader();
| InputStream inputStream = automationServiceLoader.getResourceAsStream("AutomationService/processdefinition.xml");
| pdSuperProcess = ProcessDefinition.parseXmlInputStream(inputStream);
|
The above code works, but created a new problem. I also wonder why didn't ProcessDefinition.parseXmlResource work because internally it does the same thing, using its own class - ClassLoaderUtil.class.getClassLoader()
I am stumped.
Now the second problem, after making the above work and once all the process definitions are deployed, the action classes that they refer to from the process definitions are not visible to class loader, and I get a ClassNotFoundException. I tried making a jar file and placing it in the WEB-INF\lib folder as well, with no success. I guess thats because I am using a different class loader to load the process definitions, the class folder in WEB-INF or the lib folders are not visible to it.
Thus how do I actually make this work, how do I deploy the processdefinitions along with its related class files.
Any help would be appreciated. Stuck from some time on this one.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4144292#4144292
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4144292
More information about the jboss-user
mailing list