ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Calling Java Class from Compute Node: Class not found except

Post new topic  Reply to topic
 Calling Java Class from Compute Node: Class not found except « View previous topic :: View next topic » 
Author Message
Roothless
PostPosted: Mon Jun 25, 2007 12:13 am    Post subject: Calling Java Class from Compute Node: Class not found except Reply with quote

Apprentice

Joined: 11 Dec 2006
Posts: 26

Hi, i am trying to call Java method from Compute Node.I have done the following steps in this case.

My Java Class as follows:

import java.io.*;


public class TestJavaClass
{

public static String getNodeName()
{
return "MyUserDefinedNode";
}
}


I as using the following ESQL in Compute node:

CREATE PROCEDURE myProc()RETURNS CHARACTER LANGUAGE JAVA EXTERNAL NAME "TestJavaClass.getNodeName()";

SET Environment.Variables.Name = myProc();


I created Jar file from the class file and placed on the path

C:\Documents and Settings\All Users\Application Data\IBM\MQSI\shared-classes

restarted the broker, started the Toolkit with -clean option, But i am getting the Class not found exception. Is there anyway out here?

Please help me.

Thanks in Advance
_________________
MQ Toddler
Back to top
View user's profile Send private message
marcin.kasinski
PostPosted: Mon Jun 25, 2007 3:59 am    Post subject: Re: Calling Java Class from Compute Node: Class not found ex Reply with quote

Sentinel

Joined: 21 Dec 2004
Posts: 850
Location: Poland / Warsaw

HI, I see here one error.

Try this ( without '()' ):

Code:
CREATE PROCEDURE myProc()RETURNS CHARACTER LANGUAGE JAVA EXTERNAL NAME "TestJavaClass.getNodeName";


PS. Why don't you add this jar directly to bar ?
You don't have to put jar in shared-classes dir.
_________________
Marcin
Back to top
View user's profile Send private message Visit poster's website
Roothless
PostPosted: Mon Jun 25, 2007 4:24 am    Post subject: Reply with quote

Apprentice

Joined: 11 Dec 2006
Posts: 26

Hi, I tried both the options i.e adding the JAR file to the Bar file and placing the JAR file in shared class directory. But no use of that. Am i missing anything else here.
_________________
MQ Toddler
Back to top
View user's profile Send private message
marcin.kasinski
PostPosted: Mon Jun 25, 2007 4:34 am    Post subject: Reply with quote

Sentinel

Joined: 21 Dec 2004
Posts: 850
Location: Poland / Warsaw

Roothless wrote:
Hi, I tried both the options i.e adding the JAR file to the Bar file and placing the JAR file in shared class directory. But no use of that. Am i missing anything else here.


Show entire error message.
_________________
Marcin
Back to top
View user's profile Send private message Visit poster's website
vgollakota
PostPosted: Mon Jun 25, 2007 4:54 am    Post subject: Re: Calling Java Class from Compute Node: Class not found ex Reply with quote

Apprentice

Joined: 19 Feb 2007
Posts: 37

Roothless wrote:
Hi, i am trying to call Java method from Compute Node.I have done the following steps in this case.

My Java Class as follows:

import java.io.*;


public class TestJavaClass
{

public static String getNodeName()
{
return "MyUserDefinedNode";
}
}


I as using the following ESQL in Compute node:

CREATE PROCEDURE myProc()RETURNS CHARACTER LANGUAGE JAVA EXTERNAL NAME "TestJavaClass.getNodeName()";

SET Environment.Variables.Name = myProc();


I created Jar file from the class file and placed on the path

C:\Documents and Settings\All Users\Application Data\IBM\MQSI\shared-classes

restarted the broker, started the Toolkit with -clean option, But i am getting the Class not found exception. Is there anyway out here?

Please help me.

Thanks in Advance



Hai Roothless,

Did you include this jar file into your java buildpath..???
And after that if you still have an exception , try out with this debug option ,
here are the two commands..!

mqsichangeproperties <Broker Name> -e <Execution Group Name>
-o ComIbmJVMManager -n jvmDebugPort -v <Port Number>

give the port number like 11448 or so..!

mqsireload <Broker Name> -e <Execution Group Name>
_________________
G.VANDANA
Back to top
View user's profile Send private message
Roothless
PostPosted: Mon Jun 25, 2007 7:48 pm    Post subject: Reply with quote

Apprentice

Joined: 11 Dec 2006
Posts: 26

Hi Vandana,

Where is java Build path and How to add my jar file to Java Build path. I really dont know please explain me in detail.

Thanks
_________________
MQ Toddler
Back to top
View user's profile Send private message
JohnMichael
PostPosted: Tue Jun 26, 2007 1:03 am    Post subject: Reply with quote

Acolyte

Joined: 28 Feb 2007
Posts: 55

Hai Roothless,

When you create a java class file for your Java Compute Node , I think you know that a java project would be created and the the java source would be in that project. If you right click on that project where your java class is present, go properties...

Suppose your java file is Hello.java and in the Project HelloProject

Now Right Click on HelloProject ,go to properties ...There you would find java buildpath.select this and then select the 'libraries' tab. There u would have an option Add External JARs, you add the supporting jar file then say 'OK'.

As you have already said that you have placed the jar file in sharedclasses ,even for runtime its should not be a problem now.

I wish you got it. If any clarifications... respond me again...
Back to top
View user's profile Send private message
mrgate
PostPosted: Tue Jun 26, 2007 1:29 am    Post subject: Re: Calling Java Class from Compute Node: Class not found ex Reply with quote

Centurion

Joined: 28 Feb 2007
Posts: 141
Location: India

vgollakota wrote:
Roothless wrote:
Hi, i am trying to call Java method from Compute Node.I have done the following steps in this case.

My Java Class as follows:

import java.io.*;


public class TestJavaClass
{

public static String getNodeName()
{
return "MyUserDefinedNode";
}
}


I as using the following ESQL in Compute node:

CREATE PROCEDURE myProc()RETURNS CHARACTER LANGUAGE JAVA EXTERNAL NAME "TestJavaClass.getNodeName()";

SET Environment.Variables.Name = myProc();


I created Jar file from the class file and placed on the path

C:\Documents and Settings\All Users\Application Data\IBM\MQSI\shared-classes

restarted the broker, started the Toolkit with -clean option, But i am getting the Class not found exception. Is there anyway out here?

Please help me.

Thanks in Advance



Hai Roothless,

Did you include this jar file into your java buildpath..???
And after that if you still have an exception , try out with this debug option ,
here are the two commands..!

mqsichangeproperties <Broker Name> -e <Execution Group Name>
-o ComIbmJVMManager -n jvmDebugPort -v <Port Number>

give the port number like 11448 or so..!

mqsireload <Broker Name> -e <Execution Group Name>


Hi vandana,
I too have worked on the same task where Roothless have worked and have included the jar file in java build path but still I am getting exception during run time saying that "The java method could not be found" can you help me in solving this.
Back to top
View user's profile Send private message
marcin.kasinski
PostPosted: Tue Jun 26, 2007 1:32 am    Post subject: Re: Calling Java Class from Compute Node: Class not found ex Reply with quote

Sentinel

Joined: 21 Dec 2004
Posts: 850
Location: Poland / Warsaw

rock wrote:


Hi vandana,
I too have worked on the same task where Roothless have worked and have included the jar file in java build path but still I am getting exception during run time saying that "The java method could not be found" can you help me in solving this.


Could you open new thread or update existing one and show ESQL code and entire error message.
_________________
Marcin
Back to top
View user's profile Send private message Visit poster's website
WBI_User21
PostPosted: Tue Jun 26, 2007 1:39 am    Post subject: Reply with quote

Voyager

Joined: 12 Jun 2007
Posts: 98

Try changing Procedure to function...
not sure Broker can map esql proc with return type to java routine..
Back to top
View user's profile Send private message
mrgate
PostPosted: Tue Jun 26, 2007 2:26 am    Post subject: Reply with quote

Centurion

Joined: 28 Feb 2007
Posts: 141
Location: India

Hey guys,
All the replies except marcin.kasinski are of no use. what marcin.kasinski said in his first reply is correct, whenever we are calling a java method dynamically in esql we should not include braces in the external name
Back to top
View user's profile Send private message
ingchristianreyes
PostPosted: Fri Aug 21, 2009 2:17 pm    Post subject: Reply with quote

Newbie

Joined: 21 Aug 2009
Posts: 4

Hi all, i have the same trouble in a mapping node, i am trying to use a java static method for load a properties file, this java methos is called from the mapping and return a string.

I am including the jar file into the bar and also I am trying to add the jar to the Classpath system variable, but i still receive a Java Class Not Found.

Does exist some restriction or aditional step for use a Java Class in WMB?

thanks
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Calling Java Class from Compute Node: Class not found except
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.