Unable to load Applet in JSP using Tomcat 5.5.12
Hi
I am aunable to applet in jsp using Tomcat 5.5.12 and JRE 1.5. Below is the code that I am using
<applet
codebase = "."
archive = "WebPOSApplet.jar"
code = "webposprint.WPMainApplet.class"
name = "Trans Applet"
width = "450"
height = "115"
hspace = "0"
vspace = "0"
align = "middle"
>
<param name = "redirectInfo" value = "SearchProducts.do">
</applet>
<%/*%>
<OBJECT
classid = "clsid:CAFEEFAC-0014-0002-0000-ABCDEFFEDCBA"
codebase = "http://java.sun.com/products/plugin/autodl/jinstall-1_4_2-windows-i586.cab#Version=1,4,2,0"
WIDTH = 450 HEIGHT = 115 >
<PARAM NAME = CODE VALUE = webposprint.WPMainApplet.class>
<PARAM NAME = archive VALUE = WebPOSApplet.jar>
<PARAM NAME = "type" VALUE = "application/x-java-applet;jpi-version=1.4.2">
<param name = "redirectInfo" value = "SearchProducts.do">
<PARAM NAME = "scriptable" VALUE = "false">
<PARAM NAME = model VALUE=models/buckminsterfullerine.xyz>
<embed width="450" height="115" code="webposprint.WPMainApplet.class" archive="WebPOSApplet.jar" type="application/x-java-applet;jpi-version=1.4.2" redirectinfo="SearchProducts.do" scriptable="false" model="models/buckminsterfullerine.xyz" src="webposprint.WPMainApplet.class">
</embed> <COMMENT> <EMBED
type = "application/x-java-applet;jpi-version=1.4.2" \
CODE = webposprint.WPMainApplet.class\
archive = WebPOSApplet.jar\
WIDTH = 373 \
HEIGHT = 167 \
model =models/buckminsterfullerine.xyz \
scriptable = false \
pluginspage = "http://java.sun.com/products/plugin/index.html#download"> <NOEMBED>
alt="Your browser understands the <APPLET>
tag but isn't running the applet, for some reason."
Your browser is completely ignoring the <APPLET>
tag! </NOEMBED> </EMBED> </COMMENT>
</OBJECT>
<%*/%>
This code doesn't seems working with Tomcat 5.5.12. I works fine with Tomcat 4.1.31
Please help
Thanks
Applets run client side - which means the relevant class files need to be downloaded to the client.
Anything under the WEB-INF directory is not directly accessible by the client. Nothing under WEB-INF can be downloaded.
ergo, specifying the WEB-INF directory as part of your applet codebase is a bad idea.
I would suggest try copying the applet classes from under WEB-INF to some other place in your application.
Also, you should probably specify the full class name of your Applet in the plugin tag.
<%@ page import="com.util.MyApplet" %>
<jsp:plugin type="applet" code="com.util.MyApplet" codebase="/classes" width="250" height="100" jreversion="1.6">
<jsp:fallback>
<B>Unable to start plugin!</B>
</jsp:fallback>
</jsp:plugin>cheers,
evnafets
Similar Messages
-
Importing class in a jsp using Tomcat
Hello All,
Using Tomcat:
I have class here:
examples/WEB-INF/classes/ package/myclass.class
I have a .jsp here:
examples/JSPFolder/myjspfile.jsp
I want to import the class into the jsp.
I have tried the following combinations of importy lines based on previous posts on these boards and each have failed with same error:
Unable to load class for JSP
<%@ page import="myclass" %>
<%@ page import="myclass.*" %>
<%@ page import="package.myclass" %>
<%@ page import="package.myclass.*" %>
<%@ page import="WEB-INF/classes/package/myclass%>
I have seen a number of posts for this same problem, and have tried those solutions as well, but none work. I am sure that this is simply a problem of finding the right directory, as I can successfully run the .jsp file iwhen I remove the import line.
Can someone please help?There is a folder for shared packages
tomcat_root\lib; or
tomcat_root\common
also most versions have a lib or common folder for each webapp for packages that are not to be shared.
tomcat_root\webapps\appname\web-inf\lib
Agreed that it is strange to allow servlets to import from the classes foler but not JSPs. It should make no difference but it is convension to place single classes in the same folder as the app's directory and packages (especially jar's) in the lib directory. -
Displaying Applet in JSP Using jsp:plugin tag
The following code is not working eventhough i downloaded to JRE plug-in .Please help me to work the
following code in JSP.
<jsp:plugin code="mani.Clock2.class"
codebase="/classes/" width=300 height=300
jreversion="1.3"
nspluginurl="http://java.sun.com/products/plugin/1.1.3/plugin-install.html"
iepluginurl="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,0,0">
<jsp:fallback>
<font color=#FF0000 size=10>Sorry Error While Loading Applet </font>
</jsp:fallback>
</jsp:plugin>why don't ypu just use the <applet> tag?
-
Error BEA-000438 - Unable to load performance pack. Using Java I/O instead.
On a Solaris 9 machime, 64 bits architecture, j2sdk1.4.2_08, Weblogic Server 8.1 SP2
when I try to deploy the application, launching java wiht "-d64" option I get :
<Jun 22, 2005 12:12:41 PM CEST> <Error> <Socket> <BEA-000438> <Unable to load performance pack. Using Java I/O instead.
Please ensure that libmuxer library is in
:'/export/home/j2se/j2sdk1.4.2_08/jre/lib/sparcv9/server:/export/home/j2se/j2sdk1.4.2_08/jre/lib/sparcv9:/export/home/Aplics/Apl1/WEB-INF/lib::/usr/local/bea/weblogic81/server/lib/solaris:/usr/local/bea/weblogic81/server/lib/solaris/oci920_8:/usr/lib'
libmuxer exist on /usr/local/bea/weblogic81/server/lib/solaris
Any idea?
ThanksCan you post more details ?
Sergi
Jiffy <[email protected]> wrote:
>error:
> <2004-3-12 %u4E0B%u534815%u65F648%u520654%u79D2 CST> <Error> <Socket>
><BEA-000438> <Unable to load performance pack. Using Java I/O instead.
>Please ensure that wlntio.dll is in: 'D:D:/bea/weblogic81/server/bin'
>>
-
Hi there.
I am running WL 1033 development version using 64-bit 1.6.1 jdk (jdk-6u21-windows-x64) and the performance is terrible. I have upped my mem settings to this:
set MEM_ARGS=-Xms1024m -Xmx1408m -XX:PermSize=1024m -XX:MaxPermSize=1024m
and after a couple of deploys, I still get out of memory errors.
I notice this message on startup: <BEA-000438> <Unable to load performance pack. Using Java I/O instead. Please ensure that wlntio.dll is in:
Could this be part of my performace issues? If so, how do I fix it?
I followed the install directions in the README.txt file from this zip file: wls1033_dev.zip
MikeHi Mike,
If you are using 64 bit of Windows Operating System then Make sure that you add the following directory in the *"java.library.path"*....
Directory: E:\bea1033\wlserver_10.3\server\native\win\64
Example: In your servers start Script please add the following MEM_ARGS or in JAVA_OPTIONS:
<b><font color=maroon>
set MEM_ARGS= -Xms1024m -Xmx1408m -XX:PermSize=1024m -XX:MaxPermSize=1024m -Djava.library.path=E:\bea1033\wlserver_10.3\server\native\win\64</font></b>
Thanks
Jay SenSharma
http://middlewaremagic.com/weblogic (Middleware Magic Is Here) -
Unable to load/play sound files using SoundEngine_LoadEffect
Hi All,
I am able to load/play sound files using SoundEngine_LoadBackgroundMusicTrack but unable to load/play sound files using SoundEngine_LoadEffect on iPhone Simulator. I am using the SoundEngine.h/cpp from Crash Landing. Oddly enough sound effects load and play succesffully when i start the app with 'Start with Performance Tool'. Does anyone know what is actually going on.
Also i would like to know what is the difference between playing sound files using these two methods. What are the restrictions on individual sound file types for each method.
ThanksI was able to load/run the sound effects after using Simulator - iPhoneOS 2.1 in the Active Target/Build drop down on Xcode toolbar. Both Active SDK, and Active Executable should be 2.1 in order to play the sound effects.
-
Unable to load file ..jsp
Hi
When Iam forwarding a jsp page to other jsp page after
some condition meets using jsp forward than some times
when i access it it gives
"Unable to load as it is not a top level class"
for file while is forwarded
for example:--
<jsp:forward page="Login.jsp">
<jsp:param name="user" value="<%=user%>"/>
</jsp:forward>
it gives login.jsp not a top level class
unable to load
note :---- all files in one directory
suggestion requiredactually it depends on your JSP engine. I'm not sure but I've a doubt that once you have flushed some response , you may get an error in forwarding ( in some of the jsp engines, but I think in tomcat it's fine).
you could try by using "buffer" property in such a way that no response is flushed before you forward the JSP page. -
Oracle Connectivity in JSP using Tomcat 4
Dear friends,
After installing and configuring the Tomcat 4 I am able to run JSP and Servlats. But I am unable to connect to Oracle database (oracle 8i) using thin driver.
Sample code is :
<html>
<head><title>Test JSP-JDBC</title></head><body>
<%@ page language="java"%>
<%@ page import="java.sql.*"%>
<%@ page import="oracle.jdbc.driver.OracleDriver" %>
<%
try
DriverManager.registerDriver(new OracleDriver());
Connection con = DriverManager.getConnection("jdbc:oracle:thin:@myserver:1521:orcl","scott","tiger");
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("select * from emp");
while(rs.next())
out.println(rs.getString("ename")+"<br>");
catch (Exception e)
out.println(e);
%>
</body></html>
and the error msg is:
type: Exception report
message: Internal Server Error
description: The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.
exception :
org.apache.jasper.JasperException: Unable to compile class for JSP
C:\Program Files\Apache Tomcat 4.0\work\Standalone\localhost\second$jsp.java:4: Class oracle.jdbc.driver.OracleDriver not found in import.
import oracle.jdbc.driver.OracleDriver;
^
1 error
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:285)
at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:548)
Please help me in solving this.
thanks in advance
GeethanadhHi
The oracle driver needs a jar file to be placed into your Runtime Environment. If you are importing oracle. Get the jar file, put it in your JRE/lib/ext folder and also in the jdk/jre/lib/ext folders. Restart your tomcat, and now try to compile the page. Should work.
Thanks
Swaraj -
Unable to compile class for JSP. apache-tomcat-6. What could be wrong?
Hello, I am new to JSP and I am trying a very basic jsp and class file on Windows XP. I get the Unable to compile class for JSP.
Steps that I have done:
javac ch06_01.java , placed the ch06_01.class under
C:\Apps\apache-tomcat-6.0.16\webapps\ch06\WEB-INF\classes
Then grabbed the ch06_02.jsp and placed it under
C:\Apps\apache-tomcat-6.0.16\webapps\ch06\
When I run it (by placing this into Explorer or Firefox URL
http://localhost:8080/ch06/ch06_02.jsp) I get the error further
below. Things I have done and made sure they are in place are:
set up JAVA_HOME to C:\Apps\jdk1.6.0_06
Using CATALINA_BASE: C:\Apps\apache-tomcat-6.0.16
Using CATALINA_HOME: C:\Apps\apache-tomcat-6.0.16
Using CATALINA_TMPDIR: C:\Apps\apache-tomcat-6.0.16\temp
Using JRE_HOME: C:\Apps\jre1.6.0_06
I did a google on the error and I found people saying to place the
tools.jar from the jsk into the lib directory under CATALINA_HOME. But
the examples still don't work. What step could I be missing? Your help is greatly
appreciated.
This is the simple jsp file:
<%@ page import="ch06_01" %>
<HTML>
<HEAD>
<TITLE>Using a JavaBean</TITLE>
</HEAD>
<BODY>
<H1>Using a JavaBean</H1>
<% ch06_01 messager = new ch06_01(); %>
The message is: <%= messager.msg() %>
</BODY>
</HTML>
this is the simple ch6_01 java file:
public class ch06_01
public ch06_01()
public String msg()
return "Hello from JSP!";
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented
it from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 6 in the generated java file
The import ch06_01 cannot be resolved
An error occurred at line: 9 in the jsp file: /ch06_02.jsp
ch06_01 cannot be resolved to a type
6: <BODY>
7: <H1>Using a JavaBean</H1>
8:
9: <% ch06_01 messager = new ch06_01(); %>
10:
11: The message is: <%= messager.msg() %>
12:
An error occurred at line: 9 in the jsp file: /ch06_02.jsp
ch06_01 cannot be resolved to a type
6: <BODY>
7: <H1>Using a JavaBean</H1>
8:
9: <% ch06_01 messager = new ch06_01(); %>
10:
11: The message is: <%= messager.msg() %>
12:
Stacktrace:
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:423)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:316)
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)
Edited by: indikon1 on Jun 12, 2008 1:18 PM
I just updated the directories of the variables to reflect the current status of my system.What is wrong is that you are using an "old" jsp tutorial :-)
Since Java 1.4, JSPs have been unable to access classes in the "default" package.
What you need to do:
Put the java class ch06_01 in a package.
Steps to do this
- Edit ch06_01 and add the following to the very top of the file (without the quotes): "package mypackage;"
- create a folder "mypackage"
- move ch06_01.java into that folder
- compile that class (now in the mypackage package)
- place ch06_01.class under C:\Apps\apache-tomcat-6.0.16\webapps\ch06\WEB-INF\classes\mypackage
In your jsp:
<%@ page import="mypackage.ch06_01" %>
I would suggest using a more up-to-date tutorial that uses JSTL.
Take a look at this [Apache Tomcat tutorial|http://www.coreservlets.com/Apache-Tomcat-Tutorial/index.html] -
Unable to compile class for JSP in tomcat
Hi
I developed an application. it works Ok in embedded OC4J server. But I get the following error when I deployed to tomcat server :
org.apache.jasper.JasperException: Unable to compile class for JSP
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:130)
oracle.adfinternal.view.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:157)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._invokeDoFilter(AdfFacesFilterImpl.java:367)
oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._doFilterImpl(AdfFacesFilterImpl.java:336)
oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl.doFilter(AdfFacesFilterImpl.java:196)
oracle.adf.view.faces.webapp.AdfFacesFilter.doFilter(AdfFacesFilter.java:87)
oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:332)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
I followed the steps of deploying exactly as Oracle developer guide and I don't know what is the reason of this error
please how can I solve this problemHi
16-Jan-2007 04:09:17 org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet Faces Servlet threw exception
Compile failed; see the compiler error output for details.
at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:933)
at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:757)
at org.apache.jasper.compiler.AntCompiler.generateClass(AntCompiler.java:219)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:297)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:276)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:264)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:303)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:130)
at oracle.adfinternal.view.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:157)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._invokeDoFilter(AdfFacesFilterImpl.java:367)
at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._doFilterImpl(AdfFacesFilterImpl.java:336)
at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl.doFilter(AdfFacesFilterImpl.java:196)
at oracle.adf.view.faces.webapp.AdfFacesFilter.doFilter(AdfFacesFilter.java:87)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:332)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595) -
Calling a external Java method from JSP - using Tomcat server
Hi all,
I am trying to call a method in an external Java file from my JSP. I am using Tomcat server.
I have my class within the package package "mypackage" and it is called myclass.class. It has only one static method mymethod() which reads from a file and writes to a file.
I compiled the java class and I put the class file under webapps/ROOT/web-inf/classes/mypackage/myclass.class
I am trying to say something like this from my JSP file(which is under webapps/ROOT) :
<%@ page import = "mypackage.myclass"%>
<% myclass.mymethod(); %>
I am not instatiating the class as its a static method.
This is what I get while accessing my jsp file :
javax.servlet.ServletException: try to access class mypackage.myclass from class org.apache.jsp.index_005ftest_jsp
To put my problem in a nutshell, Can someone guide me how to access a method of an external class from a JSP page? I have a bunch of pages doing the same operation so I thought I would have it in a method and call it from every page. Even though I tried to put the file under web-inf/classes, The JSP is not able to see the class.
Please help.
Thanks
-UdayI have a situation that is a bit similar. I have successfully used beans for storing methods used in JSPs and used by other methods in the same class as was suggested above. Now I would like to break some methods into another (utility) class since they are lower level and can be used by lots of things. They are for database operations (given a String query and String dbname, it queries and returns ResultSet for example). I want to have them in a separate class for reusability and OOP.
I am having problems calling those public static methods in the public class from my bean that communicates with the JSP. I can't compile the class that calls the method in the database ops class. I get an error like :
loginHelper.java:45: cannot find symbol
symbol : variable sqlHelper
location: class dbHelperBean.loginHelper
and when I include the package name in the call I get
loginHelper.java:45: cannot find symbol
symbol : class sqlHelper
location: package dbHelperBean
That's strange since the package of both classes is dbHelperBean and the class is indeed called sqlHelper. I tried to compile it in the same directory as sqlHelper as well. What am I doing wrong?
Thanks for any help. -
How to run jsp using tomcat server?
hai friends,
i'm using jsp for my application and for that i'm using tomcat server.
i was runing my jsp files like this
http://localhost:8080/examples/jsp/myapp/index.jsp but instead of this
i need to run my jsp files like this
http://localhost:8080/myapp/index.jsp
what r the changes that i should do in tomcat installation to run myapplication in such a way.
thanks in advanceyou need to redefine the server root...
for that do the following...
copy all the directory tree rooted at
JAKARTA-HOME/webapps/ROOT/examples/jsp/myapp/ to
JAKARTA-HOME/webapps/ROOT/myapp/
-OR-
in the server.xml, search for "Tomcat Root Context" and un-comment the code defining Root Context...
change the docBase value from "ROOT" to "ROOT/examples/jsp"
that shud help...
-Pranav
hai friends,
i'm using jsp for my application and for that i'm
using tomcat server.
i was runing my jsp files like this
http://localhost:8080/examples/jsp/myapp/index.jsp but
instead of this
i need to run my jsp files like this
http://localhost:8080/myapp/index.jsp
what r the changes that i should do in tomcat
installation to run myapplication in such a way.
thanks in advance -
Issues running JSP using Tomcat
Hello,
I have installed Eclipse 3.0, Tomcat 5.0 with JDK 1.4.2 . I can view HTML pages but not JSP pages. I am able to run java code and servlets on Eclipse/Tomcat. When I point to a JSP page the page gives the following error
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:97)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:346)
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:434)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:492)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:471)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:459)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK
org.apache.tools.ant.taskdefs.compilers.Compile
Any help is much appreciated.Like the message says, you haven't set the JAVA_HOME variable correctly.
Have you set it?
It should point to the ROOT of your java install
eg
JAVA_HOME = c:\j2sdk1.4.2_04
Are you running Tomcat through Eclipse, or on its own? -
Generated servlet error - unable to compile class for JSP - using NB5.5/SS9
I am using NB5.5 beta2 and Sun server 9.0 with JSF 1.1 - all is OK when I am creating firts JSF application - welcomeJSF.jsp page is rendered normally - but when I am adding one more jsp with JSP view and so on - then - I am getting errors in both JSF pages - both - in original welcomeJSF and the new invoice.jsp page
here is code for typical error
org.apache.jasper.JasperException: Unable to compile class for JSP
org.apache.jasper.JasperException: Unable to compile class for JSP
Generated servlet error:
[javac] E:\Sun\AppServer\domains\domain1\generated\jsp\j2ee-modules\ERPSolution\org\apache\jsp\welcomeJSF_jsp.java:99: cannot find symbol
[javac] symbol : method setJspId(java.lang.String)
[javac] location: class com.sun.faces.taglib.jsf_core.ViewTag
[javac] jspxth_f_view_0.setJspId("id7");
[javac] ^
Generated servlet error:
[javac] E:\Sun\AppServer\domains\domain1\generated\jsp\j2ee-modules\ERPSolution\org\apache\jsp\welcomeJSF_jsp.java:144: cannot find symbol
[javac] symbol : method setJspId(java.lang.String)
[javac] location: class com.sun.faces.taglib.html_basic.OutputTextTag
[javac] jspxth_h_outputText_0.setJspId("id17");
[javac] ^
Generated servlet error:
[javac] E:\Sun\AppServer\domains\domain1\generated\jsp\j2ee-modules\ERPSolution\org\apache\jsp\welcomeJSF_jsp.java:145: setValue(java.lang.String) in com.sun.faces.taglib.html_basic.OutputTextTag cannot be applied to (javax.el.ValueExpression)
[javac] jspxth_h_outputText_0.setValue(org.apache.jasper.runtime.PageContextImpl.getValueExpression("Java Server Faces", (PageContext)_jspx_page_context, java.lang.Object.class, null));
[javac] ^
[javac] 3 errors
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:94)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:384)
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:461)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:528)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:507)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:495)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:530)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:409)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:317)
javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:414)
com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:455)
com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:139)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:108)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:266)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:159)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:73)
com.sun.enterprise.web.VirtualServerPipeline.invoke(VirtualServerPipeline.java:120)
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:231)
com.sun.enterprise.web.connector.grizzly.ProcessorTask.invokeAdapter(ProcessorTask.java:667)
com.sun.enterprise.web.connector.grizzly.ProcessorTask.processNonBlocked(ProcessorTask.java:574)
com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:844)
com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(ReadTask.java:287)
com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:212)
com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252)
com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:75)
note The full stack trace of the root cause is available in the Sun Java System Application Server Platform Edition 9.0 logs.
and there is output for another error:
Generated servlet error:
[javac] E:\Sun\AppServer\domains\domain1\generated\jsp\j2ee-modules\ERPSolution\org\apache\jsp\welcomeJSF_jsp.java:144: cannot find symbol
[javac] symbol : method setJspId(java.lang.String)
[javac] location: class com.sun.faces.taglib.html_basic.OutputTextTag
[javac] jspxth_h_outputText_0.setJspId("id17");
[javac] ^
Generated servlet error:
[javac] E:\Sun\AppServer\domains\domain1\generated\jsp\j2ee-modules\ERPSolution\org\apache\jsp\welcomeJSF_jsp.java:145: setValue(java.lang.String) in com.sun.faces.taglib.html_basic.OutputTextTag cannot be applied to (javax.el.ValueExpression)
[javac] jspxth_h_outputText_0.setValue(org.apache.jasper.runtime.PageContextImpl.getValueExpression("Java Server Faces", (PageContext)_jspx_page_context, java.lang.Object.class, null));
[javac] ^
[javac] 3 errors
and here is code of my new invoice.jsp page:
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<%--
The taglib directive below imports the JSTL library. If you uncomment it,
you must also add the JSTL library to the project. The Add Library... action
on Libraries node in Projects view can be used to add the JSTL 1.1 library.
--%>
<%--
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
--%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<f:view>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<h1><h:outputText value="Java Server Faces" /></h1>
<h:inputText value="#{managerBean.currentInvoice.id}"/>
<h:inputText value="#{managerBean.currentInvoice.description}"/>
<h:inputText value="#{managerBean.currentInvoice.total}"/>
<h:commandButton value="new_invoice"
type="submit"
actionListener="#{managerBean.createNewInvoice}"/>
</body>
</f:view>and faces-config.xml file:
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE faces-config PUBLIC
"-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
"http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
<!-- =========== FULL CONFIGURATION FILE ================================== -->
<faces-config>
<managed-bean>
<managed-bean-name>managerBean</managed-bean-name>
<managed-bean-class>com.brl.ERPSolution.ui.ManagerBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
</faces-config>managerBean was intended to be backing beans which will call the facaed beans of EJB 3.0 entity beans - but at presnet - almost empty methods are declared there:
package com.brl.ERPSolution.ui;
import javax.faces.event.ActionEvent;
import com.brl.solutions.EJB3.*;
* @author Administrator
public class ManagerBean {
protected int currentInvoiceId;
protected Invoices currentInvoice;
protected InvoicesFacade invoicesFacade;
/** Creates a new instance of ManagerBean */
public ManagerBean() {
/* business methods */
public void createNewInvoice(ActionEvent actionEvent)
invoicesFacade.create(this.currentInvoice);
public Invoices getCurrentInvoice()
return this.currentInvoice;
public void setCurrentInvoice(Invoices currentInvoice)
this.currentInvoice=currentInvoice;
}I read in one blog (actually - the only page which was returned by yahoo - so - this should be very rare error!!!) to try to use Sun server's verifier.bat - and - it reported 0 errors and 0 warning. Build was succesfull as well and also - deployment was without errors - but - above mentioned error appeared during the automatic compilation of jsp pages/servlet when newly deployed jsps are first accessed from remote browser.
So - is it possible, please, to receive some advice - what to do further? I feel that my invoice.jsp page can be with errors, - however - the original welcomeJSF.jsp should be working without errors even the erronwous JFS jsp page is added to web application.
Thans for any adice or hint in advance!!!OK - I have made 'clean and build main project' from NB menu and the deployed the resulting *.war and the error messages have disappeared... So - it seems to be bug...
-
Hi all
I am having a problem installing JavaMail
I have installed everything, added the mail.jar and activation.jar to my classpath, but when I try to run a JSP I get import errors:
javax.mail.*, package mail not found etc etc...
When I try to compile demos in the JavaMail directory, they compile fine.
Any ideas??
Thanks
Matt AYour classpath? You need to put those jar files where the JSPs and Tomcat can see them, which I believe means you have to put them in a directory whose name is something like .../WEB-INF/lib.
Maybe you are looking for
-
Several items incorrect in note 1482402, manually uninstall BPC 7.5
The gist of this note is correct, since it is basically the same procedure as for previous versions, however, details are wrong: The installation directory is referred to as c:\BPC when it is most likely c:\PC_MS The screen shot shows deleting a fold
-
Project Blue Print Structure in Solar01 Transaction
Dear All, Is it sure that the Project Structure in the Transaction Solar01 will always be remain same , i.e the structure will be as follows: 1.Organizational Units 2.Master Data 3.Business Scenarios 4.Interface Scenarios And also I want to know that
-
Output type for the tcode f.27
Hi All, Can any body please suggest what is the standard output type for the tcode f.27(Customer Statements). Thanks in advance, Nagendra
-
Hi~ I want to write a shooting game in this game I shoot the aircraft by clicking the target for example the following triangle is the target actually the image is in *.png format with alpha channel and without any number on the graph just the triang
-
Can pass codes be stopped using iPhone Config Utility
We will be managing multiple iPads next year at school. Is it possible to prevent students from setting up a passcode on the shared iPads? Regards Rod