Author |
Message
|
bisu |
Posted: Sun Jul 31, 2005 10:56 pm Post subject: Problem to call Java class from WBIMB |
|
|
 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 |
|
 |
recallsunny |
Posted: Mon Aug 01, 2005 6:16 am Post subject: |
|
|
 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 |
|
 |
bisu |
Posted: Mon Aug 01, 2005 6:54 am Post subject: RE: Problem to call Java class from WBIMB |
|
|
 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 |
|
 |
recallsunny |
Posted: Mon Aug 01, 2005 8:03 am Post subject: Re: RE: Problem to call Java class from WBIMB |
|
|
 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 |
|
 |
jefflowrey |
Posted: Mon Aug 01, 2005 8:07 am Post subject: Re: RE: Problem to call Java class from WBIMB |
|
|
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 |
|
 |
recallsunny |
Posted: Mon Aug 01, 2005 9:09 am Post subject: Re: RE: Problem to call Java class from WBIMB |
|
|
 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 |
|
 |
jefflowrey |
Posted: Mon Aug 01, 2005 9:49 am Post subject: |
|
|
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 |
|
 |
bisu |
Posted: Mon Aug 01, 2005 8:55 pm Post subject: Re: RE: Problem to call Java class from WBIMB |
|
|
 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 |
|
 |
kshah |
Posted: Mon Aug 01, 2005 9:54 pm Post subject: |
|
|
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 |
|
 |
bisu |
Posted: Tue Aug 02, 2005 2:22 am Post subject: Re: RE: Problem to call Java class from WBIMB |
|
|
 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 |
|
 |
recallsunny |
Posted: Tue Aug 02, 2005 2:06 pm Post subject: Re: RE: Problem to call Java class from WBIMB |
|
|
 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 |
|
 |
|