Link to home
Start Free TrialLog in
Avatar of dkim18
dkim18

asked on

Web app in eclipse VS weblogic server - NoSuchMethodError issue

Hi,

This program used to work fine in eclipse, but having this error in weblogic server. I read some articles about change setting in weblogic server. Is there any way that I can fix this without changing setting?


Error 500--Internal Server Error

java.lang.NoSuchMethodError: StudentInfo.setUserId(Ljava/lang/String;)V
      at RegistrationServlet.doGet(RegistrationServlet.java:94)
      at RegistrationServlet.doPost(RegistrationServlet.java:208)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:971)


BTW, StudentInfo is just simple java bean.

thanks in advance.
ASKER CERTIFIED SOLUTION
Avatar of bpmurray
bpmurray
Flag of Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dkim18
dkim18

ASKER

No, it is under WEB-INF/classes/ dir. There is no pkg. All java and class files are under this dir.
SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dkim18

ASKER

it DOES have that method. I tried again, but didn't work. This is very weird...
the class it is loading does *not*, did you try recompiling and deploy.
What about the case of the method name and its visibility. Maybe it's called "SetUserId"? Is it public?
Avatar of dkim18

ASKER

I used elipse's func that generates setter and getter automatically.
+++++++++++++++++
public class StudentInfo  {
   
    private String userId;
    private String passWord1;
...
...
...
 /**
     * @param userId The userId to set.
     */
    public void setUserId(String userId) {
        this.userId = userId;
    }
+++++++++++++++++++
and I am calling like this.

++++++++++++
public class RegistrationServlet extends HttpServlet {
    private Connection conn;
   ...
    private HttpSession session = null;
   
  ...
    private  StudentInfo studentInfo=null;
   
    public void init() throws ServletException{
          studentInfo=new StudentInfo();
       
                       
    }
Avatar of dkim18

ASKER

I compiled this from eclipse and moved to weblogic. But I deleted existing app dir and copied&pasted again. I even checked the changes in the java file from weblogic.
You don't show how you're calling setUserId - are you passing a String as the parameter?
Avatar of dkim18

ASKER

protected void doGet(HttpServletRequest request,
            HttpServletResponse response)
            throws ServletException, java.io.IOException {
...
...
userId = (String)request.getParameter("userId");
studentInfo.setUserId(userId);    
...
Is it possible you have an older version of the class on your CLASSPATH?
>>"But I deleted existing app dir and copied&pasted again"
Have you restarted your WLS?

David
Avatar of dkim18

ASKER

Have you restarted your WLS?
>>of course...
>>"But I deleted existing app dir and copied&pasted again"
Btw, where do you copy and paste in your folder? Did you copy and paste it in your Bea's WLS folder?

David
Avatar of dkim18

ASKER

Btw, where do you copy and paste in your folder? Did you copy and paste it in your Bea's WLS folder?
>>C:\bea81\weblogic81\server\bin
Ok,

I am not very sure on WebLogic's structure but let me try to find out. So do all your JSP and etc reside in this folder?

David
Avatar of dkim18

ASKER

yes. when i tested it, it ran ok.(btw, i used wls admin console to deploy it.) but i am having error on that line.
do you deploy it as EAR file? If you open the EAR file (use WinRAR or etc), is the class file updated? You can check on the date created

David
Avatar of dkim18

ASKER

do you deploy it as EAR file? If you open the EAR file (use WinRAR or etc), is the class file updated? You can check on the date created
>> no, i didn't use any of them. i just copied entire app in that dir and used wls admin console to deploy it.
Give me a sec...let me have think over it

David
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
if the class conttains that method then wl isn't loading that class, o/wise u wouldn't be getting that error
Yes, I think it's a different StudentInfo class. Have you tried deploying this app before?
Avatar of dkim18

ASKER

first of all, there is no other StudentInfo class and this is the first web app that I am trying to deploy since I installed WLS.
Well, the problem for all of us here is that the error message means that it has found the class StudentInfo, but that class does not have a setUserId(x) method. This has us all mightily confused, especially since you assert that there is only one StudentInfo class, and that class has got this method with this signature.
delete the class file you deployed and try to run it.
It is possible that you have a forgotter EAR somewhere. When you deploy an application wls creates an ear file. I suggest you create a (completely) new domain and try to redeploy your application there.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dkim18

ASKER

I finally found the problem. I set StudentInfo in the classpath for some other purpose. When I deleted that it fixed the problem. thanks all