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

10 Mart 2011 Perşembe

error: A truncation error was encountered trying to shrink CLOB to length : org.apache.derby.iapi.services.io.DerbyIOException'.

The error
A truncation error was encountered trying to shrink CLOB to length : org.apache.derby.iapi.services.io.DerbyIOException'.
is thrown from apache ode while trying to do binary data transfer through bpel..
so, seperating the binary transfer from the process can be a workaround..

here is an explanation from ode FAQ (http://ode.apache.org/faq.html):
Q. I'm getting data truncation errors, what does that mean?
A. We try to use sensible sizes for the database columns that contain messages and variables in ODE. However if you're manipulating large quantities of data that may not e enough. The solution in that case is to alter the column that's too short to reserve enough database space for your needs.

3 Mart 2011 Perşembe

javax.xml.ws.soap.SOAPFaultException: axis2ns2:selectionFailure

The error javax.xml.ws.soap.SOAPFaultException: axis2ns2:selectionFailure shows up, while the process is running in apache ode (tried with versions 1.3.4 and 1.3.5).

The following assignment is successful:

<copy>
<from>
<literal>
<ns2:operationResponse>
<ns2:return> </ns2:return>
</ns2:operationResponse>
</literal>
</from>
<to variable="OperationOut" part="parameters"/>
</copy>

the definition:

<xs:complexType name="operationResponse">
<xs:sequence>
<xs:element name="return" type="ns1:returnMessage" minOccurs="0"></xs:element>
</xs:sequence>
</xs:complexType>

.. however, this one results in axis2ns2:selectionFailure error

<assign name="InitOperation">
<copy>
<from>$OperationWsdlOperationIn.identity/username</from>
<to>$OperationIn.parameters/username</to>
</copy>
<copy>
<from variable="OperationWsdlOperationIn" part="password"/>
<to>$OperationIn.parameters/password</to>
</copy>
</assign>


despite this initialization:

<copy>
<from>
<literal>
<ns2:operation>

<username> </username>
<password> </password>

</ns2:operation>
</literal>
</from>
<to variable="OperationIn" part="parameters"/>
</copy>

<xs:complexType name="operation">
<xs:sequence>
<xs:element name="username" type="xs:string" minOccurs="0"></xs:element>
<xs:element name="password" type="xs:string" minOccurs="0"></xs:element>
</xs:sequence>
</xs:complexType>

There is an explanation for this situation in Apache ODE FAQ (http://ode.apache.org/faq.html), i copied here for convenience:

Q. My process fails with a selectionFailure; What can I do? A. BPEL expects a single element to be selected when evaluating and expressions, and a selectionFailure fault is thrown if zero or more than one element are selected.

If you get zero element, double-check your namespace prefix and bindings. Also, remember that you must initialize your variables (most often with 's) before assigning into them, unless your are reassigning the whole variable (e.g. directly into $variable, or $variable.part). To debug assignments, you can set the "org.apache.ode" logging category to DEBUG in order to see the content of variables as the process executes.

This links say that it is due to namespace error:

http://stackoverflow.com/questions/4498982/soap-exception-axis2ns2selectionfailure

http://old.nabble.com/assign-with-complex-types-td20919141.html

Solution:

The following assignment lucily solved the error:

<copy>
<from>
<literal>
<operation xmlns="">

<username> </username>
<password> </password>

</operation>
</literal>
</from>
<to variable="OperationIn" part="parameters"/>
</copy>

28 Aralık 2010 Salı

revisited: migration from open esb + glassfish to apache tomcat + ode

please see http://hilaltarakci.blogspot.com/2010/03/migration-from-open-esb-glassfish-to.html for prior knowledge about the topic..
i have to migrate our processes from glassfish+open esb to apache tomcat+apache ode..
in this post, i simply note down differences or additions to the above prior post.
first of all, this time, i used latest versions:
  • apache ode : 1.3.4 instead of 1.3.3
  • apache tomcat: 7.0.5 instead of 6.0.24
  • metro: 2.0.1 instead of 2.0
CATALINA_HOME, JAVA_HOME and JRE_HOME environment variables are defined properly.

While installing metro on tomcat, i used the command
ant -f metro-on-tomcat.xml install
and there is luckily no problems due to version changes..

the correct arrangement of web.xml and creation of sun-jaxws.xml under project-home/web/WEB-INF is not straightforward this time, since there is a number of web services deployed in the same .war file. so, i want to explain the details..
here some links:

a small tip: after rewriting web.xml and sun-jaxws.xml, in order to prepare the .war file under dist folder, right click and build the project in netbeans ide.. choosing clean and build results in wiping out sun-jaxws.xml and overwriting web.xml..

a sample web.xml
<?xml version="1.0" encoding="UTF-8"?>

<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<description>Balistika2010Ws</description>
<display-name>Balistika2010Ws</display-name>
<listener>
<listener-class>com.sun.xml.ws.transport.http.servlet.WSServletContextListener</listener-class>
</listener>
<servlet>
<description>JAX-WS endpoint - Service1</description>
<display-name>Service1</display-name>
<servlet-name>Service1</servlet-name>
<servlet-class>com.sun.xml.ws.transport.http.servlet.WSServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Service1</servlet-name>
<url-pattern>/ode/processes/Service1</url-pattern>
</servlet-mapping>
<servlet>
<description>JAX-WS endpoint - Service2</description>
<display-name>Service2</display-name>
<servlet-name>Service2</servlet-name>
<servlet-class>com.sun.xml.ws.transport.http.servlet.WSServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Service2</servlet-name>
<url-pattern>/ode/processes/Service2</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>60</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>

a sample corresponding sun-jaxws.xml
<?xml version="1.0" encoding="UTF-8"?>

<endpoints xmlns='http://java.sun.com/xml/ns/jax-ws/ri/runtime' version='2.0'>
<endpoint
name='Service1'
implementation='tr.gov.tubitak.service.Service1'
url-pattern='/ode/processes/Service1'/>
<endpoint
name='Service2'
implementation='tr.gov.tubitak.service.Service2'
url-pattern='/ode/processes/Service2'/>
</endpoints>

The url-pattern attributes in web.xml and sun-jaxws.xml should match.

The implementation attribute is the web service itself..

However, tomcat throws the following error:
SEVERE: WSSERVLET11: failed to parse runtime descriptor: javax.xml.ws.WebServiceException: Unable to create JAXBContext
javax.xml.ws.WebServiceException: Unable to create JAXBContext
at com.sun.xml.ws.model.AbstractSEIModelImpl.createJAXBContext(AbstractSEIModelImpl.java:166)
...
Caused by: java.security.PrivilegedActionException: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 2 counts of IllegalAnnotationExceptions
javax.persistence.EntityManager is an interface, and JAXB can't handle interfaces.
this problem is related to the following location:
at javax.persistence.EntityManager
at public javax.persistence.EntityManager tr.gov.tubitak.uzay.balistika2010.sas.service.series.jaxws.MergeAbsEvidGrpsInCase.arg1
at tr.gov.tubitak.uzay.balistika2010.sas.service.series.jaxws.MergeAbsEvidGrpsInCase
javax.persistence.EntityManager does not have a no-arg default constructor.

The error is due to the fact that i pass EntityManager between (public) method calls in order to preserve my transactions.. see this for details: http://hilaltarakci.blogspot.com/2010/12/persistence-using-jpa.html

so, how to fix this? for now, i redesigned the code in such a way that EntityManager passing methods are all defined as private..

in fact, defining problematic methods as private solved some other weird errors as well.. i do not record them, since i did not understand their nature!!

at this point, web services are all deployed successfully and i can see wsdl s..

now the bpel part.. if you do not bind all partner links that is used in mentioned process in deploy.xml, you get the following error:
16:52:58,729 ERROR [NStateLatch] Latch error, was releasing for state 1 but actually in -1
16:52:58,731 WARN [ProcessStoreImpl] Deployment failed within the engine, store undeploying process.
java.lang.IllegalArgumentException: SecurityPL must be bound to an endpoint in deploy.xml
at org.apache.ode.bpel.engine.BpelProcess.setRoles(BpelProcess.java:519)

deploy.xml of ode-home/examples/DynPartner is a good sample..

now, it is time to test deployed processes from a java client.. i created client side artifacts from manually written wsdl in the deployed bpel module, not from the endpoint itself..

when i called the process from the client, i got the following error:

SEVERE: org.objectweb.asm.ClassWriter.(I)V
java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.(I)V
at net.sf.cglib.core.DebuggingClassWriter.(DebuggingClassWriter.java:47)
...
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:126)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:51)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:33)
at tr.gov.tubitak.uzay.balistika2010.sas.dao.base.BlsEntityManager.getEm(BlsEntityManager.java:20)
at tr.gov.tubitak.service.Service1.method1(Service1.java:116)

no need to say, the process calls a web service which persists data inside a transaction.. according to http://www.myeclipseide.com/PNphpBB2-viewtopic-t-24287.html, the error was due to conflicting asm.jar s around.. actually, i faced the same problem before in a different environment: http://hilaltarakci.blogspot.com/2010/02/javalangnosuchmethoderror.html
in deployed web services library, asm.jar was of version 1.5.3; upgrading it to version 3.3.1 solved the mentioned error..

last update on 29.12.2010, 11:30..

6 Mart 2010 Cumartesi

migration from open esb + glassfish to apache tomcat + ode

In our project, we develop web services using jax-ws and deploy them to glassfish v2 coming with netbeans 6.5 ide. btw, we installed netbeans 6.5 with open esb selected, since we use it for our bpel s. Bpels are also deployed to the same glassfish as web services. Development and deployment are quite easy and fast. However, when we ran all the bpels one after the other during unit tests, the server seems to be very slow and after a few runs out of memory error comes up.. we tried to configure glassfish, but it did not work as we expected.. (the database is postgresql, but currently this is irrelevant.)

So, now i want to deploy web services and bpels to apache-tomcat-6.0.24 + apache-ode-war-1.3.3 just to see what happens.. (in order to deploy ode to tomcat, just download the zip files, extract them and copy ode.war under webapps folder of tomcat and start tomcat..)
Now, lets follow the migration step by step..

The first step is deploying war of web services generated by netbeans (under dist folder of the project) to tomcat. So, i just copied the war file under tomcat-home/webapps and restarted the server. As i expected, the deployment seemed successful in terms of a regular web application, however it can not process the web services since no wsit runtime is installed on tomcat. (in other words, i can not see the wsdl..) In order to fix this, we have to install metro on tomcat.. a helpful link is http://blog.theunical.com/webservers/tomcat/installation-and-configuration-of-jax-ws-metro-on-tomcat-6/
following the link,
  • i downloaded and unzipped metro 2.0,
  • edited tomcat-home/conf/catalina.properties by replacing shared.loader= line with shared.loader=metro-home/lib/*.jar,
  • set CATALINA_HOME environment variable with the command export CATALINA_HOME=path to tomcat-home and chech with echo $CATALINA_HOME
  • run the command ant -f metro-on-tomcat.xml from metro-home
changes in web service project (generated in netbeans ide as netbeans project):
we have to modify web.xml and add sun-jaxws.xml under project-home/web/WEB-INF in netbeans project. actually, i got help from fromjava example of metro samples package for figuring out how to change the configuration files.
  • in web.xml, add servlet definitions and in sun-jaxws.xml modify endpoint definitions accordingly..
  • build the project in netbeans and copy the war under project-home/dist folder to tomcat-home/webapps folder for deployment.
now, you should see the wsdl at the endpoint you specified in sun-jaxws.xml.

At this point, we have deployed web services successfully, and now is the time to deploy the bpels..

Bpel files and the corresponding wsdl are collected under a bpel module of netbeans ide.
The major necessity is a deploy.xml. Get one from ode-home/examples folder and copy under bpel-module-home. i used the one from sample HelloWorld2.
here is some info about ode deployment descriptor: http://ode.apache.org/creating-a-process.html

After modifying deploy.xml, clean and build the netbeans bpel module.
Before deploying your actual bpel module under tomcat-home/webapps/ode/WEB-INF/processes folder, you may want to try one of the samples coming with ode package just to see if it is working on its own samples.. It is good to note that the bpels i am about to deploy are using the above deployed web services..

Now, lets try to note down what i have to change:
  • some minor namespace errors come up, but they were easy to solve, just read the error log in tomcat-come/logs/catalina.out file.
  • the major restriction is it forced all endpoint addreses to format http://hostname:port/ode/processes/myProcessEndpointName for example http://localhost:8080/Balistika2010Ws/ode/processes/SeriesServiceService?wsdl and http://localhost:8080/ode/processes/AddParameter?wsdl are both valid endpoints..
now, build the bpel module in netbeans and make sure thedeploy.xml is under build folder, if it is not, copy it manually and copy the build folder under tomcat-home/webapps/ode/processes . you may want to rename the folder build with a more meaningful name.
now, check http://localhost:8080/ode/processes.html. If successful, the process must be seen at that address..
An important point is the wsdls for bpels are generated with axis2 anymore because of ode, not jaxws..

Some errors due to the differtence between bpel engines might arise.. For instance i got the following error from my previosly working bpel:

javax.xml.ws.soap.SOAPFaultException: axis2ns62:selectionFailure
at com.sun.xml.internal.ws.fault.SOAP11Fault.getProtocolException(SOAP11Fault.java:178)
at com.sun.xml.internal.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:111)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:108)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:78)
at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:107)
at $Proxy33.lightLoginWsdlOperation(Unknown Source)
at odebpelclient.Main.main(Main.java:28)

Here is a discussion about the problem: http://mail-archives.apache.org/mod_mbox/ode-user/200810.mbox/%3Cfbdc6a970810200738i75692ac6qb47d3263e9aefe1c@mail.gmail.com%3E
Ode does not automatically initialize the variables, since this is not part of the standard.. This might be an extension provided by Open Esb.. So, lets initialize all the variables and redeploy..

i end this post here, i think the point is clear..

Note: btw, x-home in italics means the location where x is installed.

Edit on 8/3/2010, 14:08:
i get the following error when i called one of the bpels from client:

from server log:
DEBUG - GeronimoLog.debug(66) | Fault response message: {http://docs.oasis-open.org/wsbpel/2.0/process/executable}uninitializedPartnerRole

from client log:
javax.xml.ws.soap.SOAPFaultException: axis2ns6:uninitializedPartnerRole
at com.sun.xml.internal.ws.fault.SOAP11Fault.getProtocolException(SOAP11Fault.java:178)
at com.sun.xml.internal.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:111)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:108)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:78)
at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:107)
at $Proxy33.lightLoginWsdlOperation(Unknown Source)
at odebpelclient.Main.main(Main.java:28)

himm, that error was due to a mistake in deploy.xml of bpels.. i had to use keyword invoke instead of provide for invoked web services. So, for writing deploy.xml file, ode-home/examples/DynPartner maybe a better example than HelloWorld2.
and besides, check the existence of initializePartnerRole=yes attribute, when partnerRole exists in partner link.
That solution worked for me :)

Edit on 10/3/2010, 11:37:
in our case, we want to write bpel s that works both with ode and open esb. Here is an example variable initialization that works with both:

<copy>
<from>
<literal>
<ns1:authorizeUserResponse>
<ns1:return> </ns1:return>
</ns1:authorizeUserResponse>
</literal>
</from>
<to variable="AuthorizeUserOut" part="parameters"/>
</copy>

btw, the empty string between returns is necessary..



21 Ağustos 2009 Cuma

wrong port used for xsd in wsdl (openesb)

the environment is openesb (with netbeans 6.5.1) and glassfish server.
when the composite app with bpel processes is deployed, the wsdls for the processes include wrong ports in imports of inner schema files (in this case, 8080 instead of 9080).
here is a description of the problem http://n2.nabble.com/Wrong-Port-Used-When-Generating-Web-Service-Client-td3388707.html and the issue https://open-esb.dev.java.net/issues/show_bug.cgi?id=2204
Actually, the issue had been solved in the internal trunk, however the solution won't be available till next release :(
so, what to do ??

the workaround is
  • download the wsdls and all dependent schema files,
  • edit all imports (of used schema files) manually and
  • use the local wsdl in order to generate stubs at client side .
Thus, the stubs will be generated without any error :)

btw, deploying the business processes to apache ode is also tried. however, the same problem remained :(

10 Temmuz 2009 Cuma

Lomboz ObjectWeb

Lomboz is a free J2EE development environment built on Eclipse.  Home page is http://lomboz.ow2.org/. The reason why i am trying it is because it provides a compact environment for bpel development by providing tomcat + ode easily. (how i prepared my own environemnt manually is here: http://hilaltarakci.blogspot.com/2009/04/eclipse-bpel-designer-apache-ode.html)

( how eclipse bpel desginer could open the bpel file without its extension bpelex file? btw, bpelex is created when i changed the file :) )

6 Nisan 2009 Pazartesi

Eclipse Bpel Designer & Apache ODE

Hello everybody! In this record, I give some basic info about Apache ODE and how to integrate ODE with Eclipse through Eclipse Bpel plugin. Since Eclipse Bpel plugin have not published ODE runtime integration yet, this is not straightforward at this moment. Besides, current Eclipse Bpel does not support Eclipse Ganymede, but I use Ganymede in the following case..
Lets begin..

Deploying ODE to tomcat (5.0.28):
Download .war distribution of ODE 1.2 from http://www.apache.org/dyn/closer.cgi/ode/apache-ode-war-1.2.zip . Extract the file. Copy ode.war to $CATALINA_HOME/webapps. Start tomcat. Open http://localhost:8080/ode
BağlantıDeploying processes to ODE: Put the process folders under $CATALINA_HOME/webapps/ode/WEB-INF/processes manually for manual deployment.

ODE Client: As I know, there is no interface for ODE in which I can see deployed processes except axis2 interface, active processes etc. like ActiveBpel. However, ODE provides the api for this. For instance, this is my little ODE Client to see deployed processes:
-----------------------------
package ode.client;

import org.apache.axiom.om.OMElement;
import org.apache.axis2.AxisFault;
import org.apache.ode.axis2.service.ServiceClientUtil;

public class ODEClient {
OMElement listAllProcesses() throws AxisFault {
ServiceClientUtil client = new ServiceClientUtil();
OMElement root = client.buildMessage("listAllProcesses", new String[] {}, new String[] {});
OMElement result = client.send( root, "http://localhost:8080/ode/processes/ProcessManagement");

return result;
}

public static void main(String[] args) {
ODEClient client = new ODEClient();
try {
client.listAllProcesses();
} catch (AxisFault e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
-----------------------------

Eclipse & ODE runtime integration: This is not published yet. (
http://www.nabble.com/Setup-apache-ODE-runtime-td17848560.html)
However, by following the steps in
http://people.apache.org/~vanto/HelloWorld-BPELDesignerAndODE.pdf , it is possible by getting the latest version for the plugin!
Unfortunately, Eclipse Bpel Designer plugin is not available for Ganymede. But, since I get the latest code for the plugin, I can use Eclipse-Ganymede-Rcp instead of Europa.

Different from HelloWorld-BPELDesignerAndODE document, I did the following:
  • Use eclipse-ganymede-rcp, instead of eclipse-europa-rcp. Otherwise, since the latest code is for ganymede, there will be errors due to version differences.
  • Skip part 2.1 if Apache ODE is already installed.
  • Skip steps 1 to 8 in part 2.2 since BPEL designer is not available for Ganymede in the update site.
  • In step 12 in part 2.2.1, check out all bpel projects under org.eclipse.bpel/plugins.
  • Some of the checked out projects were erronous due to lack of some org.eclipse.wst component. So, installed all plugins starting with WST under ganymede update site (uncategorized).
  • Some projects were erronous due to lack of org.eclipse.jst.. Install all plugins starting with JST under ganymede update site (uncategorized).
  • Delete project org.eclipse.bpel.xpath10.junit since other projects do not depend on it and it mostly consists of unit test.
Currently, all the projects must be error-free :) Continue with step 16 in part 2.2.2.
  • For step 16, Open Run Dialog is Europa is analogous to Run Configurations in Ganymede.
It seems that it supports ODE 1.0, but it did also worked with ODE 1.2 :)

I had problem in viewing http://localhost:8080/ode, however wsdl was ok in http://localhost:8080/ode/processes/HelloWorld?wsdl, so ı didn't care :)

Note on 4/5/9 : I could not view ode since AXIS2_HOME is not defined. When I added this environment variable, it is OK :)

ActiveBpel & ODE Comparison:
http://www.mail-archive.com/ode-dev@incubator.apache.org/msg00825.html
Besides, ODE package structure is very simpler than ActiveBpel.

Some documentation:
http://www.infoq.com/articles/paul-brown-ode
http://ode.apache.org/user-guide.html

My next step may be Intalio. http://www.intalio.com/products/designer/