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 » Problem to call Java class from WBIMB

Post new topic  Reply to topic
 Problem to call Java class from WBIMB « View previous topic :: View next topic » 
Author Message
bisu
PostPosted: Sun Jul 31, 2005 10:56 pm    Post subject: Problem to call Java class from WBIMB Reply with quote

Apprentice

Joined: 05 Jan 2005
Posts: 25
Location: India

Hi,
I have a problem to call a Java class from WBIMB ESQL. I have written a Java class like this

public class Name
{

public Name()
{
}

public static String retVal()
{
return new String("ABC");
}
}


prepared a jar file with the command like this
"jar cvf MyJar.jar Name.class"

Put the jar in the dierectory "C:\Program Files\IBM\WebSphere Business Integration Message Brokers\classes". Stopped the Broker, Config manager and then restarted the Broker and config manager. Then written the follwing ESQL

DECLARE VAL CHARCATER;
SET VAL = getVal();

and defined the getVal like

CREATE PROCEDURE getVal()
RETURNS CHARACTER
LANGUAGE JAVA
EXTERNAL NAME "Name.retVal";

But when I am going to deploy the bar file, getting the failure message

BIP2946E: The Java method 'Name.retval' could not be found

The Java method 'Name.retval' with the specified signature could not be found in the specified class. Ensure the method exists in the specified class and that it exactly matches its ESQL signature.

Examine and correct the SQL program.


I am working on Version: 5.0.5, Platform WINDOWS 2000, SP-4. Have any idea what is the problem with it?
Thanks in advance
Back to top
View user's profile Send private message Yahoo Messenger
recallsunny
PostPosted: Mon Aug 01, 2005 6:16 am    Post subject: Reply with quote

Disciple

Joined: 15 Jun 2005
Posts: 163
Location: Massachusetts

Quote:
For every broker to which the Java routine is deployed, you must:
Add the required directory to the system CLASSPATH as detailed above, and reboot any Windows machines.

Read through the documentation for "Create Procedure" topic.

Basics: If its Java, its CLASSPATH....
Back to top
View user's profile Send private message
bisu
PostPosted: Mon Aug 01, 2005 6:54 am    Post subject: RE: Problem to call Java class from WBIMB Reply with quote

Apprentice

Joined: 05 Jan 2005
Posts: 25
Location: India

Hi
I have tried tah also. But it didn't work. Anyway thanks for your reply.


recallsunny wrote:
Quote:
For every broker to which the Java routine is deployed, you must:
Add the required directory to the system CLASSPATH as detailed above, and reboot any Windows machines.

Read through the documentation for "Create Procedure" topic.

Basics: If its Java, its CLASSPATH....
Back to top
View user's profile Send private message Yahoo Messenger
recallsunny
PostPosted: Mon Aug 01, 2005 8:03 am    Post subject: Re: RE: Problem to call Java class from WBIMB Reply with quote

Disciple

Joined: 15 Jun 2005
Posts: 163
Location: Massachusetts

bisu wrote:
Hi
I have tried tah also. But it didn't work. Anyway thanks for your reply.


What did you add to the CLASSPATH, the folder Location or the JAR file itself? You should be adding the file name too.
Code:

C:\Program Files\IBM\WebSphere Business Integration Message Brokers\classes\MyJar.jar
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Mon Aug 01, 2005 8:07 am    Post subject: Re: RE: Problem to call Java class from WBIMB Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

recallsunny wrote:
Code:

C:\Program Files\IBM\WebSphere Business Integration Message Brokers\classes\MyJar.jar

But really, you should use short paths in CLASSPATH always.

Code:
c:\Progra~1\IBM\WebSph~1\classes\MyJar.jar

It might not be WebSph~1, dir /x c:\Progra~1\IBM\ will show you what it should be.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
recallsunny
PostPosted: Mon Aug 01, 2005 9:09 am    Post subject: Re: RE: Problem to call Java class from WBIMB Reply with quote

Disciple

Joined: 15 Jun 2005
Posts: 163
Location: Massachusetts

jefflowrey wrote:

But really, you should use short paths in CLASSPATH always.

I would define a New "System Variable" if using in Windows:
Code:
 MB_CLP_HOME = c:\Progra~1\IBM\WebSph~1\classes\

Then use it in the CLASSPATH
Code:
 %CLASSPATH% ; %MB_CLP_HOME%\MyJar.jar;

Back to top
View user's profile Send private message
jefflowrey
PostPosted: Mon Aug 01, 2005 9:49 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Using a system variable won't get around the problems caused by having spaces in the path.

But yes, this is a good practice.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
bisu
PostPosted: Mon Aug 01, 2005 8:55 pm    Post subject: Re: RE: Problem to call Java class from WBIMB Reply with quote

Apprentice

Joined: 05 Jan 2005
Posts: 25
Location: India

recallsunny wrote:
jefflowrey wrote:

But really, you should use short paths in CLASSPATH always.

I would define a New "System Variable" if using in Windows:
Code:
 MB_CLP_HOME = c:\Progra~1\IBM\WebSph~1\classes\

Then use it in the CLASSPATH
Code:
 %CLASSPATH% ; %MB_CLP_HOME%\MyJar.jar;



Thanks to all of u for such a great response. But I have tried all the options u specified. None of them worked. Anyway please inform me if u find something new. I will also inform if I get the sollution.
Back to top
View user's profile Send private message Yahoo Messenger
kshah
PostPosted: Mon Aug 01, 2005 9:54 pm    Post subject: Reply with quote

Novice

Joined: 13 Jun 2005
Posts: 23

Try placing ur jar file in /jplugin directory...

restart the broker..
This is the safest way...

we have tried this..n working absolutely fine with us..i hope..this works fine with u.
Back to top
View user's profile Send private message
bisu
PostPosted: Tue Aug 02, 2005 2:22 am    Post subject: Re: RE: Problem to call Java class from WBIMB Reply with quote

Apprentice

Joined: 05 Jan 2005
Posts: 25
Location: India

Hi,
Now my flow is working properly. I just made the changes in the CLASSPATH. Instead of setting the classpath as "C:\Program Files\IBM\WebSphere Business Integration Message Brokers\classes", now I am setting it as "C:\PROGRA~1\IBM\WebSph~1\classes\MyJar.jar". Also the jar can be placed in any directory. Only the CLASSPATH will have to be reflected accordingly. Thanks friends for your response. Hope will get back to u with some other problem.
Back to top
View user's profile Send private message Yahoo Messenger
recallsunny
PostPosted: Tue Aug 02, 2005 2:06 pm    Post subject: Re: RE: Problem to call Java class from WBIMB Reply with quote

Disciple

Joined: 15 Jun 2005
Posts: 163
Location: Massachusetts

bisu wrote:
Hi,
Now my flow is working properly. I just made the changes in the CLASSPATH. Instead of setting the classpath as "C:\Program Files\IBM\WebSphere Business Integration Message Brokers\classes", now I am setting it as "C:\PROGRA~1\IBM\WebSph~1\classes\MyJar.jar". Also the jar can be placed in any directory. Only the CLASSPATH will have to be reflected accordingly. Thanks friends for your response. Hope will get back to u with some other problem.


Isn;t that what we suggested a while ago?
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 » Problem to call Java class from WBIMB
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.