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
  • 1.  Jar file import problem in java service

    Posted Fri July 08, 2005 04:17 PM

    Hi,

    I am trying to import jar file into my java service through the shared tab. I have kept the jar files in \IS\packgename\code\jars.
    When the service is complied it is throwing an error

    “.” expected
    import myjar.jar;
    ^

    Please let me know how can i get remove this…

    Thanks in advance. …

    Sunny


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


  • 2.  RE: Jar file import problem in java service

    Posted Wed July 13, 2005 02:40 PM

    Sunny,

    You cannot import jar files in the shared tab. Instead, import the class(es) that is/are contained in the jar file that you want to reuse in your java service. Say your ‘myjar.jar’ contains a class ‘myclass.class’ the provides functionality you require in your Java service, you enter ‘myclass’ in the shared tab.

    Regards,

    Koen


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


  • 3.  RE: Jar file import problem in java service

    Posted Wed July 13, 2005 03:01 PM

    And you should only specify the package or class, without “import” and semi colon.

    If it still doesn’t found de .jar, you may place it at IS\lib\jars


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


  • 4.  RE: Jar file import problem in java service

    Posted Wed July 13, 2005 05:55 PM

    Sunny,

    One quick way to see what classes a jar file contains is to open it in with a tool like WinZip. The filenames shown are the classes. You will need to prepend the package name which you can get by replacing the slashes in the folder names with periods.

    For example, jms.jar contains the Java Messaging Service (JMS) classes. If you open this file in WinZip, you will see a file called “ConnectionFactory.class” in a folder named “javax/jms”. The resulting class to import would be “javax.jms.ConnectionFactory”.

    You can do something similar from the command line using the command

    HTH,

    Mark


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