| Author |
WSAD and EJB problem
|
Shreya Menon
Ranch Hand
Joined: Jul 31, 2001
Posts: 285
|
|
Hi all, I created a sample session ejb and am trying to call an outside Java class from ejb. I tried accessing an outside java class from servlet and it works. Now my java file is like this public class MyTest{ static String to = "Test"; } In my session ejb, I wrote a method to access this class and get the value of this String. public String getValue() throws java.rmi.RemoteException { MyTest test = new MyTest(); String xyz = null; xyz = MyTest.to; return xyz; } Now this is the error that I am getting when I run the EJB in websphere test environment ----------------------------------------------------------------------------- java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: com.ibm.ejs.container.UncheckedException: ; nested exception is: java.lang.IllegalAccessError: try to access field com/test/MyTest.to from class com/test/HelloWorldSesionBean com.ibm.ejs.container.UncheckedException: ; nested exception is: java.lang.IllegalAccessError: try to access field com/test/MyTest.to from class com/test/HelloWorldSesionBean ------------------------------------------------------------------------------- Any help is appreciated.. Thanks
|
 |
Kyle Brown
author
Ranch Hand
Joined: Aug 10, 2001
Posts: 3879
|
|
Make the field public. Kyle
|
Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at http://www.kyle-brown.com/ for other WebSphere information.
|
 |
 |
|
|
subject: WSAD and EJB problem
|
|
|