Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

Another Calling RPG

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Another Calling RPG

    I'm not much help with PCML, perhaps someone else can be of more help there, but as far as calling RPG and accessing jt400.jar, it depends on your version of WebSphere. In fact, whenever you have a problem with WebSphere, it's a good idea to include the product and version number that you are using, such as Version 4.0 Advanced Edition, or Version 3.5 Standard Edition. Even so, as long as you are using one of the more current versions of WebSphere, you must tell it where the jt400.jar file is located by using the adminclient. Click on the Web Application, then click on the Advanced tab and add the fully qualified location of the jt400.jar file to your classpath. This location depends on the version of OS/400 you are using, but in V4R5, it's: /QIBM/ProdData/HTTP/Public/jt400/lib/jt400.jar There are other issues, such as using the native optimizations and using the JTOpen version of the toolbox, but let's just get you up and running first, shall we? Joe

  • #2
    Another Calling RPG

    Joe, Thank you sooooooo much for replying. I am using Websphere 3.5.6 and am on V5R1. I see the jt400.jar file. I did what you said. I added /QIBM/ProdData/HTTP/Public/jt400/lib I left it ending with lib. Restarted Application Server and got the same error on the 400. I also have a java program that doesn't use PCML(attached). Maybe I should try to use that one instead. I haven't quit gotten the Java program to run in DOS like I did the other using PCML. I have been trying to do this for 2 weeks I really appreciate your response! What next?

    EventCall.java

    Comment


    • #3
      Another Calling RPG

      you needed to append jt400.jar at the end of that path element: /QIBM/ProdData/HTTP/Public/jt400/lib/jt400.jar and then PCML requires ttwo another jar files: /QIBM/ProdData/HTTP/Public/jt400/lib/data400.jar /QIBM/ProdData/HTTP/Public/jt400/lib/x4j400.jar Remember to separate the path elements with a colon. Another issue you might run into is the qualification of the PCML file. Then you also could have problems with the XML classes in x4j400.jar clashing with other IBM XML classes used elsewhere in WebSphere. But we'll worry about those problems only if they come up.

      enclosures

      Comment


      • #4
        Another Calling RPG

        Okay. I added the jt400.jar and data400.jar. Those are the two I compiled the java with. I attached the screen in Websphere that I am changeing the classpath, just to make sure I am doing it right. I get the same error as before. I am not using xml. that is why I didn't add that other .jar file. I will add it if you still say I should. On the 400 I get this message in stdout.txt NULL com.ibm.websphere.olt.include.bool com.ibm.websphere.current_uri com.iibm.websphere.olt.forward.request com.ibm.websphere.request_urlCreat Str=Create ibm.websphere.olt.forward.request com.ibm.websphere.request_urlCreat Str=Create I am still getting cannot find PCML file. Be back in an hour Do not go away! PLEASE! Maybe it is my program?

        Doc1.doc

        Comment


        • #5
          Another Calling RPG

          PCML is an XML language, so you are using XML. I believe that the Java classes in data400.jar require, at run-time, classes that are in x4j400.jar. Have you tested this your class outside the context of WebSphere? I unit test all my classes before deployment. You can put public static void main(String[] argv) {} methods in all your classes and use main to test. That way you are sure that your code works before trying it in WebSphere. Your classes, other than servlets and JSP, should not be tightly coupled to Http classes. I had a question asked via email this morning where they wanted a solution. I told them that I didn't have a solution but that they should write a very small test for questionable areas to narrow down the problem. The person ended up solving his own problem. Unit test everything. And leave the unit test in the code. Also, look in to JUnit (www.junit.org).

          enclosures

          Comment


          • #6
            Another Calling RPG

            It use to work in DOS let me make sure I didn't screw anything up and try it again.

            Comment


            • #7
              Another Calling RPG

              I got it to work from DOS. I moved it to the directory in Websphere./QIBM/UserData/WebASAdv/default/hosts/default_hosts/alicesvrWebApp/servlets/org/ducks/duet/EventCallRPG.class I compiled it in dos with this command. javac -classpath "c:/temp/test/jt400.jar;c:/temp/test/xerces.jar;." EventCallRPG.java This is what jar files I have on the pc. Should I compile it using x4j400.jar? I attached the java program and the jsp that calls it. I am getting cannot find PCML and I am getting Creat Str=Create Connecting to iSeries... in stdout.txt. I know this is getting tedious, sorry. Thank you again for your help.

              Comment


              • #8
                Another Calling RPG

                This sure sounds like a classloader issue. I'm not famililar enough with Websphere to give you specific advice. Are you invoking your program call from an EJB? If so, it is highly likely, that there are multiple classloaders at work. Is jt400.jar in more than one location? (Might be difficult to answer unless you know what paths Websphere is using internally). You may want to find a classpath that is "neutral", or is a path that will be picked up by all classloaders and place your PCML document there. This is not a great solution (You want to have everything deployed in one place, and it should be specific to your applications path) but will most likely work. Unfortunately, I'm don't have the Websphere knowledge anymore to know what classloaders and paths are at work. The classloader hierarchies differ by container and cause some pretty big headaches (Weblogic is notorious for instance).

                Comment


                • #9
                  Another Calling RPG

                  Sorry, I didn't read far enough. If you're using the serialized PCML object, and you've created it in the default namespace (no package), you'll need to place that object in the top of the package hierarchy (move it from org/ducks/* to /*).

                  Comment


                  • #10
                    Another Calling RPG

                    I put the PCML in the path QIBM/UserData/WebASAdv/default/hosts/default_hosts/alicesvrWebApp/servlets/org/*. I still get the same error. I don't think it gets to this statement in my java. pcml = new ProgramCallDocument(sys, "EVC030SBM"); I put this before, System.out.println("have you gotten here?"); it printed and this after System.out.println("Hello" + pcml); didn't print this. Printed this in stout.txt NULL Creat Str=Create Connecting to iSeries... have you gotten here? Maybe I should add the path something like this. pcml = new ProgramCallDocument(sys, "/org/ducks/duet/EVC030SBM"); There has got to be away! I am still smiling.......

                    Comment


                    • #11
                      Another Calling RPG

                      Move the PCML up one directory to: QIBM/UserData/WebASAdv/default/hosts/default_hosts/alicesvrWebApp/servlets/ The ProgramCallDocument constructor is throwing the exception so your System.out.println("Hello" + pcml); would not print.

                      Comment


                      • #12
                        Another Calling RPG

                        I moved it and it got the same message. I also tried call it from another JSP and it didn't change anything(of course). When I ran it in DOS I had to specify the path where the .jar files were located. I know I keep coming back to this, I guess because that was the main difference in calling the program. Any other Ideas? Should I be able to call the class file from the URL directly?

                        Comment


                        • #13
                          Another Calling RPG

                          This is getting difficult without having Websphere to check some things. Try changing the constructor to pass the classloader as well. Leave the PCML where you originally had it working in DOS. Change the constructor call to: pcml = new ProgramCallDocument(sys, "EVC030SBM", Thread.currentThread().getContextClassLoader());

                          Comment


                          • #14
                            Another Calling RPG

                            I know I am sorry. I will try that.

                            Comment


                            • #15
                              Another Calling RPG

                              Now I get. ************Beginning of data************** java.lang.NoClassDefFoundError: org/apache/xerces/parsers/SAXParser java/lang/Throwable.(Ljava/lang/StringV+4 (Throwable.java:94) com/ibm/as400/data/PcmlSAXParser.(Ljava/lang/String;Ljava/lang/ClasssLoaderV+0 (PcmlSAXParser.java:63) com/ibm/as400/data/ProgramCallDocument.loadSourcePcmlDocument(Ljava/lang/String;Ljava/lang/ClassLoaderLcom/ibm/as400/data/PcmlDocument;+0 (ProgramCallDocument.java:1053) com/ibm/as400/data/ProgramCallDocument.loadPcmlDocument(Ljava/lang/String;Ljava/lang/ClassLoaderLcom/ibm/as400/data/PcmlDocument;+0 (ProgramCallDocument.java:945) com/ibm/as400/data/ProgramCallDocument.(Lcom/ibm/as400/access/AS400;Ljava/lang/String;Ljava/lang/ClassLoaderV+0 (ProgramCallDocument.java:145) org/ducks/duet/EventCallRPG.callRPG()V+0 (EventCallRPG.java:23) _duet_2F_callRpg_2E_jsp_jsp_1$1.run()V+0 (_duet_2F_callRpg_2E_jsp_jsp_1.ja ************End of Data********************

                              Comment

                              Working...
                              X