jsp/beans files invoking problem in JWS2.0
My jsp files are invoked when I open them in the browserusing both jswdk and JWS. But the links or Submit buttons of the files don't work in JWS only, displaying an error -
Error during JSP page processing
java.lang.NoSuchMethodError: java.lang.System: method setProperty(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; not found
at
at IDRClient.Functions.(Functions.java:63)
at java.beans.Beans.instantiate(Beans.java:120)
at pagecompile.jsp._registrars._add._add._jspService(_add.java:95)
at com.sun.server.http.pagecompile.jsp.runtime.HttpJspBase.service(HttpJspBase.java:87)
at javax.servlet.http.HttpServlet.service(Compiled Code)
at com.sun.server.http.pagecompile.jsp.runtime.JspServlet.runServlet(JspServlet.java:469)
at com.sun.server.http.pagecompile.jsp.runtime.JspServlet.processJspPage(JspServlet.java:259)
at com.sun.server.http.pagecompile.jsp.runtime.JspServlet.service(JspServlet.java:97)
at javax.servlet.http.HttpServlet.service(Compiled Code)
at com.sun.server.ServletState.callService(ServletState.java:226)
at com.sun.server.ServletManager.callServletService(ServletManager.java:936)
at com.sun.server.ProcessingState.invokeTargetServlet(ProcessingState.java:423)
at com.sun.server.http.HttpProcessingState.execute(HttpProcessingState.java:79)
at com.sun.server.http.stages.Runner.process(Runner.java:79)
at com.sun.server.ProcessingSupport.process(Compiled Code)
at com.sun.server.Service.process(Service.java:204)
at com.sun.server.http.HttpServiceHandler.handleRequest(HttpServiceHandler.java:374)
at com.sun.server.http.HttpServiceHandler.handleRequest(Compiled Code)
at com.sun.server.HandlerThread.run(Compiled Code)
The methos setProperty exists in the mentioned files, so I can't figure out what the problem is. The set Property method contains -
System.setProperty("java.protocol.handler.pkgs",
"com.sun.net.ssl.internal.www.protocol");
Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
The same links work perfectly in jswdk server, but not in JWS2.0!!! I tried to modify the java.security file also, but then the JWS server couldn't start. Please help!
[2313 byte] By [
Abhi325] at [2007-9-26 2:37:35]

Anyone? Please help me out!
check the bean method. It must be declared as public and the variables you are accessing from outside, those must be declared as public. Now check it.
[abhi325],
Can you post the version of the JSP API that you have for your code?
JWS 2.0 supports only the earliest version of JSP i.e. JSP 1.0 and also fyi, Servlet 2.1.1.
Also, the default JDK bundled with JWS 2.0 is JDK v1.1.7 which might the source of the problem.
May I suggest that you point the JWS 2.0 to use an alternate JVM e.g. JDK 1.2.x?
There is a good document that can help you diagnose this problem that you are having with JWS 2.0:
http://access1.sun.com/SRDs/access1_srds.html
Please post your questions here so that we might be able to help you further.
Allen Lai
SUN Developer Technical Support
I've already checked the methods and variables..they're all public.
I have version 1.0 for the jsp api that I'm using, and jdk1.2.2. Now I've started getting another problem-whenever I strat the JWS I get an error -
javawebserver Java Web Server ERROR: Cannot start Secure Service: no keys file
WHat does this mean and how do I rectify it?
What I see from ur error message is u have not set ur classpath to handle JSP requests.
Soln 1 :
U have to include all jar files in the jws2.0\lib in ur classpath
Soln 2 :
Deinstall and Reinstall JWS 2.0 so as to have a proper effect.
If possible go to Admin option and in ur site, change settiings of ur public_html to servlets.
Copy all ur jsp's to a new folder created in jws2.0\servlets\newfolder
Try running the new jsp files.
If possible send me ur classpath and path settings, there might be some problem there.
Seetesh
seeteshh@silverline.com
I tried everything stated in your answer, but the same problem persists. I've sent you a mail showing the classpath and path I use. Thanks a lot!
[Abhi32],
Your machine have started the https secure services within JWS 2.0 without a keys file. (authstore). Check the JWS 2.0 javadocs for configuring the https services with JWS 2.0.
The https Secure Web Services for JWS 2.0 must have started automatically.
If you want to rectify this situation without rebooting your Unix machine, do this:
(1) Stop the JWS 2.0 services
(2) Use the ps command to check for any JDK java processes for the JWS 2.0 web server that might still be left running.
(3) Kill all the associated java processes with JWS 2.0
(4) Restart JWS 2.0 and see if the error messages appears again.
Please do not hesistate to post more questions if you any, we are here to help you.
Allen Lai
SUN Developer Technical Support
Thanks allenlai, I managed to do the needful for the authstore keys, but my original problem still persists!
[Abhi325],
Help us understand your need to do a System.setProperty() in these lines:
System.setProperty("java.protocol.handler.pkgs","com.sun.net.ssl.internal.www.protocol");
Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
If you are looking to set security permissions for JWS 2.0, take a look at this file within the JWS 2.0 directory:
$<your JWS 2.0 root directory>/security/jserv.policy
Allen Lai
SUn Developer Technical Support
Allenlai,
I'd downloaded these codes, and all I had to do was implement them. They're all working fine in jswdk, but as I said, not in jws. I tried modifying the java.security file, but then the jws server gave me an error and shut down. If you can give me your email address I can write you details about this problem. My address is jhunjhunwala@netlinkis.com
[Abhi325],
Okay, it now looks like [Seetesh] may be correct, there is some problems with the classpath settings for JWS 2.0 that is causing this issue from the very fact that the error is pointing to a 'no such method found' error.
Post the contents of this file found in your machine:
/etc/rc3.d/S42jserv
/etc/rc3.d/K42jserv
These are the startup scripts to JWS 2.0 and there are classpath settings in it.
Allen Lai
Developer Technical Support
SUN Microsystems
http://www.sun.com/developer/support/
hi allenlai,
My problem regarding setProperty is solved. The JRE 1.1.7 didn't support this method, so when I switched to 1.2 it worked fine. BUT, I have another problem now! I get an error -
Error during JSP page processing
javax.servlet.ServletException: Cannot create bean of class IDRClient.Functions
at pagecompile.jsp._examples._jsp._samples._add._add._jspService(_add.java:97)
at com.sun.server.http.pagecompile.jsp.runtime.HttpJspBase.service(HttpJspBase.java:87)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:840)
at com.sun.server.http.pagecompile.jsp.runtime.JspServlet.runServlet(JspServlet.java:469)
at com.sun.server.http.pagecompile.jsp.runtime.JspServlet.processJspPage(JspServlet.java:259)
at com.sun.server.http.pagecompile.jsp.runtime.JspServlet.service(JspServlet.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:840)
at com.sun.server.ServletState.callService(ServletState.java:226)
at com.sun.server.ServletManager.callServletService(ServletManager.java:936)
at com.sun.server.ProcessingState.invokeTargetServlet(ProcessingState.java:423)
at com.sun.server.http.HttpProcessingState.execute(HttpProcessingState.java:79)
at com.sun.server.http.stages.Runner.process(Runner.java:79)
at com.sun.server.ProcessingSupport.process(ProcessingSupport.java:294)
at com.sun.server.Service.process(Service.java:204)
at com.sun.server.http.HttpServiceHandler.handleRequest(HttpServiceHandler.java:374)
at com.sun.server.http.HttpServiceHandler.handleRequest(HttpServiceHandler.java:166)
at com.sun.server.HandlerThread.run(HandlerThread.java:162)
This has something to do with classloader and beans.instantiate, because this error occurs in the line ( I saw this in the tmpdir directory of JWS) -
try {
Search = (IDRClient.Functions) Beans.instantiate(getClassLoader(), "IDRClient.Functions");
} catch (Exception exc) {
throw new ServletException (" Cannot create bean of class "+"IDRClient.Functions");
}
Any clues?
