jboss etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster
jboss etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster

5 Temmuz 2009 Pazar

jbpm bpel - first steps

i am looking for someway to deploy my bpel processes on jboss app server. i do not want to use jpdl which is not a standart, so i stuck to bpel.

This seems to be a solution: http://www.jboss.org/jbossjbpm/bpel/
As such, it can execute processes authored with the Eclipse BPEL designer or any other editor that produces standard BPEL documents.

Bpel designers generally generate some extra xml and so, it may be possible that you can not open your bpel process designed with Activos Designer with Eclipse Bpel Designer,or vice versa. (correct if i am wrong:)) However, OpenESB allows me to produce clean, standart bpel file without adding any extra xml. (When you design a process with Open Esb (Netbeans) Bpel designer, you will notice that the location for the elements are fixed in the GUI, you can not put anything you like at anywhere in the designer, you have to choose from some predefined locations.. i think that is why Netbeans designer's bpel is so clean:) since it does not require to keep the location info, no extensions to standard bpel is needed..) Therefore, the above sentence about jbpm bpel (in italic) is important to me.. This means, i may develop my bpel process with OpenEsb designer and deploy to jbpm bpel.. This post is to note down that experience..

The steps are as follows:

  • in order to make use of the examples coming with the jbpm bpel package, the following must be already installed:
- ant
- jboss app server (4.x.x is required according to https://jira.jboss.org/jira/secure/attachment/12311453/jbpm.bpel.guide.pdf)
- java 1.5 (i do not know why, but i could not make jwsdp accept jdk 6, during installation, that is why i need jdk 1.5, more specifically jdk1.5.0_19 is ok)
- java web services developer pack (the examples use wscompile etc. ant tasks from here, so using metro instead is expensive, i gave up on the way half.. ) jwsdp is needed just for running the given examples, not part of the actual solution. in actual case, metro web service stack will be used instead..

this package includes many bpel samples. however, in order to run these samples properly, the following modifications may be needed:

  • In jbpm-bpel-1.1.1/examples/common/build.properties file, modify the following properties accordingly:

jboss.version=4.2.3.GA (i am using this already, but any 4.x.x is said to be ok)
jboss.home=${software.installation.dir}/jboss-${jboss.version} (if different)
jwsdp.home=${software.installation.dir}/jwsdp-1.6
javac.source=1.4 (modify as 1.5)
javac.target=1.4 (modify as 1.5)

  • start jboss, (starting from port 8080 may be required, not sure. if something goes wrong, check that..)
  • execute command ant inside jbpm-bpel-1.1.1/examples, it should execute with success..
  • lets see if wsdl s are available:
http://127.0.0.1:8080/account/accountSystem?wsdl
http://127.0.0.1:8080/invoice/invoiceService?wsdl
http://127.0.0.1:8080/scheduling/schedulingProcess?wsdl
http://127.0.0.1:8080/shipping/shippingService?wsdl
http://127.0.0.1:8080/task/taskManager?wsdl
http://127.0.0.1:8080/ticket/ticketIssuer?wsdl
http://127.0.0.1:8080/translator/document?wsdl
http://127.0.0.1:8080/translator/text?wsdl

i got the addresses for the wsdl s from ${JBOSS_HOME}/server/default/data/wsdl

now it is time to dive into https://jira.jboss.org/jira/secure/attachment/12311453/jbpm.bpel.guide.pdf deeper, but it can wait :)
i do not want to ruin my sunday afternoon with that :)

Edit on 6/7/2009, 12.04: Sorry, i have forgotten to deploy jbpm-bpel itself on jboss.. So, at anytime you like, execute command ant deploy.ear inside /jbpm-bpel/jbpm-bpel-1.1.1/deploy and jbpm-bpel will be deployed on jboss. try to see jbpm bpel console from http://localhost:8080/jbpm-bpel/

Edit on 7/7/2009, 10.55: Yeah, OpenESB designer produces standard bpel files. However, unfortunately this does not mean that it could open every standard bpel file in its designer.. 

23 Haziran 2009 Salı

more notes on Jbossws + Eclipse


Unfortunately, i did not notice that the client stubs were generated by Axis2 not jax-ws (wsit runtime). Therefore, the solution is still incomplete :(

Now, extra steps are:
  • download jboss tools from http://www.jboss.org/tools/download/stable/3_0_GA.html (i downloaded all plugins part, the first part..)
  • install the plugins on eclipse ganymede by extracting the zip and copying plugins and features folders in the extracted package to your eclipse folder 
  • install stp (soa tools project) plugin to eclipse via software updates. the update site is http://download.eclipse.org/stp/updates/ganymede/
  • window --> preferences --> web services --> Jbossws preferences  : add ... /jbossws-metro-bin-dist/output/deploy-jboss500
  •  restart eclipse
Now the environment seems ready..  however, there exists problems that i can not overcome :( for instance while generating a bottom up web service using the jbossws runtime, i get the following error:
error: Could not find class file for com.example.Eval
1 error
Error: Could not generate. (use --show-traces to see full traces)
Error: Wsgen invocation failed. Try the '-verbose' switch for more information

i could not solve the error :(
however, this post is just to note down the preparation of the eclipse environment for web service development :)

some notes on Jbossws + Eclipse

I want to make effective use of metro web service stack and eclipse ide (together). Netbeans support for jaxws is excellent but i have a limitation that all code will be developped with eclipse, so lets move..


My environment is Eclipse Ganymede + Jboss 5.0.0. app. server + Sun jdk on x64 linux machine (open suse).

The steps:
1) Download and install Jboss 5.0.0


3) In jbossws package (extracted) copy ant.properties.example as ant.properties

4) change the server location as follows (appropriately):
jboss500.home=/usr/share/myprograms/ECLIPSEHOME/ECLIPSEHOME/server/jboss-5.0.0.GA

5) execute ant deploy-jboss500 command. ant must be installed and the command must be executed inside the package structure(since build.xml is at that path..)
at this point, jbossws is installed at jboss app server..
btw, jboss server does not work properly with ibm jdk, so use sun jdk instead..

6) open eclipse and add the jboss v5.0 server you installed jbossws on top of.
while trying to do this this error message may appear:
 Missing classpath entry /home/hilal.tarakci/ECLIPSEHOME/server/jboss-5.0.0.GA/server/default/lib/mail.jar
This is due to this bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=257823
One of the workarounds: copy mail.jar from jboss-5.0.0.GA/common/lib to /jboss-5.0.0.GA/server/default/lib.
i started the server for test purpose and got the following warning:
11:52:49,509 WARN  [AbstractDeploymentContext] Unable to register deployment mbean vfszip:/home/hilal.tarakci/ECLIPSEHOME/server/jboss-5.0.0.GA/server/default/deployers/jbossws.deployer/jaxb-xjc.jar/1.0/
javax.management.InstanceAlreadyExistsException: jboss.deployment:id="vfszip:/home/hilal.tarakci/ECLIPSEHOME/server/jboss-5.0.0.GA/server/default/deployers/jbossws.deployer/jaxb-xjc.jar/1.0/",type=SubDeployment already registered.
at org.jboss.mx.server.registry.BasicMBeanRegistry.add(BasicMBeanRegistry.java:767)
i just ignored the warning..

7) create a dynamic web project with jboss v5 as target runtime. 

8) add the sample TestWs.java to the project. (The sample code is at JBossWs Code sample with annotations: (TestWs.java)  part at http://www.javabeat.net/articles/40-creating-webservice-using-jboss-and-eclipse-europa-2.html )


10) start jboss inside eclipse. deploy the created project (by adding project to the server.)
Doing this, the following error may appear if project workspace and eclipse are on seperate disks:
Publish failed using Ant publisher
  Could not replace with temp file /tmp/tmp27108.MF.
So, put them on the same disk..

the deployed web service should appear in this list: http://localhost:8080/jbossws/services and wsdl at http://127.0.0.1:8080/JbossWsEval/TestWs?wsdl
Now, it is time to create a client for this web service. 

12) create another dynamic web project, this will include client. right click the project and select new Web Service Client (under Web Services) enter the above wsdl as service definition.
the generated stubs are under src.

13) a sample client code is as follows:
import java.rmi.RemoteException;

import com.test.dhanago.TestWs;
import com.test.dhanago.TestWsProxy;

public class TheClient {
public static void main(String[] args) {
try {
TestWsProxy aProxy = new TestWsProxy();
TestWs service = aProxy.getTestWs();
System.out.println(service.greet(" Stranger"));
} catch (RemoteException e) {
e.printStackTrace();
}
}
}

If this java app prints "Hello Stranger" , then fine :)