Including library dependency for Java Callout in OSB Proxy

Hi,
I have a simple question for which a simple answer is eluding me:
I have developed a simple Java Callout for us in a proxy message flow and that Java class has a dependency on the Commons IO library but for the life of me I can see how I can ensure the proxy is deployed with the library in the classpath because when I perform a simple publish and test the service I get the exception:
<8/06/2009 10:22:27 AM NZST> <Error> <OSB Transform> <BEA-382515> <Callout to java method "public static void com.oracle.mtm.tools.Archiver.archive(byte[],java.lang.String)" resulted in exception: null
java.lang.reflect.InvocationTargetException
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at etc...
java.lang.NoClassDefFoundError: org/apache/commons/io/FileUtils
     at etc...
i.e. the Commons IO (e.g. org/apache/commons/io/FileUtils) is not in the classpath.
There must be a simple way of declaring this dependency or something and have the library loaded but I can't find it.
Any help much appreciated!

Well I managed to answer my own question in the end. It's simply a matter of selecting jar dependencies from other jars which can be done by double clicking ("opening") the jar within the OSB Conf project which opens a jar dependencies dialogue box. As expected it's easy when you know how...

Similar Messages

  • OSB JAR Resources for Java callout in Cluster

    Hi,
    I have a JAR Resource, which has one simple java class with one static method. I invoke this method using Java Callout in my proxy service.
    This all works fine if I am in single node environment, when I move to Cluster two node environment, I export the current single node config and import in cluster config, all services work fine except that JAR is available but I cannot access any methods and when I click on this JAR Resource it says "JAR Resource not found". Is there a special consideration for moving custom JARs to OSB Cluster.
    Please can someone provide some details on this, greatly appreciate.
    thanks
    KD

    Here are some more details, basically I have a JAR which has methods, so I created a JAR resource in cluster, and it uploads my jar successfully. I see a resource name now, when I click on this resource it says "resource not found".
    If I do the same exact steps in non-clustered environment, it just works fine without problems.
    In cluster configuration I went to each node including admin and verified that .ar file is there.
    If I export now what I have in cluster, the exported configuration JAR does have a mycustomjar.Archive file. But I am not able to access it in console.
    Also I want to say thanks for helping me, please let me know what I can verify more.
    thanks
    KD

  • Validation failed for ArchiveClassLoaderDerivedType- Java callouts from OSB

    Even though jar file for java classes are present, I am receiving the following error sometimes:
    com.bea.wli.config.component.NotFoundException: Validation failed for ArchiveClassLoaderDerivedType ..Referenced component (ArchiveClassLoaderDerivedType ../../Java/.._ArchiveClassLoaderDerivedType) not found.
    When I bounce the server then it works, but I can't bounce the server in production. Do anybody know why this is happening?

    Unfortunately ALSB/OSB does not seem to honour JAR files packaged in your JAR and referenced by the manifest Class-Path attribute. As well, the JAR files deployed into a project cannot reference each other. As such, you either have to open the library JAR and stick it into the one you are deploying or to put it on the server classpath via the domain lib (you do not need to edit the start scripts). This is definitely a hole in the capabilities of OSB.

  • Email sending through java callout in osb

    In osb -- proxy service -- service callout -- i am getting a value using dbadapter select
    Then i am using if then condition to perform some operations
    After this step i need to notify this value to a user saying ... the account balance is this much
    In our project already there is a java callout program to send emails to the concerned people ... it is used to notify some other thing like reprocessing activity etc., which was previously developed.
    If i want to use that java callout option to send emails ... do i need to write a new java method and use that class file in this email sending java program and route my program to this service
    Will this work ?
    Thanks,
    Rahul

    do i need to write a new java method and use that class file in this email sending java program and route my program to this serviceYou may directly re-use that existing Java callout if it exposes a static method for starting execution. If it does not expose a static method, then you may write your own class which exposes a static method to be called by OSB, and from that method you may invoke your existing Java callout.
    Regards,
    Anuj

  • Java Callout in OSB failing with null pointer exception

    Hi,
    We have a requirement where we need to convert XML String to org.apache.xmlbeans.impl.values.XmlAnyTypeImpl type using java-callout, but value is not getting set when we are trying to do the same. Below is the code we are using in the java callout:
    byte [] bArray = xml.getBytes();
    InputStream is = new ByteArrayInputStream(bArray);
    Reader reader = new InputStreamReader(is,"UTF-8");
    InputSource iss = new InputSource(reader);
    iss.setEncoding("utf-8");
    xmlNode1 =
    DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(iss);
    XmlAnySimpleType xmlObj = XmlAnySimpleType.Factory.parse(n);
    xmlAnyTypeImpl.set_newValue(xmlObj);
    Node resNode = xmlAnyTypeImpl.getDomNode();
    Can someonce please help for the same.
    Regards,
    Soumik

    First check whether the java class that is called is able to read the string message that is passed by the proxy service.

  • How to Handle Multiple Thread in JAVA Callout with OSB 11g

    Hi Team,
    With My OSB 11g, I want create a static Thread when Java callout.
    Java code as below.
         private static Thread thread;
    static {
              * lazy load thread and with thread-safe ensure
              if(thread == null){
                   synchronized (HornetQConnectionHelper.class) {
                        thread = new ConnectionRecoveryThread();
                        // Daemon thread, JVM level, Won't be interrupted, Safe!
                        thread.setDaemon(true);
                        thread.start();
    When this class was first called in OSB, the thread start run. while when I redeploy it, the old Thread is still running, if call the class again, it will create a new Thread. The two threads will run at the same time.
    Any body know how do configure it, so that there is only one static Thread in the Weblogic JVM.
    Thanks.
    Best Regards,
    Raysen Jia

    Hi Raysen Jia,
    Create a weblogic startup class... See the references bellow...
    Hope this is helpful...
    http://jagadesh4java.blogspot.com.au/2010/05/working-with-weblogic-startup-shutdown.html
    http://docs.oracle.com/cd/E23943_01/upgrade.1111/e10126/basic_upgrade.htm#FUPAS464
    Cheers,
    Vlad

  • Problem with java callout in OSB

    Hi guys,
    i have a java class and when i am using that java class in osb using the java call out it is not returning the output.
    My java class contains 2 parameters and return a string , when i am running the java program its working fine where as my osb is not returning anything.
    I am passing the values to my parameters as xs:string('Transmission') and xs:string('sub_battery') , i tried in different ways of to pass the value to both the parameters still not returning anything.
    please help me out in resolving this problem.
    Thanks in advance.
    Regards,
    Shaik

    if you put logging in the java methods, do you see this output, in other words, does the call from osb to java work ?

  • Including External JARs for Java Application in OC4J

    Hi Experts,
    Here is my requirement.
    I have developed my Java application using Tomcat Server & Eclipse. In my application I have used some External JARs & imported the classes in my JSP.
    Now that I'm using OC4J Server instead of Tomcat I'v no clue as to where I have copy these External JARs for my application to work.
    I have installed OBIEE-Client which includes OC4J server. The path where I have placed my application is as below
    *"C:\OracleBI\oc4j_bi\j2ee\home\default-web-app"*
    If I run my application the server does not import the classes in the JSP which we include using Import statement using JSP tags (*ex* - <%@ page import = "org.apache.commons.fileupload.*"%>).
    This is the location which I found, where I need to put my Java-J2EE application. This OC4J_BI comes with OBIEE.
    Kindly help me out on where to place these External JARs exact location in OC4J.
    Also let me know if I have to alter any configuration/xml file (if so pls specify the file name & its location).
    Thanks in advance,
    Venky

    You can either include the external libraries in the application, by placing them into WEB-INF/lib, or you can import them into the server as "shared libraries", normally you'd use the "enterprise manager" application to do this. Having loaded a shared library you then add it to the classpath when you're deploying the application.

  • Schema name dependancy for DB Adapters in OSB

    Hello,
    We are having a problem with the DBAdapters used in OSB.
    We have created a DBAdapter in our developement env where the database schema name dev_utilities.In our test env the schema name is test_utilities.
    The DBAdapter in OSB would not work giving errors dev_utilities is invalid.
    Anyway to fix this.We have same connection pool names though.
    Thanks.

    Are you using a managed connection.
    when you use a managed connection it will not check for connection details in your wsdl instead it will get from the server using the jndi name that you have specified.
    you can go through below link for creating managed connection
    http://tech-learnings.blogspot.com/2010/04/creating-data-source-in-soa-11g.html
    http://kr.forums.oracle.com/forums/thread.jspa?threadID=1083177

  • Java callout in OSB not showing available methods

    Hi,
    I've made a simple jar which contains a class with a static method which connects to our active directory. I'm using Spring to connect to the ad. The jar is build using maven. When i've build the jar, I have copied it to a Jar directory in my OSB project. I've created a JavaCallout action in which I can select the jar but it doesnt seem to recognize my static method......there are no methods I can select!
    Can anyone maybe tell me what is wrong here?
    I've compiled the Jar using jdk1.5. Im using 11G ps2. The method takes a String as Input and returns a List.
    Thanks in advance!

    The ActiveDirectoryAdapterException is a wrapper class which I made to wrap exceptions thrown while connecting to the AD. This class is located in the jar.
    I have stripped the method down to its most simplest form like you said.
    I have this method on my class:
    * Enable a user
    * @param aUsername
    public static void enableUser(String aUsername) {
         createDao().enableUser(aUsername);
    }and it still is not seen by OEPE. The weird thing is that it does see another class which has a public static void main(String[] args) throws Exception.
    There is no difference between them except that they are in different packages.

  • In OSB 10,3, a Java Callout runs in the same thread of the Proxy Service?

    Hello,
    a I have a Java Callout within the Proxy Service, request pipeline.
    Does it runs in the same thread of the Proxy?
    If NOT,
    which work manager is the Java Callout pinned to?
    can I set the work manager I want?
    Thank you,
    regards
    F.Costa

    Thanks a lot.
    Pointer to great info.
    However doesn't mention Java Callout threading, nor the documentation does.
    Anybody with a YES or NO, please...
    F.Costa

  • Doing a commandline callout from OSB

    How should one do a command-line call out from an OSB proxy service, would one just do a java callout and pass it on from there? The documentation seems to recommend against it because it will require threads, but I'm not sure how else one would accomplish something like this.
    What I need to do is pass a file to gpg and then use the returned file for further processing.

    Ok, you might be right. I guess there must be other implementations for PGP in Java.If there are we have been unable to find them, and they very well might suffer from the same drawbacks as bouncycastle.
    I would say there isn't anything useful on command-line, but our preferences are probably very different. Involving command-line logic has its disadvantages like difficult deployment, potential painful migration (platform dependency), security related problems ... But if you don't mind, go for it.Those problems are true no matter what for any project of at least interesting complexity. and command-line invocations are great solution for all of them. The interface tends to be very simple, just the command name and some parameters which makes it much easier to build replacements if it is truly needed, and deployment is usually eased by having some kind of installer. The only potential problem is one of scalability.
    Which still leaves me with how to do it properly, since invoking the command line from Java seems to necessitate threads, which the OSB recommends against for Java callouts. Does that warning still hold if all the spawned threads must complete before the function returns?

  • XDK for java in JDeveloper

    Hi there,
    I am new to this tool and cant find something needed, Can anyone let me know does this tool includes the XDK for Java?

    Yes it does include the Oracle XDK for Java.
    You can add the libraries to your project in your project properties.

  • Distribution of Perspective for Java

    Can I include JavaBean "Perspective for Java" from JDeveloper 3.1.1.2 in my application and distribute it or I must pay some licence fee?
    Thank you
    Matic

    Hi,
    If you develop your application using an Oracle product, then you can redistribute the Perspectives bean with your application without an additional license fee.
    See the Release Notes for information on those libraries that do require a runtime license.
    null

  • 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

Maybe you are looking for