Fabricio, I think you should make sure the "InputStreamHandler.class" is included in the classpath.
To verify my thought, you can try to comment out the codes in the "WSCap3.java" and recompile and redeploy. I bet you won't get the java.lang.reflect.InvocationTargetException. The step 3 in your description is not good enough to make sure that class is available to the WS. Don -----Original Message----- From: Fabrício [mailto:[EMAIL PROTECTED] Sent: Thursday, August 18, 2005 11:12 AM To: axis-user@ws.apache.org Cc: [EMAIL PROTECTED] Subject: RES: RES: Error - java.lang.reflect.InvocationTargetException? Donald, I've tried doing it yet. But I did it setting classpath in setclasspath.bat file. But it didn't work. Maybe my problem is a little different. I will try to be completely understandable. I have a legacy program called "CAP3". It's a bioinformatic program. And I need to put this program as a web service ok? Thus, I created a Java class that calls the program and returns the output file. This class needs to control stdin and stdout of cap3 process. And to handle the stdin and stderr I have to create two threads. One for stdin and another to stderr. Because of this I created another class to starts the threads. So, as my class calls an external method to start the threads my web service must do this. I'm attaching the two files that I have to use. The .JWS and the another class required. If anyone could tell me how I can solve my problem. I will appreciate you so much. I did like this: 1. Compiled both of them - ok 2. Got the WSCap3.java and put in [TOMCAT]/axis/WSCap3.jws - ok 3. Got the InputStreamHandle.class and put in [TOMCAT]/common/lib - ok 4. In Apache Tomcat Properties I added "C:\Arquivos de programas\Apache\Tomcat 5.0\common\lib\InputStreamHandler.class" to Java Classpath field; - ok 5. Restarted tomcat - ok 6. Opened the http://localhost:8080/axis/WSCap3.jws?wdls - ok 7. Ran the client and got the error java.lang.reflect.InvocationTargetException - not ok :-( Thanks a lot for all the help! Fabricio. -----Mensagem original----- De: Chen, Donald [mailto:[EMAIL PROTECTED] Enviada em: quinta-feira, 18 de agosto de 2005 09:58 Para: axis-user@ws.apache.org Cc: [EMAIL PROTECTED] Assunto: RE: RES: Error - java.lang.reflect.InvocationTargetException? I use Tomcat 5 on WinXPPro. The way I configure/start/stop the Tomcat is via a tiny "Tomcat" icon on the system tray, I right-click it and there is a small menu pomp up from it. On the menu, there are 5 selections: "Configure...", "Start Service", "Stop Service", "Exit" and "About". Then I select "Configure...", and it pomp up a "Apache Tomcat Properties" dialog box(as shown in the attachment). Inside the dialog box, I reset the JavaClasspath. That is what I mean by "Tomcat|Properties|JavaClasspath". Hope that helps, Donald -----Original Message----- From: Fabrício [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 17, 2005 7:18 PM To: axis-user@ws.apache.org Cc: [EMAIL PROTECTED] Subject: RES: RES: Error - java.lang.reflect.InvocationTargetException? I'm using tomcat 5 and I didn't understand when you say Tomcat|Properties|JavaClasspath??? Is it a file? Folder? I putted my external class in [TOMCAT]\common\lib, but didn't work. I opened a setclasspath.bat file and I set this line: set CLASSPATH=%JAVA_HOME%\lib\tools.jar;%CATALINA_HOME%\common\lib\InputStreamHa ndler.class; But didn't work!! :'( I really don't know where I have to set my classpath!! Please does anyone have a solution for me??? Thanks to all, Fabrício -----Mensagem original----- De: Chen, Donald [mailto:[EMAIL PROTECTED] Enviada em: quarta-feira, 17 de agosto de 2005 11:40 Para: axis-user@ws.apache.org Cc: [EMAIL PROTECTED] Assunto: RE: RES: Error - java.lang.reflect.InvocationTargetException? Fabricio, I think I have fixed my problem. What I did is put all the necessary classpaths to the Tomcat|Properties|JavaClasspath, and restarted the Tomcat. After doing that, the problem is gone. I tried to put all the necessary classes into the [TOMCAT]webapps\axis\WEB-INF\classes and it didn't work for me either. I guess, all the axis specific classes need to go to the [TOMCAT]webapps\axis\WEB-INF\classes, while the Tomcat specific classes go to the Tomcat|Properties|JavaClasspath. Hope it will work for you too. Don -----Original Message----- From: Fabrício [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 16, 2005 7:21 PM To: axis-user@ws.apache.org Cc: [EMAIL PROTECTED] Subject: RES: RES: Error - java.lang.reflect.InvocationTargetException? Javier, Where I have to put the class? I putted it into [TOMCAT]webapps\axis\WEB-INF\classes and didn't work. Could you be more clear please!?! Thanks a lot! Fabrício -----Mensagem original----- De: Javier Gonzalez [mailto:[EMAIL PROTECTED] Enviada em: terça-feira, 16 de agosto de 2005 18:34 Para: axis-user@ws.apache.org Assunto: Re: RES: Error - java.lang.reflect.InvocationTargetException? I'm not sure I'm understanding you two - calling all sorts of Java classes is possible with axis. Are you sure you have all the needed classes in the webapp classpath? Does your class need special parameters for its constructor? On 8/16/05, Fabrício <[EMAIL PROTECTED]> wrote: > Hi Donald, > > In my case, I really need to have the call to method from another class. My > web service is a kind of wrapper for a legacy application. And to do the > call, it's necessary to escort stdin and stderr. And I'm doing this with two > threads. As: > > cmd = "d:\\programs\\cap3\\cap3 " + newPath + "my_seqs"; > process = Runtime.getRuntime().exec(cmd); > > StringBuffer inBuffer = new StringBuffer(); > InputStream inStream = processo.getInputStream(); > new InputStreamHandler( inBuffer, inStream ); > > StringBuffer errBuffer = new StringBuffer(); > InputStream errStream = processo.getErrorStream(); > new InputStreamHandler( errBuffer , errStream ); > > process.waitFor(); > > The InputStreamHandler is another java class. I really don't know how to > solve it without the use of these threads (another class). :'-( > > -- > > Fabrício. > > -----Mensagem original----- > De: Chen, Donald [mailto:[EMAIL PROTECTED] > Enviada em: terça-feira, 16 de agosto de 2005 16:14 > Para: [EMAIL PROTECTED]; axis-user@ws.apache.org > Assunto: RE: Error - java.lang.reflect.InvocationTargetException? > > Yes, exactly. > > The moment I let the method in the WS call another class, I got the > problem. > > Looks like we are on the same boat. > > Right now, I am trying to rewrite the service provider class to avoid > the unnecessary calling. > > Also, I suspect the Tomcat is not able to find all the necessary jars to > facilitating the call. > > Let me know what's your finding? > > Don > > > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Tuesday, August 16, 2005 1:31 PM > To: axis-user@ws.apache.org; Chen, Donald > Subject: Re: Error - java.lang.reflect.InvocationTargetException? > > Hi, > > I'm having the same problem and in my case is because my web service > needs to > call a method from a common java class. I need to do this, but I think > that > isn't possible in Axis. Does your web service has a method call to > another > class to? > > -- > > Fabricio. > > > Citando "Chen, Donald" <[EMAIL PROTECTED]>: > > > Hi, there. > > > > I got a "Error - java.lang.reflect.InvocationTargetException" complain > > when I tried to invoke a web service. > > > > Any idea on how to find out what's going wrong? And what could be the > > reason(s)? > > > > Thanks. > > > > Don > > PS. Configure: WinXPPro Tomcat5.5/Axis1.2/JRE1.5 > > > > > > > ---------------------------------------------------------------- > This message was sent using IMP, the Internet Messaging Program. > > > -- > No virus found in this incoming message. > Checked by AVG Anti-Virus. > Version: 7.0.338 / Virus Database: 267.10.10/73 - Release Date: 15/8/2005 > > > -- Javier Gonzalez Nicolini -- No virus found in this incoming message. Checked by AVG Anti-Virus. Version: 7.0.338 / Virus Database: 267.10.10/73 - Release Date: 15/8/2005 -- No virus found in this incoming message. Checked by AVG Anti-Virus. Version: 7.0.338 / Virus Database: 267.10.10/73 - Release Date: 15/8/2005