IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

Coould not initialize a jars from java service

  • 1.  Coould not initialize a jars from java service

    Posted Wed November 29, 2017 10:33 AM

    Hello,
    I create a java service in a package to read an excel file. For this I needed some jars files (for your information these jars are poi* from 3.17 versions).
    In my development environment I have no problem :

    • A project was created in my workspace and this project refer to this jars file
    • In Integration server, in my package I have my jars files in lib folder. So in runtime that’s work.

    But when I deploy my project in preprod environment, I found my jars in lib libraries of packages in integration server (so no problem). But when I debugg my flow service which use my java service I have a could not initialise class exception.

    You have to know that in Development server SAG was installed on :\app\softwareag folder and in preproduction server it is installed on (the same):\app\SoftwareAG folder (in camel casing). I don"t expect a problem of casing but just in cas I ask.

    My SAG Version is 9.10

    Thanks


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 2.  RE: Coould not initialize a jars from java service

    Posted Wed November 29, 2017 11:41 AM

    Hi Vital,

    as long as the jar is only needed by this package it should be under IntegrationServer/instances/default//code/jars.
    When it needs to be under lib directory of IS it should be in IntegrationServer/instances/default/lib/jars/custom.

    The CamelCase should not be a problem.

    Regards,
    Holger


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 3.  RE: Coould not initialize a jars from java service

    Posted Wed November 29, 2017 11:59 AM

    I confirm in my two servers the folder is IntegrationServer/instances/default//code/jars

    But in dev : the root is E:\app\softwareag
    In PProd : the root is E:\app\SoftwareAG


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 4.  RE: Coould not initialize a jars from java service

    Posted Wed November 29, 2017 01:13 PM

    Hi Vital,

    as pointed out already, the installation directory should not matter in this case.

    The pathes where IntegrationServer looks up jar files should be relative to the instance directory, default in this case.

    Regards,
    Holger


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 5.  RE: Coould not initialize a jars from java service

    Posted Wed November 29, 2017 01:18 PM

    Thanks Holger,
    So I don’t understand why m’y java service work on dev environment and not in preprod environment.
    Is There Any path to configure or any service/program to activate for calling jars when java service using jars are not created in the same Integration server ?


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 6.  RE: Coould not initialize a jars from java service

    Posted Wed November 29, 2017 01:25 PM

    Hi Vital,

    package needs to be reloaded after adding the jar to get the jar loaded into the JVM.

    How did you deploy the package?
    Evnetually you will have to recompile the Java-Service on the target.

    Regards,
    Holger


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 7.  RE: Coould not initialize a jars from java service

    Posted Thu November 30, 2017 12:17 PM

    Hi Holdger,
    I reloaded the package but I have still the same error. I used the deployer to deploy in preprod.
    I don’t know how to recompile the java service in target


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 8.  RE: Coould not initialize a jars from java service

    Posted Thu November 30, 2017 05:42 PM

    Please tell us exactly which files you deployed. It might be that you forgot some fles and that rendered the java service unusable. Normally, you should not compile anyhing in the target environment. It should just work after the deployment.


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 9.  RE: Coould not initialize a jars from java service

    Posted Thu November 30, 2017 07:36 PM

    Ok : I have a package (I call it Pkg1 here) containing a Java service named xlsReading and another flow service xlsRead which called the Java service.
    From my Java Service I call some classes from some jars prefixed by poi.
    For compilation in my designer I use Java EE perspective and in my project in build path, I référence my jars. Automatically that copied my jars in integration server in Pkg1/code/… folder and my flow service work.
    I create a build in deployer containing the Pkg1 package. I deploy it in my other environment (preprod). After deploying in file system I see my flow service, my java service and the jars I used in my java service. I even reload the package. But when I connect in the target environment in my designer and I called my flow service in debug I have a target invocation exception corresponding to a class including in jars file


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 10.  RE: Coould not initialize a jars from java service

    Posted Fri December 01, 2017 03:33 AM

    I’m sorry but without the knowledge about the exact structure of your package (which folder contains which files) I can’t help.

    It seems to me that you can compile locally in designer but the package has a wrong structure so that the server can’t find files/classes where it expects them.


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 11.  RE: Coould not initialize a jars from java service

    Posted Fri December 01, 2017 10:48 AM

    Im sorry : my package make 14 MB, I can not upload it here.


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 12.  RE: Coould not initialize a jars from java service

    Posted Tue December 05, 2017 05:52 AM

    I find my solution with the forum :

    [url]http://tech.forums.softwareag.com/techjforum/posts/list/56376.page[/url]

    Ok :
    obviously I have to modify my manifest.v3 file of my package and add the following line :

    <value name="classloader">package</value>

    It’s seems obscure for me but it’s work.


    #webMethods
    #Integration-Server-and-ESB
    #Flow-and-Java-services


  • 13.  RE: Coould not initialize a jars from java service

    Posted Tue December 05, 2017 04:02 PM

    Thank you for posting the solution! My understanding is that the class that can’t be initialized (part of the POI lib?) uses some other lib that is present in the IS but has an incompatible version. Hence one has to take action so that the version you provide is loaded first (and not the one provided by the IS). Now it would be interesting to know which library causes the conflict.


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods