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.



#Automation


#Applicationintegration
#webMethods
#Integration
 View Only
Expand all | Collapse all

how to add jars?

  • 1.  how to add jars?

    Posted 05/05/09 12:25 PM

    Hi All…

    I would like to import 2 jar files “comm.jar” and “smslib-2.1.3.jar” to my java service… but these files are not in the classpath it seems… i was getting error -" package javax.comm does not exist import javax.comm.CommPort;"
    ^

    please let me know the path where these jars are to be placed…

    looking forward for your valuable comments …

    Thank you,
    Naidu


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


  • 2.  RE: how to add jars?

    Posted 05/05/09 12:44 PM

    Hi,

    If you want the jar file to be specific for a single package then place the Jar file in following location. change the package name to your specific package.

    /IntegrationServer/packages/Package_name/code/jars/static/

    After placing the jars you need to restart the Integration Server.

    cheers…


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


  • 3.  RE: how to add jars?

    Posted 05/05/09 01:00 PM

    Thankyou for you response… But i would like to make the jars files global i.e i they can be imported a java service from any package.

    I tried of keeping the jars in the

    E:\webMethods711a\jvm\win150\jre\lib\ext
    and also in the path
    E:\webMethods711a\IntegrationServer\lib\jars

    but i was stuck with the same error - " class file does not exist "
    i even added the above paths to the classpath in the environment variables.

    looking forward for your replies

    Thank you,


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


  • 4.  RE: how to add jars?

    Posted 05/08/09 01:50 PM

    Packages that use jars/classes in another package should have a dependency on that package. Try doing this.

    Cheers
    Guna
    http://nibodo.com


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


  • 5.  RE: how to add jars?

    Posted 05/21/09 02:47 PM

    I’ve been unable to get this to work.

    How I think it’s supposed to work:

    In package A, jar J is in packages/A/code/jars
    Package B has dependency on package A
    Java code in package B can use classes from J.

    … but whenever I try this, B throws InvocationTargetException.

    I also tried putting the jar in packages/A/code/jars/static - with no luck.

    I gave up and put all the jars in $IS_DIR/lib/jars - which has the highly undesirable consequence that we have to restart IS whenever the jar is updated.


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


  • 6.  RE: how to add jars?

    Posted 05/21/09 03:28 PM

    Jars stored within a package directory cannot be used directly by other packages.

    The dependency feature of IS controls the order of package loading only and nothing else.

    You could place a jar file within a specific package and then create services to access the functionality from other packages. For example, if there is a foo method in the jar, write a foo service that uses that method within the package (package A). Then services in another package (package B) can call that foo service. In this case, configure package B to be dependent on package A so that A is loaded before B and whenever A is reloaded, B will be reloaded.

    HTH.


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


  • 7.  RE: how to add jars?

    Posted 05/21/09 03:45 PM

    According to the Developer User’s Guide:

    … and in more detail from the Developer 6.5 README (!)

    However, I have never persuaded it to work in this way. So maybe Reamon’s statement is more accurate than the WM documentation :proud:


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


  • 8.  RE: how to add jars?

    Posted 05/21/09 04:34 PM

    Thanks for the reference. I’ve never been able to make the cross-package JAR file work either. But I’m going to investigate further based on that read me entry. I’ve been wrong before and perhaps I’m wrong on this issue!


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


  • 9.  RE: how to add jars?

    Posted 05/21/09 06:36 PM

    Success.

    IS 6.5 SP2
    JVM 1.4.2_12

    Created PackageA with a JAR file in …/packages/PackageA/code/jars
    Created PackageB, configured a package dependency on PackageA, version 1.*

    Added PackageB:checkVisibility Java service which referenced a class in the JAR in PackageA–I simply created a new object of a class in the JAR.

    The Java service compiled successfully right away.

    When I ran it the first time, it failed with the target invocation error.

    After reloading PackageA and PackageB, the service ran successfully.

    Thanks for helping me correct my misunderstanding!

    [Edit] And if I remove the dependency from PackageB and reload PackageB, the service fails.


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


  • 10.  RE: how to add jars?

    Posted 05/22/09 03:08 PM

    You can check for the dependency parameters, mainly the version parameter. Try with . and if it doesn’t work then better to go for a SR with wm.

    Cheers
    Guna
    http://www.nibodo.com


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