You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Glen Daniels <gd...@macromedia.com> on 2002/02/06 21:38:12 UTC

RE: Current build: Emitter hangs while reading class file (bug fo und in Axis, fix inside)

Also, do we really need to spawn a process to run javap?  There's no class-based way to do this?

-----Original Message-----
From: Thomas Börkel [mailto:tb@ap-ag.com]
Sent: Wednesday, February 06, 2002 3:24 PM
To: axis-user@xml.apache.org
Subject: RE: Current build: Emitter hangs while reading class file (bug found in Axis, fix inside)


HI!
 
I found the bug and I have the fix for it:
 
In class org.apache.axis.utils.JavapUtils, method javap(), line 174:
 
Before:
            Process pr = rt.exec("javap -classpath " + cp + " -private -l " + cls.getName());

Now:
            Process pr = rt.exec("javap -classpath \"" + cp + "\" -private -l " + cls.getName());

 
Reason: CLASSPATH may contain SPACEs.
 
BTW: This call to "javap" could be more robust anyway. What if there is no PATH to "javap"? I think, it will then hang also.
 
Regards,
Thomas

-----Original Message-----
From: Thomas Börkel 
Sent: Mittwoch, 6. Februar 2002 17:46
To: Axis Mailinglist
Subject: Current build: Emitter hangs while reading class file



HI! 

I tried out the Emitter class from the current nightly build and apparently, it hangs while trying to read the class file. This happens with Emitter.emit() and Emitter.getWSDL(). This does not happen with alpha3.

Using JDK 1.4 RC1. Classes are compiled with FastJavac from NetBeans 3.3.1. 

This is what I do: 
        emitter = new Emitter(); 
        emitter.setCls(Class.forName(completeName)); 
        emitter.setAllowedMethods(allowedMethods.toString()); 
        emitter.setServiceName(className); 
        emitter.setIntfNamespace(" http:// <http://> " + packageName + ".p2plus.apag.com"); 
        emitter.setUseInheritedMethods(true); 
        emitter.setLocationUrl(" http://localhost:2037/ <http://localhost:2037/> " + packageName + "/" + className + ".jws"); 
        def = emitter.getWSDL(); 


This is the stacktrace: 

        at java.io.FileInputStream.readBytes(Native Method) 
        at java.io.FileInputStream.read(FileInputStream.java:192) 
        at java.io.BufferedInputStream.read1(BufferedInputStream.java:220) 
        at java.io.BufferedInputStream.read(BufferedInputStream.java:277) 
        - locked <02A70DE8> (a java.io.BufferedInputStream) 
        at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(StreamDecoder.java:404) 
        at sun.nio.cs.StreamDecoder$CharsetSD.implRead(StreamDecoder.java:442) 
        at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:179) 
        - locked <02A70030> (a java.io.InputStreamReader) 
        at java.io.InputStreamReader.read(InputStreamReader.java:167) 
        at java.io.BufferedReader.fill(BufferedReader.java:136) 
        at java.io.BufferedReader.readLine(BufferedReader.java:299) 
        - locked <02A70030> (a java.io.InputStreamReader) 
        at java.io.BufferedReader.readLine(BufferedReader.java:362) 
        at org.apache.axis.utils.JavapUtils.javap(Unknown Source) 
        - locked <06DCFAA8> (a java.lang.Class) 
        at org.apache.axis.utils.JavapUtils.getParameterNames(Unknown Source) 
        at org.apache.axis.wsdl.fromJava.ClassRep.getParameterNames(Unknown Sour 
ce) 
        at org.apache.axis.wsdl.fromJava.ClassRep.walkInheritanceChain(Unknown S 
ource) 
        at org.apache.axis.wsdl.fromJava.ClassRep.addMethods(Unknown Source) 
        at org.apache.axis.wsdl.fromJava.ClassRep.init(Unknown Source) 
        at org.apache.axis.wsdl.fromJava.ClassRep.<init>(Unknown Source) 
        at org.apache.axis.wsdl.fromJava.ClassRep.init(Unknown Source) 
        at org.apache.axis.wsdl.fromJava.ClassRep.<init>(Unknown Source) 
        at org.apache.axis.wsdl.fromJava.ClassRep.init(Unknown Source) 
        at org.apache.axis.wsdl.fromJava.ClassRep.<init>(Unknown Source) 
        at org.apache.axis.wsdl.fromJava.ClassRep.init(Unknown Source) 
        at org.apache.axis.wsdl.fromJava.ClassRep.<init>(Unknown Source) 
        at org.apache.axis.wsdl.fromJava.DefaultBuilderPortTypeClassRep.build(Un 
known Source) 
        at org.apache.axis.wsdl.fromJava.Emitter.writePortType(Unknown Source) 
        at org.apache.axis.wsdl.fromJava.Emitter.getWSDL(Unknown Source) 



Anyone any ideas? 

Thanks! 

Regards, 
Thomas