Orabpel vs commons-httpclient

Hi,
I am working on embedded oc4j with jdeveloper10.1.3.
I am using BPM Workflow library in my project. Which includes orabpel.jar.
At the same time, I want to use the few of the functionality like HttpMethodRetryHandler, NoHttpResponseException… from commons-httpclient-3.0-rc4.jar.
While I am using both jar files at the same time, I am getting the runtime class ambiguity in org.apache.commons.httpclient package.
Can you help me out to overcome on the issue?
Thanks,

I'd say your setRequestBody() call is overwriting the parameters. Read the javadocs of the API to get more details about how they work.
What you are trying to mimic is a multipart request, where you can send a file as part of the request to the server. HttpClient should have capabilities to do a multipart request, and on the server side you can use the FileUpload API to read the file and the parameters back.
[http://hc.apache.org/httpclient-3.x/methods/multipartpost.html|http://hc.apache.org/httpclient-3.x/methods/multipartpost.html]
[http://commons.apache.org/fileupload/using.html|http://commons.apache.org/fileupload/using.html]

Similar Messages

  • Difference between common-httpclient 3.0 and httpclient 4.0

    Hi,
    I am using SSL communicaiton between client and server machine.The JDK version is 1.6.0_19.I am using HttpClient 4.0 now.I used common-Httpclient 3.0 earlier. The client and the server both are having the certificate.Here we are doing mutual authentication sending the certificate to each other.
    If I use the command -Djavax.net.debug=all command I am able to see the detail client and server communicaiton.I wanted to know, what are the destination server it is reaching and that's why I have used wireShark.I have seen a difference here.If I use common-httpclient 3.0 component then it is reaching the verisign site to import the CRL.But if I use httpclient 4.0 then it is not reaching the verisign site.It might be reaching the verisign site for the CRL check.
    I know internally it is using the JSSE component.
    Here are my questions :
    I like to know why this difference is happening?
    Is the httpclient initiate CRL checking?
    Howcan I initiate the OCSP  instead of CRL check using the httpclient and the JSSE?
    how could I check the detail log?
    I like to know based on what condition the application is reaching the verisign site(means CRL checking).
    Please help me out.

    Hi Subba reddy,
    Check this link for PI differencess
    https://wiki.sdn.sap.com/wiki/display/XI/PI%207.1%20Components%20and%20its%20features%20over%20XI%202.0,XI%203.0,PI%207.0
    Regards
    Ramesh

  • Commons HTTPClient : Sending file as well as parameters

    Hi,
    I want to send some parameters as well as a file in request body. I have been doing this via PostMethod by Commons HTTPClient.
    Client Code:
              HttpClient client = new HttpClient();
                   PostMethod method = new PostMethod("http://localhost:7080/exchange/receive");
                   //Parameters
                   method.addParameter("username","test");
                   method.addParameter("password","a311xhq23");
                   //File
                   String strXML = FileTest.readTextFile("C:/in.xml");
                   method.setRequestBody(strXML);
                   int statusCode = client.executeMethod(method);
                   if (statusCode != HttpStatus.SC_OK) {
                        System.err.println("Method failed: " + method.getStatusLine());
                   String responseString = method.getResponseBodyAsString();
                   System.out.println("Response : \n\n"+responseString);Server Code:
                    String username = request.getParameter("username");
                  System.out.println("Username : "+username);
              InputStream is = request.getInputStream();
              byte buf[]=new byte[1024];
              int len;
              OutputStream out = new FileOutputStream(new File("c:/out.xml"));
              while((len=is.read(buf))>0)
                     out.write(buf,0,len);
              out.close();
              is.close();Here the file is written successfully but request parameters are null. What could be the issue?
    Is it right way to send both parameters as well as file?
    In http client I haven't specify content type. So what will be default content type? is it multipart request?
    Thank is advance.
    Regards,
    Amit
    Edited by: amit_patel_java on Apr 14, 2010 11:38 PM

    I'd say your setRequestBody() call is overwriting the parameters. Read the javadocs of the API to get more details about how they work.
    What you are trying to mimic is a multipart request, where you can send a file as part of the request to the server. HttpClient should have capabilities to do a multipart request, and on the server side you can use the FileUpload API to read the file and the parameters back.
    [http://hc.apache.org/httpclient-3.x/methods/multipartpost.html|http://hc.apache.org/httpclient-3.x/methods/multipartpost.html]
    [http://commons.apache.org/fileupload/using.html|http://commons.apache.org/fileupload/using.html]

  • ALSB - Java Callout (.jar using commons-httpclient-3.1)

    Hello everyone,
    I'm having a not so funny problem.
    I made a Java class, that will be called by a Proxy Service (Java callout). I'm using the commons.httpclient-3.1.jar (+ codec and logging).
    Here's the code:
    package util.http;
    import org.apache.commons.httpclient.HttpClient;
    import org.apache.commons.httpclient.methods.*;
    public class UtilitaireHTTP {
    // method used by the Proxy Service
    public static String getLastModified (String url){
    return getHeader(url,"last-modified");
    private static String getHeader(String url, String header){
    HttpClient client = new HttpClient();
    String lastModified = "404";
    HeadMethod head = new HeadMethod(url);
    try {
    //not working
    /*int statusCode = client.executeMethod( head );
    if (statusCode == 200){
         lastModified = head.getResponseHeader(header).getValue();
    //working
    lastModified = "200";
    catch(Exception e){
         System.out.println(e);
    finally {
    // release any connection resources used by the method
    head.releaseConnection();
    return lastModified;     
    Here's the problem: Whenever I remove the comment block, test it (it's going to work with JUnit), create a JAR. Import it into ALSB jar resources folder. When I do a Java Callout in a Proxy Service I won't be able to see my method getLastModified. If I put that block in comment, re-do all the export import, I'll see the method in the list.
    //not working
    /*int statusCode = client.executeMethod( head );
    if (statusCode == 200){
         lastModified = head.getResponseHeader(header).getValue();
    //working
    lastModified = "200";
    Anyone knows the solution or problem.
    Thank you!
    Van

    While playing with java callouts i've built working "groovy callout" sample. This way you can keep logic in your alsb proxy service rather than in jar file. Have a look. http://blog.aujava.com/?p=64

  • Using Apache Commons HTTPClient to create a custom socket for Java mail

    Does anyone know how to use Apache Commons HTTPClient to create a custom socket for Java mail. This is necessary for me to use NTLM authentication

    JavaMail doesn't use HTTP.
    If you want to add support for NTLM authentication to one of the standard protocols,
    your best bet is to create a SASL provider, although note that only JavaMail's IMAP
    provider uses SASL currently. The other protocols should add SASL support, but that
    hasn't been done yet.

  • ITMS and Jakarta Commons-HttpClient crazy frequent in log

    I'm seeing blocks like this several times an hour in my web log for one of my sites that hosts a few podcasts. In fact, Apple IPs makes of the bulk of clients (7-8 of the top 10) that access my site. Why?
    17.251.0.227 - - [17/Mar/2010:07:52:49 -0700] "HEAD /podcasts/studies.php HTTP/1.1" 200 - "-" "iTMS"
    17.251.0.232 - - [17/Mar/2010:07:52:49 -0700] "HEAD /podcasts/studies.php HTTP/1.1" 200 - "-" "iTMS"
    17.251.0.227 - - [17/Mar/2010:07:52:49 -0700] "GET /podcasts/studies.php HTTP/1.1" 200 22160 "-" "iTMS"
    17.251.0.224 - - [17/Mar/2010:07:52:49 -0700] "GET /podcasts/studies.php HTTP/1.1" 200 22160 "-" "Jakarta Commons-HttpClient/3.0"
    17.251.0.225 - - [17/Mar/2010:07:54:02 -0700] "HEAD /podcasts/videopodcast.php HTTP/1.1" 200 - "-" "iTMS"
    17.251.0.224 - - [17/Mar/2010:07:54:02 -0700] "HEAD /podcasts/videopodcast.php HTTP/1.1" 200 - "-" "iTMS"
    17.251.0.228 - - [17/Mar/2010:07:54:02 -0700] "GET /podcasts/videopodcast.php HTTP/1.1" 200 22499 "-" "iTMS"
    17.251.0.231 - - [17/Mar/2010:07:54:02 -0700] "GET /podcasts/videopodcast.php HTTP/1.1" 200 22499 "-" "Jakarta Commons-HttpClient/3.0"

    no bites

  • Java.lang.NoClassDefFoundError: org/apache/commons/httpclient/HttpException

    Test.java NoClassDefFoundError java.lang.NoClassDefFoundError: org/apache/commons/httpclient/HttpException
    Can any one explain what is the cause of this error?? not able to understand what jar file to be uploaded??

    http://forum.java.sun.com/thread.jspa?threadID=5156615&tstart=0
    Duplicate post!

  • Install problem olite NoClassDefFoundError: javax/activation/DataSource

    Hello,
    I ran into an installation problem with the Oracle BPEL PM server. Though the installation completed successfully during startup of the server the following error occurs (part of log, complete log follows):
    XXXXXXXXXXXXXXX
    <2004-12-11 16:22:45,959> <ERROR> <default.collaxa.cube> <ServerManager::handleInitException> Error while initializing java class "javax/activation/DataSource".
    Java class "javax/activation/DataSource" cannot be found. Check if class "javax
    /activation/DataSource" package is in your classpath.
    <2004-12-11 16:22:45,959> <ERROR> <default.collaxa.cube> <ServerManager::handleInitException>
    Failed to load OraBPEL Process "default" domain because:
    javax/activation/DataSource
    <ServerManager::loadAllDomains>
    ORABPEL START-UP ERROR!!!!!
    XXXXXXXXXXXXXXXXXXX
    It seems to happen because of the following exception:
    XXXXXXXXXXXXXXXXXXX
    java.lang.NoClassDefFoundError: javax/activation/DataSource
    XXXXXXXXXXXXXXXXXXX
    On another WinXP-System everything is fine.
    I already had a default Oracle Lite Installation on my machine through Mobile Development Kit when installing BPEL PM Server. So I think there is a conflict between the two OLite DB... (Unfortunately I really need the first installation of OLite).
    When I tried to reach the bpel-OLite DB through msql everything is fine. I can address the orapbel schema either with the ODBC-DSN syntax or the syntax which uses the olsv2040 adaptor service.
    I checked ODBC.ini, ODBCinst.ini and polite.ini - they are configured as mentioned in another forum thread.
    The classpath seems to be correct as shown by the log (following). The class javax/activation/DataSource is in orapbel.jar - this archive is in the classpath. Perhaps the signature of the executed method doesn't fit with two concurrent olite DB on the system...
    Does somebody has an idea what's wrong with my configuration?
    I appreciate any suggestion.
    Thank you very much!
    Florian Werner
    University Tuebingen, Germany
    STARTUP LOG OF BPEL SERVER:
    04/12/11 16:22:35 Application default (default) initialized...
    04/12/11 16:22:35 Binding EJB CubeEngineBean to ejb/collaxa/system/CubeEngineBea
    n...
    04/12/11 16:22:35 Binding EJB DispatcherBean to ejb/collaxa/system/DispatcherBea
    n...
    04/12/11 16:22:35 Binding EJB InvokeSenderBean to ejb/collaxa/system/InvokeSende
    rBean...
    04/12/11 16:22:35 Binding EJB ServerBean to ejb/collaxa/system/ServerBean...
    04/12/11 16:22:35 Binding EJB DeliveryBean to ejb/collaxa/system/DeliveryBean...
    04/12/11 16:22:35 Binding EJB MessageBean to ejb/collaxa/system/MessageBean...
    04/12/11 16:22:35 Binding EJB InstanceKeyGenerator to ejb/collaxa/system/Instanc
    eKeyGenerator...
    04/12/11 16:22:35 Binding EJB DomainManagerBean to ejb/collaxa/system/DomainMana
    gerBean...
    04/12/11 16:22:35 Binding EJB FinderBean to ejb/collaxa/system/FinderBean...
    04/12/11 16:22:35 Binding EJB ProcessManagerBean to ejb/collaxa/system/ProcessMa
    nagerBean...
    04/12/11 16:22:35 Binding EJB InstanceManagerBean to ejb/collaxa/system/Instance
    ManagerBean...
    04/12/11 16:22:35 Binding EJB ActivityManagerBean to ejb/collaxa/system/Activity
    ManagerBean...
    04/12/11 16:22:35 Binding EJB ArchiveManagerBean to ejb/collaxa/system/ArchiveMa
    nagerBean...
    04/12/11 16:22:35 Binding EJB PresentationManagerBean to ejb/collaxa/system/Pres
    entationManagerBean...
    04/12/11 16:22:35 Binding EJB TaskManagerBean to ejb/collaxa/system/TaskManagerB
    ean...
    04/12/11 16:22:35 Binding EJB TransactionManagerBean to ejb/collaxa/system/Trans
    actionManagerBean...
    04/12/11 16:22:35 Binding EJB TransactionViewManagerBean to ejb/collaxa/system/T
    ransactionViewManagerBean...
    04/12/11 16:22:35 Binding EJB CubeFinderBean to ejb/collaxa/system/CubeFinderBea
    n...
    04/12/11 16:22:35 Binding EJB TransactionFinderBean to ejb/collaxa/system/Transa
    ctionFinderBean...
    04/12/11 16:22:36 Application orabpel (Collaxa Web Applications) initialized...
    04/12/11 16:22:38 Web-App default:defaultWebApp (0.0.0.0/0.0.0.0:9700/) started.
    04/12/11 16:22:38 Building Global TagLibrary Persistent Cache
    04/12/11 16:22:38 Looking for global resource at C:\orabpel\system\appserver\oc4
    j\j2ee\home\config\..\jsp\lib\taglibDone getting application current resources
    04/12/11 16:22:38 Done initializing cache
    04/12/11 16:22:38 Refreshing global cache - from existing cache ...
    04/12/11 16:22:38 Building Application TagLibrary Persistent Cache for defaultWe
    bApp
    04/12/11 16:22:38 Done getting application current resources
    04/12/11 16:22:38 Done initializing cache
    04/12/11 16:22:38 Refreshing application cache - from existing cache ...
    04/12/11 16:22:38 Found 0 listeners
    04/12/11 16:22:38 Web-App orabpel:admin_war (0.0.0.0/0.0.0.0:9700/BPELAdmin) sta
    rted...
    04/12/11 16:22:38 Building Application TagLibrary Persistent Cache for admin_war
    04/12/11 16:22:38 Done getting application current resources
    04/12/11 16:22:38 Done initializing cache
    04/12/11 16:22:38 Refreshing application cache - from existing cache ...
    04/12/11 16:22:38 Found 0 listeners
    04/12/11 16:22:38 Web-App orabpel:console_war (0.0.0.0/0.0.0.0:9700/BPELConsole)
    started...
    04/12/11 16:22:38 Building Application TagLibrary Persistent Cache for console_w
    ar
    04/12/11 16:22:38 Done getting application current resources
    04/12/11 16:22:38 Done initializing cache
    04/12/11 16:22:38 Refreshing application cache - from existing cache ...
    04/12/11 16:22:38 Found 0 listeners
    04/12/11 16:22:38 Web-App orabpel:startup_war (0.0.0.0/0.0.0.0:9700/orabpel) sta
    rted...
    04/12/11 16:22:38 Building Application TagLibrary Persistent Cache for startup_w
    ar
    04/12/11 16:22:38 Done getting application current resources
    04/12/11 16:22:38 Done initializing cache
    04/12/11 16:22:38 Refreshing application cache - from existing cache ...
    04/12/11 16:22:38 Found 0 listeners
    <ServerManager::__init>
    Oracle BPEL Server version 2.0.10
    Build: 2004.08.26.19.51
    Build time: Thu Aug 26 19:51:38 PDT 2004
    Build type: release
    <ServerDescriptor::validateCompatibility> Detected server descriptor version '2.
    0.1'
    <BaseJDKAdaptor::initAdaptor>
    JVM properties
    Java version: 1.4.2_04, Sun Microsystems Inc.
    Java Home: C:\j2sdk1.4.2_04\jre
    Java VM: Java HotSpot(TM) Client VM 1.4.2_04-b05, Sun Microsystems Inc
    OS-System: Windows XP 5.1, x86
    System Class path: oc4j.jar;C:\orabpel\system\appserver\oc4j\j2ee\home
    \lib/ejb.jar;C:\orabpel\system\appserver\oc4j\j2ee\home\lib/servlet.jar;C:\orabp
    el\system\appserver\oc4j\j2ee\home\lib/ojsp.jar;C:\orabpel\system\appserver\oc4j
    \j2ee\home\lib/jndi.jar;C:\orabpel\system\appserver\oc4j\j2ee\home\lib/jdbc.jar;
    C:\orabpel\system\appserver\oc4j\j2ee\home\iiop.jar;C:\orabpel\system\appserver\
    oc4j\j2ee\home\iiop_gen_bin.jar;C:\orabpel\system\appserver\oc4j\j2ee\home\lib/j
    ms.jar;C:\orabpel\system\appserver\oc4j\j2ee\home\lib/jta.jar;C:\orabpel\system\
    appserver\oc4j\j2ee\home\lib/jmxri.jar;C:\orabpel\system\appserver\oc4j\j2ee\hom
    e\lib/javax77.jar;C:\orabpel\system\appserver\oc4j\j2ee\home\lib/javax88.jar;C:\
    orabpel\system\appserver\oc4j\j2ee\home\../../opmn/lib/ons.jar;C:\orabpel\system
    \appserver\oc4j\j2ee\home\../../opmn/lib/optic.jar;C:\orabpel\system\appserver\o
    c4j\j2ee\home\../../lib/dms.jar;C:\orabpel\system\appserver\oc4j\j2ee\home\../..
    /dms/lib/dms.jar;C:\orabpel\system\appserver\oc4j\j2ee\home\lib/connector.jar;C:
    \orabpel\system\appserver\oc4j\j2ee\home\lib/cos.jar;C:\orabpel\system\appserver
    \oc4j\j2ee\home\lib/jsse.jar;C:\orabpel\system\appserver\oc4j\j2ee\home\../../or
    acle/lib/jsse.jar;C:\orabpel\system\appserver\oc4j\j2ee\home\lib/jnet.jar;C:\ora
    bpel\system\appserver\oc4j\j2ee\home\lib/jcert.jar;C:\orabpel\system\appserver\o
    c4j\j2ee\home\lib/activation.jar;C:\orabpel\system\appserver\oc4j\j2ee\home\lib/
    mail.jar;C:\orabpel\system\appserver\oc4j\j2ee\home\../../javavm/lib/jasper.zip;
    C:\orabpel\system\appserver\oc4j\j2ee\home\../../lib/xmlparserv2.jar;C:\orabpel\
    system\appserver\oc4j\j2ee\home\../../oracle/lib/xmlparserv2.jar;C:\orabpel\syst
    em\appserver\oc4j\j2ee\home\lib/jaxp.jar;C:\orabpel\system\appserver\oc4j\j2ee\h
    ome\lib/jaas.jar;C:\orabpel\system\appserver\oc4j\j2ee\home\jazn.jar;C:\orabpel\
    system\appserver\oc4j\j2ee\home\../../jdbc/lib/classes12dms.jar;C:\orabpel\syste
    m\appserver\oc4j\j2ee\home\../../oracle/jdbc/lib/classes12dms.jar;C:\orabpel\sys
    tem\appserver\oc4j\j2ee\home\../../jdbc/lib/nls_charset12.jar;C:\orabpel\system\
    appserver\oc4j\j2ee\home\../../oracle/jdbc/lib/nls_charset12.jar;C:\orabpel\syst
    em\appserver\oc4j\j2ee\home\jaxb-rt-1.0-ea.jar;C:\orabpel\system\appserver\oc4j\
    j2ee\home\../../soap/lib/soap.jar;C:\orabpel\system\appserver\oc4j\j2ee\home\../
    ../webservices/lib/wsserver.jar;C:\orabpel\system\appserver\oc4j\j2ee\home\../..
    /webservices/lib/wsdl.jar;C:\orabpel\system\appserver\oc4j\j2ee\home\../../rdbms
    /jlib/aqapi.jar;C:\orabpel\system\appserver\oc4j\j2ee\home\lib/jem.jar;C:\orabpe
    l\system\appserver\oc4j\j2ee\home\../../javacache/lib/cache.jar;C:\orabpel\syste
    m\appserver\oc4j\j2ee\home\lib/http_client.jar;C:\orabpel\system\appserver\oc4j\
    j2ee\home\../../jlib/jssl-1_1.jar;C:\orabpel\system\appserver\oc4j\j2ee\home\../
    ../oracle/jlib/jssl-1_1.jar;C:\orabpel\system\appserver\oc4j\j2ee\home\../../jli
    b/repository.jar;C:\orabpel\system\appserver\oc4j\j2ee\home\../../oracle/jlib/re
    pository.jar;C:\orabpel\system\appserver\oc4j\j2ee\home\lib/jaasmodules.jar;C:\o
    rabpel\system\appserver\oc4j\j2ee\home\../../sqlj/lib/runtime12ee.jar;C:\orabpel
    \system\appserver\oc4j\j2ee\home\../../sqlj/lib/translator.jar;C:\orabpel\system
    \appserver\oc4j\j2ee\home\lib/crimson.jar;;C:\orabpel\system\classes;C:\orabpel\
    lib\saxon_7.9.jar;C:\orabpel\lib\orabpel-external.jar;C:\orabpel\lib\orabpel.jar
    ;C:\orabpel\lib\orabpel-common.jar;C:\orabpel\lib\orabpel-ant.jar;C:\j2sdk1.4.2_
    04\lib\tools.jar;C:\orabpel\lib\commons-httpclient-2.0.jar;C:\orabpel\lib\olite4
    0.jar;C:\orabpel\lib\ant_1.5.4.jar;C:\orabpel\lib\xmlparserv2.jar;C:\orabpel\sys
    tem\appserver\oc4j\j2ee\home\applib;C:\orabpel\system\appserver\oc4j\sqlj\lib;C:
    \orabpel\system\appserver\oc4j\rdbms\jlib\xsu12.jar;C:\orabpel\system\appserver\
    oc4j\lib\dsv2.jar;C:\orabpel\system\appserver\oc4j\j2ee\home\jsp\lib\taglib;C:\o
    rabpel\system\appserver\oc4j\j2ee\home\jsp\lib\taglib\jaxen-full.jar;C:\orabpel\
    system\appserver\oc4j\j2ee\home\jsp\lib\taglib\ojsputil.jar;C:\orabpel\system\ap
    pserver\oc4j\j2ee\home\jsp\lib\taglib\saxpath.jar;C:\orabpel\system\appserver\oc
    4j\j2ee\home\jsp\lib\taglib\standard.jar;C:\orabpel\system\appserver\oc4j\j2ee\h
    ome\applications\orabpel_ear\ejb_ob_engine.jar;C:\orabpel\system\appserver\oc4j\
    j2ee\home\application-deployments\orabpel\ejb_ob_engine.jar\deployment.cache;
    <BasePlatformAdaptor::registerShutdownHook> Registered shutdown hook for olite
    <ConnectionFactoryImpl::init> Initialized connection factory jdbc/BPELServerData
    Source
    <ConnectionFactoryImpl::init> Initialized connection factory jdbc/BPELServerData
    Source
    <ServerManager::__init> Detected datasource 'olite'
    <ServerAdaptorManager::init> Initialized adaptors for platform 'oc4j_10g'
    <ServerManager::loadAllDomains> Loading all domains under C:\orabpel\domains
    <DomainDescriptor::validateCompatibility> Detected domain descriptor version '2.
    0.5'
    <2004-12-11 16:22:45,028> <INFO> <default.collaxa.cube> <ServerManager::loadDoma
    in>
    Oracle BPEL Server version 2.0.10
    Build: 2004.08.26.19.51
    Build time: Thu Aug 26 19:51:38 PDT 2004
    Build type: release
    <2004-12-11 16:22:45,138> <INFO> <default.collaxa.cube.engine> <CubeEngine::load
    >
    Initializing BPEL domain from descriptor file
    "C:\orabpel\domains\default\config\domain.xml"
    <ConnectionFactoryImpl::init> Initialized connection factory jdbc/BPELServerData
    Source
    <ConnectionFactoryImpl::init> Initialized connection factory jdbc/BPELServerData
    Source
    <2004-12-11 16:22:45,368> <INFO> <default.collaxa.cube.engine> <BaseDatabaseAdap
    tor::validateCompatibility> Detected database version '2.0.29'
    <2004-12-11 16:22:45,378> <INFO> <default.collaxa.cube.engine> <AdaptorManager::
    init> Initialized adaptors for platform 'oc4j_10g', datasource 'olite'
    <2004-12-11 16:22:45,959> <ERROR> <default.collaxa.cube> <ServerManager::handleI
    nitException> Error while initializing java class "javax/activation/DataSource".
    Java class "javax/activation/DataSource" cannot be found. Check if class "javax
    /activation/DataSource" package is in your classpath.
    <2004-12-11 16:22:45,959> <ERROR> <default.collaxa.cube> <ServerManager::handleI
    nitException>
    Failed to load OraBPEL Process "default" domain because:
    javax/activation/DataSource
    <ServerManager::loadAllDomains>
    ORABPEL START-UP ERROR!!!!!!!!
    OraBPEL run-time system failed to start due to exception:
    Exception not handled by the Collaxa Cube system.
    An unhandled exception has been thrown in the Collaxa Cube system. The exception
    reported is: "java.lang.NoClassDefFoundError: javax/activation/DataSource
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:141)
    at org.apache.axis.encoding.ser.JAFDataHandlerSerializerFactory.class$(J
    AFDataHandlerSerializerFactory.java:76)
    at org.apache.axis.encoding.ser.JAFDataHandlerSerializerFactory.getSeria
    lizerClass(JAFDataHandlerSerializerFactory.java:85)
    at org.apache.axis.encoding.ser.JAFDataHandlerSerializerFactory.<init>(J
    AFDataHandlerSerializerFactory.java:73)
    at org.apache.axis.encoding.DefaultTypeMappingImpl.<init>(DefaultTypeMap
    pingImpl.java:154)
    at org.apache.axis.encoding.DefaultTypeMappingImpl.<init>(DefaultTypeMap
    pingImpl.java:130)
    at org.apache.axis.encoding.DefaultTypeMappingImpl.getSingleton(DefaultT
    ypeMappingImpl.java:124)
    at com.collaxa.cube.engine.deployment.TypeSoapRegistry.registerHeaderTyp
    es(TypeSoapRegistry.java:269)
    at com.collaxa.cube.engine.deployment.TypeSoapRegistry.load(TypeSoapRegi
    stry.java:101)
    at com.collaxa.cube.engine.core.TypeRegistry.load(TypeRegistry.java:121)
    at com.collaxa.cube.engine.CubeEngine.__load(CubeEngine.java:522)
    at com.collaxa.cube.engine.CubeEngine.load(CubeEngine.java:452)
    at com.collaxa.cube.admin.ServerManager.loadDomain(ServerManager.java:91
    9)
    at com.collaxa.cube.admin.ServerManager.loadAllDomains(ServerManager.jav
    a:733)
    at com.collaxa.cube.admin.ServerManager.init(ServerManager.java:92)
    at com.collaxa.cube.beans.ServerBean.init(ServerBean.java:202)
    at IServerBean_StatelessSessionBeanWrapper14.init(IServerBean_StatelessS
    essionBeanWrapper14.java:79)
    at com.collaxa.cube.admin.CXLoaderServlet.init(CXLoaderServlet.java:59)
    at javax.servlet.GenericServlet.init(GenericServlet.java:258)
    at com.evermind.server.http.HttpApplication.loadServlet(HttpApplication.
    java:2094)
    at com.evermind.server.http.HttpApplication.findServlet(HttpApplication.
    java:4523)
    at com.evermind.server.http.HttpApplication.initPreloadServlets(HttpAppl
    ication.java:4617)
    at com.evermind.server.http.HttpApplication.initDynamic(HttpApplication.
    java:765)
    at com.evermind.server.http.HttpApplication.<init>(HttpApplication.java:
    497)
    at com.evermind.server.Application.getHttpApplication(Application.java:8
    86)
    at com.evermind.server.http.HttpServer.getHttpApplication(HttpServer.jav
    a:688)
    at com.evermind.server.http.HttpSite.initApplications(HttpSite.java:570)
    at com.evermind.server.http.HttpSite.setConfig(HttpSite.java:263)
    at com.evermind.server.http.HttpServer.setSites(HttpServer.java:259)
    at com.evermind.server.http.HttpServer.setConfig(HttpServer.java:160)
    at com.evermind.server.ApplicationServer.initializeHttp(ApplicationServe
    r.java:2325)
    at com.evermind.server.ApplicationServer.setConfig(ApplicationServer.jav
    a:1498)
    at com.evermind.server.ApplicationServerLauncher.run(ApplicationServerLa
    uncher.java:93)
    at java.lang.Thread.run(Thread.java:534)
    Exception: java.lang.NoClassDefFoundError: javax/activation/DataSource
    Handled As: com.collaxa.cube.engine.EngineInitializationException
    04/12/11 16:22:46 Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)
    initialized

    Hello Erwin,
    thank you for your fast reply.
    I'll try to switch to 9i/10g.
    In migrating perhaps also I will use the Designer as standalone tool on the client and connecting to iAS on another machine where I could integrate the BPEL Engine.
    That means integrating BPEL in our architecture.
    Regards Florian

  • SOAPFault and ORABPEL-03013

    Hi all,
    In our flow, we are catching a specific soap fault which is defined as the following in our partner wsdl file:
    <wsdl:message name="PolicyException">
    <wsdl:part name="PolicyException" element="parlayx_common_xsd:PolicyException"/>
    </wsdl:message>
    we get the information from the fault, we assign them to some variables in our human task and then we assign this task to some user. Our fault variable is a global variable. When the user updates the task outcome from the worklist app, we get the following exception in the flow:
    07/06/06 00:32:34 pFaultMessage is [email protected] name:PolicyException
    07/06/06 00:32:34 QName string is PolicyException
    07/06/06 00:32:34 ERROR: exception symbol "03013" not found in resource file.
    07/06/06 00:32:34 oracle.j2ee.ws.saaj.soap.soap11.DetailEntry11
    Jun 6, 2007 12:32:34 AM org.apache.commons.httpclient.HttpMethodBase readResponseBody
    WARNING: Response content length is not known
    <2007-06-06 00:32:34,195> <ERROR> <default.collaxa.cube> <BaseCubeSessionBean::logError> Error while invoking bean "cube delivery":
    ORABPEL-03013
    at com.collaxa.cube.admin.adaptors.jdk.JDKAdaptor_1_4.newInstance(JDKAdaptor_1_4.java:82)
    at com.collaxa.cube.engine.persist.DefaultPersistenceMgr.newInstance(DefaultPersistenceMgr.java:269)
    at com.collaxa.cube.engine.persist.DefaultPersistenceMgr.create(DefaultPersistenceMgr.java:165)
    at com.collaxa.cube.engine.core.PersistenceService.getObjectFromMoniker(PersistenceService.java:1195)
    at com.collaxa.cube.engine.core.PersistenceService.get(PersistenceService.java:589)
    at com.collaxa.cube.engine.core.PersistenceService.load(PersistenceService.java:419)
    at com.collaxa.cube.engine.types.bpel.CXMessageVariable__CXPM.create(CXMessageVariable__CXPM.java:110)
    at com.collaxa.cube.engine.core.PersistenceService.getObjectFromMoniker(PersistenceService.java:1195)
    at com.collaxa.cube.engine.core.PersistenceService.get(PersistenceService.java:589)
    at com.collaxa.cube.engine.core.BaseScope.getLocalVariant(BaseScope.java:138)
    at com.collaxa.cube.engine.core.Scope.getVariantRV(Scope.java:504)
    at com.collaxa.cube.engine.core.Scope.getObjectRV(Scope.java:449)
    at com.collaxa.cube.engine.core.Scope.getObject(Scope.java:849)
    at bpel.bpm_ism_createrolewf.BPEL_BIN$$BPELC_BpCFt2.__initScope(BPEL_BIN.java:16395)
    at com.collaxa.cube.engine.core.map.BaseCubeBlock.__initScope(BaseCubeBlock.java:342)
    at com.collaxa.cube.engine.core.map.BaseCubeBlock.activate(BaseCubeBlock.java:162)
    at com.collaxa.cube.engine.core.map.BaseBPELBlock.activate(BaseBPELBlock.java:109)
    at com.collaxa.cube.engine.core.map.BaseCubeBlock.activate(BaseCubeBlock.java:132)
    at com.collaxa.cube.engine.core.map.BaseBPELBlock.activate(BaseBPELBlock.java:89)
    at bpel.bpm_ism_createrolewf.BPEL_BIN$$BPELC_BpCFt2.activate(BPEL_BIN.java:16312)
    it seems like when the engine is reloading the flow from the database, it cannot instantiate the soap fault detail message. Does anybody have any idea why this might happen? I could not find any information about this on the internet or on metalink.
    Best regards,
    Serkan

    Hi,
    I have same error did you find how to solve it??
    Please advise.
    JO

  • Commons-logging error when starting Flex2 in JRun

    Created new JRun Server and deployed Flex2 to this server.
    Receiving this error when starting up this server instance.
    Starting Macromedia JRun 4.0 (Build 92909), logicerm2 server
    07/13 22:23:28 info JRun Naming Service listening on *:2911
    07/13 22:23:28 warning No sessionSecret has been specified in
    jrun.xml. Installi
    ng a self generated sessionSecret.
    07/13 22:23:28 info No JDBC data sources have been configured
    for this server (s
    ee jrun-resources.xml)
    07/13 22:23:28 info JRun Web Server listening on *:8102
    07/13 22:23:28 info Deploying enterprise application
    "default-ear" from: file:/C
    :/JRun4/servers/logicerm2/default-ear/
    07/13 22:23:28 info Deploying web application "JRun Default
    Web Application" fro
    m: file:/C:/JRun4/servers/logicerm2/default-ear/
    07/13 22:23:29 info Web Services in default-ear#default-war:
    07/13 22:23:29 info AdminService
    07/13 22:23:29 warning default-war web application has
    'reload' as true in jrun-
    web.xml. Consider setting it false if the application is
    running in production e
    nvironment.
    07/13 22:23:29 warning default-war web application has
    'compile' as true in jrun
    -web.xml. Consider setting it false if the application is
    running in production
    environment.
    07/13 22:23:29 user JSPServlet: init
    07/13 22:23:29 info Deploying web application "Flex Data
    Services" from: file:/C
    :/JRun4/servers/logicerm2/flex/
    07/13 22:23:29 user JSPServlet: init
    07/13 22:23:29 user FlexMxmlServlet: init
    07/13 22:23:29 INFO Loading configuration file
    C:\JRun4\servers\logicerm2\flex\W
    EB-INF\flex\flex-webtier-config.xml
    07/13 22:23:30 INFO Loading configuration file
    C:\JRun4\servers\logicerm2\flex\W
    EB-INF\flex\flex-config.xml
    07/13 22:23:30 user FlexMxmlServlet: Starting Adobe Flex Web
    Tier Compiler
    07/13 22:23:30 user FlexMxmlServlet: Adobe Flex Web Tier
    Compiler Build: 143451
    07/13 22:23:30 user MessageBrokerServlet: init
    07/13 22:23:31 user FlexSwfServlet: init
    07/13 22:23:31 user FlexInternalServlet: init
    07/13 22:23:31 info Deploying web application "Flex Admin Web
    Application" from:
    file:/C:/JRun4/servers/logicerm2/flex-admin/
    07/13 22:23:31 user JSPServlet: init
    07/13 22:23:31 user MessageBrokerServlet: init
    07/13 22:23:31 info Deploying web application "Flex Data
    Services Samples" from:
    file:/C:/JRun4/servers/logicerm2/samples/
    07/13 22:23:31 user JSPServlet: init
    07/13 22:23:31 user FlexMxmlServlet: init
    07/13 22:23:32 INFO Loading configuration file
    C:\JRun4\servers\logicerm2\sample
    s\WEB-INF\flex\flex-webtier-config.xml
    07/13 22:23:32 INFO Loading configuration file
    C:\JRun4\servers\logicerm2\sample
    s\WEB-INF\flex\flex-config.xml
    07/13 22:23:32 user FlexMxmlServlet: Starting Adobe Flex Web
    Tier Compiler
    07/13 22:23:32 user FlexMxmlServlet: Adobe Flex Web Tier
    Compiler Build: 143451
    07/13 22:23:32 user MessageBrokerServlet: init
    07/13 22:23:32 error Could not pre-load servlet:
    MessageBrokerServlet
    [1]org.apache.commons.logging.LogConfigurationException:
    org.apache.commons.logg
    ing.LogConfigurationException:
    org.apache.commons.logging.LogConfigurationExcept
    ion: Invalid class loader hierarchy. You have more than one
    version of 'org.apa
    che.commons.logging.Log' visible, which is not allowed.
    (Caused by org.apache.co
    mmons.logging.LogConfigurationException: Invalid class loader
    hierarchy. You ha
    ve more than one version of 'org.apache.commons.logging.Log'
    visible, which is n
    ot allowed.) (Caused by
    org.apache.commons.logging.LogConfigurationException: or
    g.apache.commons.logging.LogConfigurationException: Invalid
    class loader hierarc
    hy. You have more than one version of
    'org.apache.commons.logging.Log' visible,
    which is not allowed. (Caused by
    org.apache.commons.logging.LogConfigurationExc
    eption: Invalid class loader hierarchy. You have more than
    one version of 'org.
    apache.commons.logging.Log' visible, which is not allowed.))
    at
    org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactory
    Impl.java:543)
    at
    org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactory
    Impl.java:235)
    at
    org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactory
    Impl.java:209)
    at
    org.apache.commons.logging.LogFactory.getLog(LogFactory.java:351)
    at
    org.apache.commons.httpclient.params.DefaultHttpParams.<clinit>(Defau
    ltHttpParams.java:53)
    at
    flex.messaging.services.http.HTTPProxyAdapter.<init>(HTTPProxyAdapter
    .java:111)
    at
    sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
    Method)
    at
    sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown
    Source)
    at
    sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
    Sou
    rce)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at java.lang.Class.newInstance0(Unknown Source)
    at java.lang.Class.newInstance(Unknown Source)
    at
    flex.messaging.util.ClassUtil.createDefaultInstance(ClassUtil.java:71
    at
    flex.messaging.Destination.createAdapter(Destination.java:277)
    at
    flex.messaging.Destination.initDestination(Destination.java:103)
    at
    flex.messaging.services.HTTPProxyService.createDestination(HTTPProxyS
    ervice.java:78)
    at
    flex.messaging.services.AbstractService.createDestinations(AbstractSe
    rvice.java:82)
    at
    flex.messaging.config.MessagingConfiguration.createServices(Messaging
    Configuration.java:187)
    at
    flex.messaging.config.MessagingConfiguration.configureBroker(Messagin
    gConfiguration.java:84)
    at
    flex.messaging.MessageBrokerServlet.init(MessageBrokerServlet.java:10
    5)
    at
    jrun.servlet.WebApplicationService.loadServlet(WebApplicationService.
    java:1242)
    at
    jrun.servlet.WebApplicationService.preloadServlets(WebApplicationServ
    ice.java:789)
    at
    jrun.servlet.WebApplicationService.postStart(WebApplicationService.ja
    va:291)
    at
    jrun.deployment.DeployerService.initModules(DeployerService.java:711)
    at
    jrun.deployment.DeployerService.createWatchedDeployment(DeployerServi
    ce.java:242)
    at
    jrun.deployment.DeployerService.deploy(DeployerService.java:430)
    at
    jrun.deployment.DeployerService.checkWatchedDirectories(DeployerServi
    ce.java:179)
    at
    jrun.deployment.DeployerService.run(DeployerService.java:891)
    at
    jrunx.scheduler.SchedulerService.invokeRunnable(SchedulerService.java
    :223)
    at
    jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.j
    ava:426)
    at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
    Caused by:
    org.apache.commons.logging.LogConfigurationException:
    org.apache.comm
    ons.logging.LogConfigurationException: Invalid class loader
    hierarchy. You have
    more than one version of 'org.apache.commons.logging.Log'
    visible, which is not
    allowed. (Caused by
    org.apache.commons.logging.LogConfigurationException: Inval
    id class loader hierarchy. You have more than one version of
    'org.apache.common
    s.logging.Log' visible, which is not allowed.)
    at
    org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogF
    actoryImpl.java:397)
    at
    org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactory
    Impl.java:529)
    ... 30 more
    Caused by:
    org.apache.commons.logging.LogConfigurationException: Invalid class
    l
    oader hierarchy. You have more than one version of
    'org.apache.commons.logging.
    Log' visible, which is not allowed.
    at
    org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogF
    actoryImpl.java:385)
    ... 31 more
    [0]flex.messaging.config.ConfigurationException: Unable to
    create service 'flex.
    messaging.services.HTTPProxyService' for 'proxy-service' due
    to the following er
    ror: org.apache.commons.logging.LogConfigurationException:
    org.apache.commons.lo
    gging.LogConfigurationException: Invalid class loader
    hierarchy. You have more
    than one version of 'org.apache.commons.logging.Log' visible,
    which is not allow
    ed. (Caused by
    org.apache.commons.logging.LogConfigurationException: Invalid cla
    ss loader hierarchy. You have more than one version of
    'org.apache.commons.logg
    ing.Log' visible, which is not allowed.) (Caused by
    org.apache.commons.logging.L
    ogConfigurationException:
    org.apache.commons.logging.LogConfigurationException:
    Invalid class loader hierarchy. You have more than one
    version of 'org.apache.c
    ommons.logging.Log' visible, which is not allowed. (Caused by
    org.apache.commons
    .logging.LogConfigurationException: Invalid class loader
    hierarchy. You have mo
    re than one version of 'org.apache.commons.logging.Log'
    visible, which is not al
    lowed.)).
    at
    flex.messaging.config.MessagingConfiguration.createServices(Messaging
    Configuration.java:202)
    at
    flex.messaging.config.MessagingConfiguration.configureBroker(Messagin
    gConfiguration.java:84)
    at
    flex.messaging.MessageBrokerServlet.init(MessageBrokerServlet.java:10
    5)
    at
    jrun.servlet.WebApplicationService.loadServlet(WebApplicationService.
    java:1242)
    at
    jrun.servlet.WebApplicationService.preloadServlets(WebApplicationServ
    ice.java:789)
    at
    jrun.servlet.WebApplicationService.postStart(WebApplicationService.ja
    va:291)
    at
    jrun.deployment.DeployerService.initModules(DeployerService.java:711)
    at
    jrun.deployment.DeployerService.createWatchedDeployment(DeployerServi
    ce.java:242)
    at
    jrun.deployment.DeployerService.deploy(DeployerService.java:430)
    at
    jrun.deployment.DeployerService.checkWatchedDirectories(DeployerServi
    ce.java:179)
    at
    jrun.deployment.DeployerService.run(DeployerService.java:891)
    at jrunx.scheduler.SchedulerS07/13 22:23:33 user
    FlexSwfServlet: init
    ervice.invokeRunnable(SchedulerService.java:223)
    at
    jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.j
    ava:426)
    at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
    PLEASE Help!!!
    Bernie

    Figured this one out:
    Searched thru instance of JRun that flex was installed in and
    removed all the additional commons-logging jar files I
    found.

  • "Connection timed out" with HttpClient.

    Hi,
    My goal is to consume a web service using Apache AXIS. This web service uses Integrated Windows Authentication.
    I use IE have configured Proxy server address and Proxy server port using IE's Tools -> Internet Options -> Connections Tab -> LAN Settings -> Proxy serer.
    If type the webservice endpoint address of the form http://239.271.380.120/serveme/WS.asmx in my browser then I see in my browser "You are not authorized to view this page .. HTTP Error 401.2 - Unauthorized: Access is denied due to server configuration. Internet Information Services (IIS)" but there is another client in another network who is getting a login dialog to enter domain\\username and password when he types the web service endpoint address in the browser. This makes me think that either the so called another client is in the same domain as the web service provider and I am not.
    Anway, I tried to write standalone HttpClient (I use commons-httpclient-3.0-rc3, commons-codec-1.3, commons-logging-1.0.4) program NTCredentialsClient.java like below :
    NTCredentialsClient.java
    import org.apache.commons.httpclient.*;
    import org.apache.commons.httpclient.auth.*;
    import org.apache.commons.httpclient.methods.*;
    public class NTCredentialsClient {
         public static void main(String args[]) {
              HttpClient client = new HttpClient();
              NTCredentials credentials = new NTCredentials("user1", "password1", "MYDESKTOP", "domain1");
              AuthScope authScope = new AuthScope("20.222.335.37", 3128);
              client.getState().setCredentials(authScope, credentials);
              //client.getState().setCredentials(AuthScope.ANY, credentials);
              GetMethod get = new GetMethod("http://239.271.380.120/serveme/WS.asmx");
              get.setDoAuthentication(true);
              try {
                   int status = client.executeMethod(get);
                   System.out.println(status);
                   get.getResponseBodyAsStream();
                   // print the status and response
                    System.out.println(status + "\n" + get.getResponseBodyAsString());
              catch (Exception e) {
                   e.printStackTrace();
              finally {
                   get.releaseConnection();
    ------------------------------------------------------------------In the above program, user1, password1, domain1 are details given by my service provider and
    MYDESKTOP is my local machine name from which I am running the above program. 20.222.335.37
    is my proxy server address and 3128 is my proxy server port. Now when I run the above
    program I get this exception :
    Aug 16, 2005 12:43:45 PM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
    INFO: I/O exception caught when processing request: Connection timed out: connect
    Aug 16, 2005 12:43:46 PM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
    INFO: Retrying request
    Aug 16, 2005 12:44:11 PM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
    INFO: I/O exception caught when processing request: Connection timed out: connect
    Aug 16, 2005 12:44:11 PM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
    INFO: Retrying request
    Aug 16, 2005 12:44:37 PM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
    INFO: I/O exception caught when processing request: Connection timed out: connect
    Aug 16, 2005 12:44:37 PM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
    INFO: Retrying request
    java.net.ConnectException: Connection timed out: connect
            at java.net.PlainSocketImpl.socketConnect(Native Method)
            at java.net.PlainSocketImpl.doConnect(Unknown Source)
            at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
            at java.net.PlainSocketImpl.connect(Unknown Source)
            at java.net.SocksSocketImpl.connect(Unknown Source)
            at java.net.Socket.connect(Unknown Source)
            at java.net.Socket.connect(Unknown Source)
            at java.net.Socket.<init>(Unknown Source)
            at java.net.Socket.<init>(Unknown Source)
            at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:79)
            at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:121)
            at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:704)
            at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:382)
            at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:168)
            at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
            at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:324)
            at NTCredentialsClient.main(NTCredentialsClient.java:28)
    ------------------------------------------------------------------Can anyone please tell me whether the configurations I have made in my above client program are correct or is there anything that I am overlooking. Also, in the above program for AuthScope constructor, do I need to pass web service server adderss and port OR my local proxy address and local proxy port as constructor arguments ?
    Please suggest ...
    Thanks & Regards,
    Kr.

    You will need to define your proxy settings. In java, these are provided as system properties:
    System.setProperty("http.proxyHost", "<proxy>");
    System.setProperty("http.proxyPort", "<port>");
    If your proxy uses HTTP authentication, you will need to define a few more system properties, which I don't know off the top of my head. This should actually get you connected with the web server, but as for the 302 error, you'll probably need to contact the system administrator.
    Cheers
    Todd.

  • HTTPS over Apache commons HttpsClient API

    I have an EJB (running on Weblogic 6.1) that currently uses java.net.URL to connect to an Apache webserver to read some data. The problem with this is that I am unable to set a timeout on the URL connection. To get around this problem, I have rewritten it using the Apache Commons' HttpClient package (version 2.0 alpha 2).
    My problem is that whenever I try to connect, I get an exception:
    javax.net.ssl.SSLHandshakeException: FATAL Alert:HANDSHAKE_FAILURE - The handshake handler was unable to negotiate an acceptable set of security parameters.
    It's very frustrating, because the EJB works fine when I use the java.net.URL class. So I am lead to believe that I have SSL set up and working correctly. If not, how is the URL class able to connect?
    Since the URL I must connect to is a CGI, I used the GetMethod class as shown below...
    ----- snip --------
    String urlText = "https://my.host.name/path/to/some.cgi?queryString";
    URI myUrl = new URI( urlText );
    Protocol myProtocol = Protocol.getProtocol(myUrl.getScheme());
    HttpConnection connection = new HttpConnection(myUrl.getHost(), 443, myProtocol);
    connection.setSoTimeout(10000);
    HttpState state = new HttpState();
    GetMethod method = new GetMethod(myUrl.toString());
    // This is where the exception is thrown.
    method.execute(state, connection);
    What am I doing wrong?

    OK, nevermind. I solved the problem.
    For the record, the problem is the order of jars in my weblogic server classpath. I found a related problem in a Weblogic newsgroup that suggested putting the JSSE jars in the classpath before the weblogic.jar. So I tried that and now everything works.
    It is still very odd that this problem only pops up when I use the HttpClient package, not when using java.net.URL.

  • How to pass the encoding through the PostMethod of HttpClient

    Greetings to all,
    I am having component that sends data to another component using PostMethod of HttpClient(org.apache.commons.httpclient.HttpClient) . I want to send the type of encoding used in one component to the other component.
    Is there any way to achieve this?
    Any help appreciated.
    Thanks in advance
    priby

    Without usint OAF Pages? Kindly suggest what do you mean here.
    You should associate a VO to the table and VO attributes to the columns. When the VO executes and data is fetched, corresponding values are shown in the table.

  • Set content-length in PostMethod of Jakarta HttpClient

    Hi Folks,
    I'm trying to send a HttpRequest via Jakarta's HttpClient. Everything works fine, but I could not yet figure out, how to get the content-length of my RequestBody before I set the Name-Value-Pairs via postRequest.setRequestBody(NameValuePair[] data) or after I set the Parameters via the addParameter(String paramName, String paramValue) Method.
    The getRequestContentLength() Method in class org.apache.commons.httpclient.methods.EntityEnclosingMethod is protected, so I can't use it out of the PostMethod class.
    Any suppestions ?
    Thx for help...

    The problem is solved. Instead of doing:
    pw.println(postContent);
    , I do:
    pw.print(postContent);
    ...and it works. The extra newline-chars confused the webserver.
    Thanks for the replies!

  • Problems in Downloading a file from a web site using HttpClient

    Hi,
    My requirement is to download a file from a website using a java program. I have written a program using HttpClient API but I am unable to do so. Reality is that I don't know how to proceed with the HttpClient API to get the file downloaded. Same file can also be downloaded manually by login to that website, below mentioned steps are to be followed to download the file manually.
    1. Login to the website using Login/Password (I have valid login/password)
    2. Two options (links) are there (a) Report (b) Search [I am chosing report option]
    3. Newly opened window shows two tabs (a) Today (b) From & To [I am selection Today tab]
    4. Every tab has two radio button (a) File (b) Destination [Destination is selected by me]
    5. When Search button is pressed. A link gets created when that link is clicked file download popup is opened which allows facility to open/save the file.
    All these 5 step are to be followed in a java program to download the file. Please help in doing the same.

    // first URL which is used to open the website, this will have two text fields userName and password
    String finalURL = "http://www.xyz.in/mstatus/index.php";
    SMSGatewayComponentImpl obj = new SMSGatewayComponentImpl();
    obj.sendMessage(finalURL);
    public void sendMessage(String finalURL) {
    String ipAddrs = "a.b.c.d";
    int port = 8080;
    boolean flag = false;
    try {
    // Create an instance of HttpClient.
    HttpClient client = new HttpClient();
    HostConfiguration hostConfig = new HostConfiguration();
    hostConfig.setProxy(ipAddrs,port);
    client.setHostConfiguration(hostConfig);
    // Create a method instance.
    String cookieName=null;
    String cookieValue=null;
    // Here URL for the login page is passed and passing the user/password
    PostMethod method = new PostMethod(finalURL);
    method.setRequestHeader("userid","userName");
    method.setRequestHeader("passwd","pwd");
    // Execute the method.
    int statusCode = client.executeMethod(method);
    Cookie[] cookies = client.getState().getCookies();
    for (int i = 0; i < cookies.length; i++) {
    Cookie cookie = cookies;
    cookieName = cookie.getName();
    cookieValue = cookie.getValue();
    System.err.println(
    "Cookie: " + cookie.getName() +
    ", Value: " + cookie.getValue() +
    ", IsPersistent?: " + cookie.isPersistent() +
    ", Expiry Date: " + cookie.getExpiryDate() +
    ", Comment: " + cookie.getComment());
    NameValuePair[] respParameters = method.getResponseHeaders();
    String cookie = "";
    for(NameValuePair o : respParameters){
         System.out.println("Name : "+o.getName());
         System.out.println("Value : "+o.getValue());
         if("Set-Cookie".equalsIgnoreCase(o.getName()))
              cookie = o.getValue();
    NameValuePair[] footParameters = method.getResponseFooters();
    System.out.println("****************** Footer Values *******************");
    for(NameValuePair o1 : footParameters){
    System.out.println("Name : "+o1.getName());
    System.out.println("Value : "+o1.getValue());
    // This is jthe URL which comes when login/passowrd is entered and Login button is pressed.
    // I am trying to get the cookie from the first URL and pass this cookie for the second URL so that the session can be maintained
    // Here I may be wron..don't know is this the right way to download the file like this.....????
    finalURL = "http://www.xyz.in/mstatus/mainmenugrsms.php";
         method = new PostMethod(finalURL);
         method.setRequestHeader(cookieName,cookieValue);
         method.setRequestHeader("userid","userName");
         method.setRequestHeader("passwd","pwd");
         method.setRequestHeader("Set-Cookie",cookie);
         statusCode = client.executeMethod(method);
         respParameters = method.getResponseHeaders();
    for(NameValuePair o : respParameters){
    System.out.println("Name : "+o.getName());
         System.out.println("Value : "+o.getValue());
    // and this is the final URL which i got when that final link which enabled file download from the website have been copied as a shortcut and
    // pasted in a notepad. I was thinking that this will return the file as an input stream. but its not happening.
         finalURL = "http://www.xyz.in/mstatus/dlr_date.php#";
         method = new PostMethod(finalURL);
         method.setRequestHeader("Set-Cookie",cookie);
         method.setRequestHeader("userid","userName");
    // userid and passwd field are obtained when login/password page contents are seen using view source of that html
         method.setRequestHeader("type","1");
         // trying to set the cookie so that session can be maintained
    method.setRequestHeader(cookieName,cookieValue);
         method.setRequestHeader("passwd","pwd");
         statusCode = client.executeMethod(method);
         ObjectInputStream objRetInpuStream = new ObjectInputStream(method.getResponseBodyAsStream());
         System.out.println("objRetInpuStream : "+objRetInpuStream);
         if(objRetInpuStream!=null)
         System.out.println("objRetInpuStream available bytes : "+objRetInpuStream.available());
         String returnFile=(String)objRetInpuStream.readObject();
         System.out.println("Returned value \n : "+returnFile);
         respParameters = method.getResponseHeaders();
         for(NameValuePair o : respParameters){
         byte[] responseBody = method.getResponseBody();
         System.out.println("Response Body : "+new String(responseBody));
         if (statusCode != HttpStatus.SC_OK) {
              System.out.println("Error: " + method.getStatusLine());
         } else {
              System.out.println(method.getStatusLine());     
         } catch(Exception nfe) {
                   System.out.println("Exception " + nfe);
    Output
    =====
    /home/loguser/batch> sh run.sh SMSGatewayComponentImpl
    Classname : SMSGatewayComponentImpl
    run.sh[4]: test: 0403-004 Specify a parameter with this command.
    final URL : http://www.xyz.in/mstatus/index.php
    client is :org.apache.commons.httpclient.HttpClient@190e190e
    Cookie: PHPSESSID, Value: anqapu83ktgp8hlot06jtbmdf1, IsPersistent?: false, Expiry Date: null, Comment: null
    Name : Date
    Value : Thu, 06 May 2010 09:08:47 GMT
    Name : Server
    Value : Apache/2.2.3 (Red Hat)
    Name : X-Powered-By
    Value : PHP/5.1.6
    Name : Set-Cookie
    Value : PHPSESSID=anqapu83ktgp8hlot06jtbmdf1; path=/
    Name : Expires
    Value : Thu, 19 Nov 1981 08:52:00 GMT
    Name : Cache-Control
    Value : no-store, no-cache, must-revalidate, post-check=0, pre-check=0
    Name : Pragma
    Value : no-cache
    Name : Content-Length
    Value : 4792
    Name : Content-Type
    Value : text/html; charset=UTF-8
    Name : X-Cache
    Value : MISS from dcp.pas.abc.in
    Name : X-Cache-Lookup
    Value : MISS from dcp.pas.abc.in:8080
    Name : Via
    Value : 1.0 dcp.pas.abc.in:8080 (squid/2.6.STABLE21)
    Name : Proxy-Connection
    Value : keep-alive
    Cookie Value : PHPSESSID=anqapu83ktgp8hlot06jtbmdf1; path=/
    ****************** Footer Values *******************
    Name-2 : Date
    Value-2: Thu, 06 May 2010 09:08:47 GMT
    Name-2 : Server
    Value-2: Apache/2.2.3 (Red Hat)
    Name-2 : X-Powered-By
    Value-2: PHP/5.1.6
    Name-2 : Expires
    Value-2: Thu, 19 Nov 1981 08:52:00 GMT
    Name-2 : Last-Modified
    Value-2: Thu, 06 May 2010 09:08:47 GMT
    Name-2 : Cache-Control
    Value-2: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
    Name-2 : Pragma
    Value-2: no-cache
    Name-2 : Location
    Value-2: index.php
    Name-2 : Content-Length
    Value-2: 0
    Name-2 : Content-Type
    Value-2: text/html; charset=UTF-8
    Name-2 : X-Cache
    Value-2: MISS from dcp.pas.abc.in
    Name-2 : X-Cache-Lookup
    Value-2: MISS from dcp.pas.abc.in:8080
    Name-2 : Via
    Value-2: 1.0 dcp.pas.abc.in:8080 (squid/2.6.STABLE21)
    Name-2 : Proxy-Connection
    Value-2: keep-alive
    Cookie Value second time : PHPSESSID=anqapu83ktgp8hlot06jtbmdf1; path=/
    **Exception java.io.EOFException**
    Is my approach to download the file fromthe website ok????? please help me.

Maybe you are looking for