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

Java code from my IDE to WM

webMethods Community Member

webMethods Community MemberTue February 18, 2003 08:26 PM

  • 1.  Java code from my IDE to WM

    Posted Tue February 18, 2003 03:40 PM

    I saw in the documentation that I can bulding my with my Own IDE.

    “… if you build a Java service in your own IDE, you need to use a utility called jcode to compile your service and generate the necessary files in the namespace…”

    Where is jcode??
    Does someone have a stupid example (simply a System.out.println())??


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


  • 2.  RE: Java code from my IDE to WM

    Posted Tue February 18, 2003 03:50 PM

    Jcode is available in IS server home/bin directory. Just give the package you want to build with a switch -makeall, will build all your codes and create required nodes.

    Sample:
    jcode -makeall


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


  • 3.  RE: Java code from my IDE to WM

    Posted Tue February 18, 2003 04:10 PM

    Thk you for your answer, but I’m new with WM. What’s the next step? Shoud I need to compile my stupid java code or the jcode.sh will? Does I need to create something in WM or not?


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


  • 4.  RE: Java code from my IDE to WM

    Posted Tue February 18, 2003 04:52 PM

    I don’t know jcode at all, and it may be more efficient… But if you want to avoid it, you can simply copy-paste your code from your IDE (say, Jbuilder).

    If you specify input/output first and use Tools->Generate code->for implementing this service, you’ll get the right pipeline sections. Paste this into the service, then simply insert your code between the pipeline sections and direct your output variables to the appropriate lines of the output pipeline section.

    Oh, and remember any necessary imports in the shared tab.


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


  • 5.  RE: Java code from my IDE to WM

    Posted Tue February 18, 2003 05:51 PM

    I develop a jar containing all my goodies using IntelliJ and drop it into MyPackage/code/jars. The the Java services I created with Developer are very slim wrappers that get/put from the pipeline and do parameter/type checking.


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


  • 6.  RE: Java code from my IDE to WM

    Posted Tue February 18, 2003 06:10 PM

    I did a cut and paste for a general code.

    I got the following error.

    Any Ideas?

    In the box

    The source was saved, but was not compiled due to the following errors:

    com.wm.app.b2b.server.ServiceException: [ISS.0014.9116] Unable to locate or start compiler

    Details of the error

    com.wm.app.b2b.server.ServiceException: [ISS.0014.9116] Unable to locate or start compiler

    at com.wm.util.LocalizedException.(LocalizedException.java:109)

    at com.wm.app.b2b.server.ServerException.(ServerException.java:34)

    at com.wm.app.b2b.server.ServiceException.(ServiceException.java:20)

    at wm.server.nsimpl._compile(nsimpl.java:4655)

    at wm.server.nsimpl.buildClass(nsimpl.java:1600)

    at java.lang.reflect.Method.invoke(Native Method)

    at com.wm.app.b2b.server.JavaService.baseInvoke(JavaService.java:287)

    at com.wm.app.b2b.server.ServiceManager.invoke(ServiceManager.java:336)

    at com.wm.app.b2b.server.comm.DefaultServerRequestHandler.handleMessage(DefaultServerRequestHandler.java:64)

    at com.wm.app.b2b.server.HTTPMessageHandler.process(HTTPMessageHandler.java:167)

    at com.wm.app.b2b.server.Dispatch.run(Dispatch.java:203)

    at com.wm.util.pool.PooledThread.run(PooledThread.java:105)

    at java.lang.Thread.run(Thread.java:498)


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


  • 7.  RE: Java code from my IDE to WM

    Posted Tue February 18, 2003 06:19 PM

    hi,
    Check your Memory settings in server.sh or bat file. You should be having sufficient memory for JVM as well as swap memory for your system.
    We had same problem, because we set Max and Min as 1GB and no memory left over for swap. we reduced it to 1/2 GB and then we haven’t seen this error


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


  • 8.  RE: Java code from my IDE to WM

    Posted Tue February 18, 2003 06:27 PM

    Set the path to your java.exe. I do it from the Server Settings > Extended web page.

    watt.server.compile=c:/Java/jdk1.3.1_06/bin/javac -classpath {0} -d {1} {2}


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


  • 9.  RE: Java code from my IDE to WM

    Posted Tue February 18, 2003 06:41 PM

    Fred,

    I made the changes specified. No luck yet. Anything else?

    Thanks
    MKR


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


  • 10.  RE: Java code from my IDE to WM

    Posted Tue February 18, 2003 07:32 PM

    You need to modifiy the server.sh. Locate the two line containned javac and modify it to point to your javac compiler. IMPORTANT before doing this stop IS, modify the file and restart IS


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


  • 11.  RE: Java code from my IDE to WM

    Posted Tue February 18, 2003 07:37 PM

    Hi Fred, can you give me more detail on your example with your jar’s file? The cut & paste from the source of your java service, import, etc. Thanks


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


  • 12.  RE: Java code from my IDE to WM

    Posted Tue February 18, 2003 07:54 PM

    Looks like it Worked. I had to download the JDK 1.3.1. Install it.
    Make Path/JAVA_HOME changes etc.

    Then I made changes to

    watt.server.compile

    variable to point to the latest JDK

    Then I did a cut and paste to the code. Made sure no “main” is available. Only code snippets were allowed.

    Any Snippet code, cut and paste was saved using developer.

    Did a

    jcode makeall

    It compiled fine and dandy.

    Was able to run the new Java service successfully.

    P.S:-
    donot use ; in the imports section in "shared tab.

    Now we are rocking and rolling… :slight_smile:

    Thanks all

    MKR


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


  • 13.  RE: Java code from my IDE to WM

    Posted Tue February 18, 2003 08:04 PM

    If c:/Java/jdk1.3.1_06/bin/javac runs your Java compiler, than it should work. This is the command line used by IS to compile non-Unicode java files (there is a similar watt.server parameter for the unicode compile command line).

    I never change server.bat/sh (just continue to run with the JRE that installs with the product). I’ve never seen “Unable to locate or start compiler” that didn’t get fixed by setting that command line.

    As far as developing within an IDE is concerned. The 4.6 ISDeveloperGuide page 485 describes the code/jars directory. This is part of a package, so the jars are on the package class loader, which is refreshed each time the package is loaded/reloaded.

    The steps for integrating any 3rd party jar into a package are the same:

    1. copy the jar into code/jars
    2. create a Java service in Developer.
    3. do an import in the Java service of a Java class that is in your jar.
    4. use that class in your service.

    When you edit a Java serivce via Developer, the package class loader is rebuilt, so your jar is reloaded as well (but startup services aren’t run each time, so if you have stuff initialized by startup services you have to explicitly reload the package).

    HTH,
    Fred


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


  • 14.  RE: Java code from my IDE to WM

    Posted Tue February 18, 2003 08:12 PM

    Hi “MKR” can you provide me more detail of what you did I mean the exact step. A example of your cut & paste, etc. Thank


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


  • 15.  RE: Java code from my IDE to WM

    Posted Tue February 18, 2003 08:26 PM

    Hi Steph,

    I did the following.

    1. Make Server configurations.

    2. Make Variable settings

    3. Create a new Java Service say “HelloWorld”.

    3a. Take any simple program for example a

            System.out.println("Hello World \n"); 
    

    program.

    3b. Paste it inside the Java Service Source for “HelloWorld” tab.

    3c. Save the work.

    3d. Go to Command Prompt.

    1. Go to <wMHOME>\IntegrationServer\bin directory

    2. do a "jcode makeall <packagename>

    5a. Correct errors if any.

    5b. Go to Developer.

    1. Run the Service.

    P.S:-

    3b can be applied to any small/big java service we may have to implement.

    I didn’t try anything with nested classes or invoking another service in a custom java service.

    Will post one if it works out.

    HTH
    MKR


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


  • 16.  RE: Java code from my IDE to WM

    Posted Tue February 18, 2003 09:37 PM

    Thanks!!! it’s work now. Let me known if you try with nested classes or invoking another service in a custom java service.


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


  • 17.  RE: Java code from my IDE to WM

    Posted Thu February 20, 2003 08:34 AM

    Steph:
    For invoking a service inside a custom java service, you can use this code (stolen from post by Igor at [url=“wmusers.com”]wmusers.com):

    String serviceName = “pub.db:execSQL”;
    NSName nsName = NSName.create(serviceName);
    // Run sql
    IData results = Service.doInvoke(nsName, pipeline);


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


  • 18.  RE: Java code from my IDE to WM

    Posted Fri May 09, 2003 08:19 PM

    Thanks everyone,

    reading this message save me a lot of time to solve the error message…
    “com.wm.app.b2b.server.ServiceException: [ISS.0014.9116] Unable to locate or start compiler”


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


  • 19.  RE: Java code from my IDE to WM

    Posted Wed September 15, 2004 06:46 PM

    Kumar,

    Always use the Search functionality of this site,lot of threads had discussed on this common problem.you will be surprised after seeing the results.It will be the fast way of resolving issues.

    see this link,
    [url=“wmusers.com”]wmusers.com

    HTH,
    RMG


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


  • 20.  RE: Java code from my IDE to WM

    Posted Mon November 08, 2004 05:36 PM

    I have problem saving Java service. wM 4.6 complains about have class name same as package name. The following is full path to my Java service: EDI_DB.EDI_DB:submitData. The first EDI_DB is package name, the second EDI_DB is folder name and service name is submitData. The folder EDI_DB (it is a name of Java class on wM IS) has all service written in Java. And they worked fine but I just have a lot of service there now and it started to complain about the package/class name conflict. If I create another folder and save submitData Java service there, no problem…Did anybody have something similar?

    Thanks.


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


  • 21.  RE: Java code from my IDE to WM

    Posted Mon July 11, 2005 07:09 PM

    hai all,
    i want to develop a custom adapter…i don’t how to strat and flow steps to create adapter .i want full details to develop custom adapter…

    thanks in advance…


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


  • 22.  RE: Java code from my IDE to WM

    Posted Mon July 11, 2005 09:15 PM

    Vasanth,

    I assume you are asking for the location of the documentation. :sunglasses:

    Please check the following directory:
    …\IntegrationServer\doc\adk

    This is the documentation for 6.x ART adapter development.

    Regards


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


  • 23.  RE: Java code from my IDE to WM

    Posted Tue July 12, 2005 12:09 AM

    Vasanth,

    I think there are very few cases that warrant creating a custom adapter using the ADK. Perhaps you could tell us more about what you are trying to do?

    Let’s say you’ve got to integrate with some ERP package for which webMethods does not have a pre-existing adapter. If you only need to do a few things with that ERP package (let’s say create a customer, create an order and create an invoice), you can do that without creating a custom adapter. You would just work with the API, web services or database structure that your ERP vendor provides in order to do those three things.

    On the other hand, if you need to somehow expose all of the functionality of your ERP package and make that functionality available to many development teams, then you might need to build a custom adapter. Even then, I would examine the problem carefully to see if it is worth the extra effort.

    HTH,

    Mark


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


  • 24.  RE: Java code from my IDE to WM

    Posted Fri April 09, 2010 04:38 PM

    :smiley: the problem in this solution is the path. I tried with:
    watt.server.compile=D:\webMethods7\jvm\win150\bin\javac -classpath {0} -d {1} {2}
    watt.server.compile.unicode=D:\webMethods7\jvm\win150\bin\javac -encoding Unicode -classpath {0} -d {1} {2}

    and work for me!.

    ==================================================


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


  • 25.  RE: Java code from my IDE to WM

    Posted Tue September 21, 2010 04:36 AM

    What could be the problem if I’m not seeing in the Developer IDE the fragmented code generated by running the jcode update command?

    I created the java code in netbeans IDE, and successfully compiled and fragmented it. I checked the code/classes dir and ns dir and the generated files are there. What should I do? I tried to reload the package in the Developer IDE and reconnect to the IS but to no avail.


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