[jboss-user] [JBoss jBPM] - deploy a procesee to jboss server suing java code
Grid.Qian
do-not-reply at jboss.com
Tue Nov 4 04:15:15 EST 2008
Hi all,
just have a question:
I am working for importing jboss soa-p esb quick-start samples to eclipse. There is a sample named:bpm_orchestration1. It need call a jbpm process from esb service. Now it can run by ant. From the build.xml, I got this task to deploy a process to a server:
<target name="deployProcess" description="deploys the process definition" depends="dependencies">
| <echo>Deploy the process definition</echo>
| <taskdef name="deployToServer" classname="org.jbpm.ant.DeployProcessToServerTask">
| <classpath refid="exec-classpath"/>
| </taskdef>
| <deployToServer username="${jbpm.console.username}" password="${jbpm.console.password}" serverDeployer="${org.jboss.esb.jbpm.console.upload.url}">
| <fileset dir="${basedir}/processDefinition" includes="*"/>
| </deployToServer>
| </target>
Now I need to do this task using java code. I write this method:
private void deployProcessToServer() {
| DeployProcessToServerTask deployTask = new DeployProcessToServerTask();
| deployTask.setProcess(new File("processdefinition.xml"));
| deployTask.setServerName("localhost");
| deployTask.setServerPort("8080");
| deployTask.setUsername("admin");
| deployTask.setPassword("admin");
| deployTask.setServerDeployer("/jbpm-console/app/upload");
| deployTask.execute();
|
| }
When I run this method, I got a error:
Exception in thread "main" couldn't deploy process archives : http://localhost:8080/jbpm-console/app/upload
at org.jbpm.ant.DeployProcessToServerTask.execute(DeployProcessToServerTask.java:179)
at org.jboss.soa.esb.samples.quickstarts.bpm_orchestration1.test.SendTestMessage.deployProcessToServer(SendTestMessage.java:65)
at org.jboss.soa.esb.samples.quickstarts.bpm_orchestration1.test.SendTestMessage.sendMessage(SendTestMessage.java:41)
at org.jboss.soa.esb.samples.quickstarts.bpm_orchestration1.test.SendTestMessage.main(SendTestMessage.java:72)
Caused by: java.io.FileNotFoundException: http://localhost:8080/jbpm-console/app/upload
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1168)
at org.jbpm.ant.DeployProcessToServerTask.deployProcess(DeployProcessToServerTask.java:224)
at org.jbpm.ant.DeployProcessToServerTask.deployProcessWithServlet(DeployProcessToServerTask.java:188)
at org.jbpm.ant.DeployProcessToServerTask.execute(DeployProcessToServerTask.java:142)
... 3 more
--- Nested Exception ---
java.io.FileNotFoundException: http://localhost:8080/jbpm-console/app/upload
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1168)
at org.jbpm.ant.DeployProcessToServerTask.deployProcess(DeployProcessToServerTask.java:224)
at org.jbpm.ant.DeployProcessToServerTask.deployProcessWithServlet(DeployProcessToServerTask.java:188)
at org.jbpm.ant.DeployProcessToServerTask.execute(DeployProcessToServerTask.java:142)
at org.jboss.soa.esb.samples.quickstarts.bpm_orchestration1.test.SendTestMessage.deployProcessToServer(SendTestMessage.java:65)
at org.jboss.soa.esb.samples.quickstarts.bpm_orchestration1.test.SendTestMessage.sendMessage(SendTestMessage.java:41)
at org.jboss.soa.esb.samples.quickstarts.bpm_orchestration1.test.SendTestMessage.main(SendTestMessage.java:72)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4186584#4186584
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4186584
More information about the jboss-user
mailing list