Question : error problem org.apache.jasper.JasperEx<wbr />ception: /test3.jsp(3,8) The value for the useBean class attribute teska.test2.TestMe is invalid.

Hi,

I've run into the same error I've had before, but it now seems to be caused by something else.

I'm trying to set up tomcat 6 on my server with apache 2.2 running mod_jk.  I'm really new to this, so I'm hoping this makes sense.  Basically I can get my jsp to run, but not access any java classes using jsp.  I'm working with a hosting company and they have things set up in the following way:

I'm running Cent OS 5
Tomcat 6 - installed under /opt/tomcat6/
JRE 6
Apache 2.2 - installed under etc/httpd/
my web pages: /home/webadmin/teska.net/html/

Note: I'm using the alias teska.virtual.vps-host.net to test my site before I change my nameservers to the new server (for teska.net) but everything should work this way.

I know jsp in general is working because the following page works:
http://teska.virtual.vps-host.net/date.jsp (which displays a date page)

However, when I add the following files
 /home/webadmin/teska.net/html/test3.jsp
 /home/webadmin/teska.net/html/WEB-INF/classes/teska/test2/TestMe.java
(note I manually created the WEB-INF directory and all of the directories under it)
and then I go to:
http://teska.virtual.vps-host.net/test3.jsp

I get the following error message:

type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: /test3.jsp(3,8) The value for the useBean class attribute teska.test2.TestMe is invalid.
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:148)
org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1200)
org.apache.jasper.compiler.Node$UseBean.accept(Node.java:1160)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2343)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2393)
org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2399)
org.apache.jasper.compiler.Node$Root.accept(Node.java:489)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2343)
org.apache.jasper.compiler.Generator.generate(Generator.java:3372)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:198)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:314)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:294)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:281)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.16 logs.

The strange part is, I have no problem running this exact same code on 2 different servers - my local machine is running tomcat 6 w/ jre 6 w/o apache and I have no problems.  The code also runs fine on Resin 3 and Jre 5, so it seems there is something wrong with the config on this server, but I can't begin to figure out what.

The content of my server.xml file is also attached below.

I've also added the following mod_jk directives to my httpd.conf for the virtual host:

JkMount /*.jsp ajp13
JkMount /*.java ajp13
JkMount /*.class ajp13
JkMount /*.do ajp13

Thanks in advance,
Courtenay
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
187:
188:
189:
190:
191:
192:
193:
194:
195:
196:
197:
198:
199:
200:
201:
202:
203:
204:
205:
206:
207:
208:
209:
210:
211:
212:
213:
214:
215:
216:
217:
218:
219:
220:
221:
222:
223:
224:
225:
226:
227:
228:
229:
230:
231:
232:
233:
234:
235:
236:
237:
238:
test3.jsp content:        
 

<%
        String test1 = tm.getTest1();    
%>


    
        Test JSP
    
    
       test1 = <%= test1 %>
    

 
 
TesMe.java content:
 
package teska.test2;
/**
* TestMe.java
* Creation date: (4/15/2008)
* @author: Courtenay Teska Race
*/
public class TestMe{
private String test1 = "this is test1";
/**
* TestMe constructor
*/
public TestMe(){
super();
}
public String getTest1(){
return test1;
}
}
 
server.xml data:




 
  
  
  
  
  
  
  
 
  
  
    
    
  
 
  
  
  
    
    
    
    
    
    
    
               
    
    
 
    
    
 
 
    
 
     
    
 
      
              
 
      
      
 
      
      
 
      
      
 
        
        
 
        
        
 
      
      
 
       
      		www.teska.net 
      		teska.virtual.vps-host.net 
      		 
      		 
      
 
 
     
    
  

 
 
Virtual host portion of httpd.conf file:
 

ScriptAlias /mail /var/www/cgi-bin/openwebmail/openwebmail.pl
ScriptAlias /cgi-bin/openwebmail /var/www/cgi-bin/openwebmail
Alias /openwebmail /var/www/html/openwebmail
ScriptAlias /cgi-bin/awstats /var/www/cgi-bin/awstats
Alias /awstats /var/www/html/awstats
ServerName teska.net
DocumentRoot /home/webadmin/teska.net/html
SuexecUserGroup webadmin webadmin
ServerAlias "www.teska.net" "teska.virtual.vps-host.net" "www.teska.virtual.vps-host.net"
ScriptAlias "/cgi-bin/" "/home/webadmin/teska.net/cgi-bin/"
CustomLog "/home/webadmin/teska.net/access_log" "combined"
ErrorLog "/home/webadmin/teska.net/error_log"
JkMount /*.jsp ajp13
JkMount /*.java ajp13
JkMount /*.class ajp13
JkMount /*.do ajp13

SetEnvIf Referer "^https?:\/\/69.89.8.218(\/|$)" prevent_hot_link
SetEnvIf Referer "^https?:\/\/teska.net(\/|$)" prevent_hot_link
SetEnvIf Referer "^https?:\/\/www.teska.net(\/|$)" prevent_hot_link
SetEnvIf Referer "^https?:\/\/teska.virtual.vps-host.net(\/|$)" prevent_hot_link
SetEnvIf Referer "^https?:\/\/www.teska.virtual.vps-host.net(\/|$)" prevent_hot_link
Order allow,deny
Allow from env=prevent_hot_link


Options Includes FollowSymLinks
AllowOverride All


Answer : error problem org.apache.jasper.JasperEx<wbr />ception: /test3.jsp(3,8) The value for the useBean class attribute teska.test2.TestMe is invalid.

>>  /home/webadmin/teska.net/html/WEB-INF/classes/teska/test2/TestMe.java

Just got doubt.. have you kept .class file.. in the above path
Random Solutions  
 
programming4us programming4us