Java Servlet BUG (Possibly)-Servlet classname replaces retrieved doc name
I created a test servlet (TestServlet.java) which reads data from a file which could be pdf/doc/xls/zip etc and presents the file to the user for download. When the user clicks on the save option to save the file the default name before the file extension of the file in the save dialog box is always TestServlet. i.e. If the file being downloaded is BEA.doc the default name in the save dialog box is TestServlet.doc
The contents of the file(data in the file) are correct but the default name should be BEA.doc and not TestServlet.doc. I get the same result if the file is a pdf/xls or any other file type which is being downloaded.
We tested this in BEA Weblogic 8.1 and Tomcat and get the same results both places so this issue is not application server specific and seems like a bug to us.
The TestServlet.java file is below
package com.test;
import java.io.*;
import java.util.*;
import javax.servlet.http.*;
public class TestServlet extends HttpServlet
private String fileName = "c:/BEA.doc";
private FileInputStream rd;
private ByteArrayOutputStream wr;
byte[] buf = new byte[8192]; //buffer size
byte[] fileData;
public void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException
doPost(request,response);
public void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException
int count = 0;
try
File theFile = new File(fileName);
if (theFile.exists())
try
rd = new FileInputStream(fileName);
wr = new ByteArrayOutputStream();
while ((count = rd.read(buf)) > -1)
wr.write(buf, 0, count);
rd.close();
fileData = wr.toByteArray();
response.setContentType("application/msword");
OutputStream sos = response.getOutputStream();
sos.write(fileData);
sos.flush();
sos.close();
catch(Exception ex)
System.out.println(ex.getMessage());
else
response.setContentType("text");
response.getWriter().write("no data");
catch (Exception e)
e.printStackTrace();
} I get the same results. i.e. The name of the document downloaded by the servlet is TestServlet.doc instead of BEA.doc which is what I have in c:\BEA.doc.
The web browser downloading this knows nothing about the file you are loading from disk and sending via the servlet. All it knows is that it requested via Http on the url TestServlet, and is getting something in return.
A quick google pulled up this link: http://builder.com.com/5100-6370-1027645.html
You might try this:
response.setHeader("Content-Disposition","inline;filename=\"BEA.doc\"");
good luck,
evnafets
Similar Messages
-
Using java mail api without servlets, I ve sent an html mail. In that Ive
Using java mail api without servlets, I ve sent an html mail. In that Ive specified action to the servlet. On click, it shows url as file:///C:/Documents%20and%20Settings/sirivanig/Local%20Settings/Temporary%20Internet%20Files/Content.IE5/CNFHMDIT/updatemailerform%5B2%5D.htm instead of www.servername.com/....
May I know the reason why it shows like this.
Do I ve to send htmlmail through servlet so that it does show proper url?Possibly your mailer is restricting your access to URLs to prevent
various scams. Without the details, it's hard to know what's going
wrong.
Have you tried with a different mailer? -
Hi,
I am following the tutorial which is given in Tutorial for Oracle WebCenter Developers.pdf i am at step 3 , i am using document library service in my page. BUt when i am running the page, the page get opens and it shows the following error:
Error 500--Internal Server Error java.lang.RuntimeException: javax.servlet.jsp.el.ELException.
the details of the error are shown below:
java.lang.RuntimeException: javax.servlet.jsp.el.ELException: Encountered "\u2019", expected one of [<INTEGER_LITERAL>, <FLOATING_POINT_LITERAL>, <STRING_LITERAL>, "true", "false", "null", "(", "-", "not", "!", "empty", <IDENTIFIER>]
at oracle.adf.share.el.OracleExpressionEvaluatorImpl.evaluateInternal(OracleExpressionEvaluatorImpl.java:85)
at oracle.adf.share.el.OracleExpressionEvaluatorImpl.evaluate(OracleExpressionEvaluatorImpl.java:51)
at oracle.adfinternal.view.faces.model.FacesExpressionEvaluator._evaluate(FacesExpressionEvaluator.java:115)
at oracle.adfinternal.view.faces.model.FacesExpressionEvaluator.evaluate(FacesExpressionEvaluator.java:72)
at oracle.adf.model.binding.DCUtil.elEvaluate(DCUtil.java:788)
at oracle.adf.model.binding.DCBindingContainer.evaluateParameterWithElCheck(DCBindingContainer.java:1403)
at oracle.adf.model.binding.DCBindingContainer.evaluateParameter(DCBindingContainer.java:1452)
at oracle.adf.model.binding.DCParameter.internalEvaluateExpresion(DCParameter.java:183)
at oracle.adf.model.binding.DCParameter.getValue(DCParameter.java:98)
at oracle.adf.controller.internal.binding.DCTaskFlowBinding.initializeParams(DCTaskFlowBinding.java:549)
at oracle.adf.controller.internal.binding.DCTaskFlowBinding.createRegionViewPortContext(DCTaskFlowBinding.java:320)
at oracle.adf.controller.internal.binding.DCTaskFlowBinding.getViewPort(DCTaskFlowBinding.java:281)
at oracle.adf.controller.internal.binding.TaskFlowRegionModel.doProcessBeginRegion(TaskFlowRegionModel.java:129)
at oracle.adf.controller.internal.binding.TaskFlowRegionModel.processBeginRegion(TaskFlowRegionModel.java:90)
at oracle.adf.controller.internal.binding.TaskFlowRegionController.refreshRegion(TaskFlowRegionController.java:116)
at oracle.adf.model.binding.DCBindingContainer.internalRefreshControl(DCBindingContainer.java:3038)
at oracle.adf.model.binding.DCBindingContainer.refresh(DCBindingContainer.java:2759)
at oracle.adf.controller.v2.lifecycle.PageLifecycleImpl.prepareModel(PageLifecycleImpl.java:112)
at oracle.adf.controller.faces.lifecycle.FacesPageLifecycle.prepareModel(FacesPageLifecycle.java:80)
at oracle.adf.controller.v2.lifecycle.Lifecycle$2.execute(Lifecycle.java:137)
at oracle.adfinternal.controller.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:192)
at oracle.adfinternal.controller.faces.lifecycle.ADFPhaseListener.mav$executePhase(ADFPhaseListener.java:21)
at oracle.adfinternal.controller.faces.lifecycle.ADFPhaseListener$PhaseInvokerImpl.startPageLifecycle(ADFPhaseListener.java:231)
at oracle.adfinternal.controller.faces.lifecycle.ADFPhaseListener$1.after(ADFPhaseListener.java:267)
at oracle.adfinternal.controller.faces.lifecycle.ADFPhaseListener.afterPhase(ADFPhaseListener.java:71)
at oracle.adfinternal.controller.faces.lifecycle.ADFLifecyclePhaseListener.afterPhase(ADFLifecyclePhaseListener.java:53)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:352)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:165)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:191)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:85)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:54)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:247)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:157)
at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.security.jps.wls.JpsWlsFilter$1.run(JpsWlsFilter.java:96)
at java.security.AccessController.doPrivileged(Native Method)
at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
at oracle.security.jps.wls.util.JpsWlsUtil.runJaasMode(JpsWlsUtil.java:146)
at oracle.security.jps.wls.JpsWlsFilter.doFilter(JpsWlsFilter.java:140)
at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:70)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:159)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:202)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3588)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2200)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2106)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1428)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
Caused by: javax.servlet.jsp.el.ELException: Encountered "\u2019", expected one of [<INTEGER_LITERAL>, <FLOATING_POINT_LITERAL>, <STRING_LITERAL>, "true", "false", "null", "(", "-", "not", "!", "empty", <IDENTIFIER>]
at org.apache.commons.el.ExpressionEvaluatorImpl.parseExpressionString(ExpressionEvaluatorImpl.java:320)
at oracle.jsp.el.OracleExpressionEvaluator.parseExpression(Unknown Source)
at oracle.adf.share.el.OracleExpressionEvaluatorImpl.evaluateInternal(OracleExpressionEvaluatorImpl.java:78)
... 64 more
Kindly suggest me.
Thanks.There may be a problem with the encoding of the single quotes in the connectionName and startFolderPath parameters of the task flow binding. I had the same problem when I copied and pasted the values from the pdf version of the tutorial.
Try this:
Select the "Bindings" tab of "MyPage.jspx".
Double click on "taskFlow - doclibdocumentLibrary1"
Replace the single quotes in the values by re-typing them.
The tutorial uses these values:
${’MyTutorialContent’}
${'/Manuals'} -
Hi all,
When i try to run more than one servelt of the Quick Start samples that using Livecycle Java APIs and i get an error of "Remote EJBObject lookup failed for ejb/Invocation provider" from any servelt i run.
I try some Quick samples which is not servelts (java class) and it works fine, which makes me sure that my connection properties is true.
Environment:
The LiveCycle is based on "Websphere v6.1", and i use "Eclipse Platform
Version: 3.4.1".
i install "tomcat 5.5.17" to test the servelts in developing time through Eclipse.(only for test in developing time not for deploy on )
The Jars i added in the classpath:
adobe-forms-client.jar
adobe-livecycle-client.jar
adobe-usermanager-client.jar
adobe-utilities.jar
ejb.jar
j2ee.jar
ecutlis.jar
com.ibm.ws.admin.client_6.1.0.jar
com.ibm.ws.webservices.thinclient_6.1.0.jar
server.jar
utlis.jar
wsexception.jar
My code is :
Properties ConnectionProps = new Properties();
ConnectionProps.setProperty(ServiceClientFactoryProperties.DSC_DEFAULT_EJB_ENDPOINT, "iiop://localhost:2809");
ConnectionProps.setProperty ServiceClientFactoryProperties.DSC_TRANSPORT_PROTOCOL,ServiceClientFactoryProperties.DSC_ EJB_PROTOCOL);
ConnectionProps.setProperty(ServiceClientFactoryProperties.DSC_SERVER_TYPE,ServiceClientFa ctoryProperties.DSC_WEBSPHERE_SERVER_TYPE);
ConnectionProps.setProperty(ServiceClientFactoryProperties.DSC_CREDENTIAL_USERNAME, "Administrator");
ConnectionProps.setProperty(ServiceClientFactoryProperties.DSC_CREDENTIAL_PASSWORD, "password");
ConnectionProps.setProperty("java.naming.factory.initial", "com.ibm.ws.naming.util.WsnInitCtxFactory");
//Create a ServiceClientFactory object
ServiceClientFactory myFactory = ServiceClientFactory.createInstance(ConnectionProps);
//Create a FormsServiceClient object
FormsServiceClient formsClient = new FormsServiceClient(myFactory);
//Get Form data to pass to the processFormSubmission method
Document formData = new Document(req.getInputStream());
//Set run-time options
RenderOptionsSpec processSpec = new RenderOptionsSpec();
processSpec.setLocale("en_US");
//Invoke the processFormSubmission method
FormsResult formOut = formsClient.processFormSubmission(formData,"CONTENT_TYPE=application/pdf&CONTENT_TYPE=app lication/vnd.adobe.xdp+xml&CONTENT_TYPE=text/xml", "",processSpec);
List fileAttachments = formOut.getAttachments();
Iterator iter = fileAttachments.iterator();
int i = 0 ;
while (iter.hasNext()) {
Document file = (Document)iter.next();
file.copyToFile(new File("C:\\Adobe\\tempFile"+i+".jp i++;
short processState = formOut.getAction();
...... (To the end of the sample)
My Error was:
com.adobe.livecycle.formsservice.exception.ProcessFormSubmissionException: ALC-DSC-031-000: com.adobe.idp.dsc.net.DSCNamingException: Remote EJBObject lookup failed for ejb/Invocation provider
at com.adobe.livecycle.formsservice.client.FormsServiceClient.processFormSubmission(FormsSer viceClient.java:416)
at HandleData.doPost(HandleData.java:62)
at HandleData.doGet(HandleData.java:31)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j ava:252)
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)
aI assume here that your application is deployed on a different physical machine of where LCES is deployed and running.
Do the following test:
- Say that LCES is deployed on machine1 and your application is deployed on machine2. Ping machine1 from machine2 and note the ip address.
- Ping machine1 from machine1 and note the ip address.
The two pings should match.
- Ping machine2 from machine1 and note the ip address.
- Ping machine2 from machine2 and note the ip address.
The two pings should match.
Usually this kind of error would happen if your servers have internal and external ip addresses. -
Problem to include java script file in servlet
I couldnt use any functions included in java servlet file using servlet. I made a test in jsp and it work fine but in servlet not.
Here my code
out.println("<jsp:include page=\"C:/path/file.js\" flush=\"true\" />");
or
out.println("<script language=\"javascript\" src=\"c:/path/file.js\">");
Although was no error but using both didnt let me use any function inside the java script file. As I said using the same command in JSP works fine.
How I can include the file.js correctly ?[email protected] wrote:
server machineOK, imagine that I am the server and you are the client.
I have a file "c:/documents and settings/balusc/passwords.txt".
So now you have the path. Can you tell me the contents of the file? -
ATMTag.java:5: package javax.servlet does not exist
My j2ee jdk1.4.2 is not supporting javx package.
i already set all pathh and class path.
anybody can help me.
details are given below ::
C:\AVA\J2EE Programs\JSP\JSPCustomTag>javac ATMTag.java
ATMTag.java:5: package javax.servlet does not exist
import javax.servlet.*;
^<br>
ATMTag.java:6: package javax.servlet.http does not exist
<br>
import javax.servlet.http.*;
<br>
ATMTag.java:18: cannot resolve symbol
symbol : class TagSupport
location: class ATMTag
public class ATMTag extends TagSupport{
<br> ^
ATMTag.java:29: cannot resolve symbol
symbol : class JspTagException
location: class ATMTag
public int doStartTag() throws JspTagException{
<br> ^
ATMTag.java:31: cannot resolve symbol
symbol : class JspWriter
location: class ATMTag
<br> JspWriter out =pageContext.getOut();
^
ATMTag.java:31: cannot resolve symbol
symbol : variable pageContext
location: class ATMTag
<br> JspWriter out =pageContext.getOut();
^
ATMTag.java:56: cannot resolve symbol
symbol : variable pageContext
location: class ATMTag
pageContext.getOut().write(str);
<br> ^
ATMTag.java:60: cannot resolve symbol
symbol : variable EVAL_PAGE
location: class ATMTag
return EVAL_PAGE;
^
8 errorsWhen compiling servlets etc, you need to include in your classpath a jar file with all the javax.* classes defined in it.
For Tomcat this is called servlet.jar and is in (I think) [TOMCAT_HOME]/shared/lib or /common/lib
For J2EE 1.4 Server, the jar is [J2EE_HOME]/lib/j2ee.jar
Where the _HOME directory is the directory where you installed J2EE.
Include this jar file in your classpath when compiling.
Good luck,
evnafets -
How to convert old Java Servlets to OSGi "Servlet" Bundles
Hello I'm looking for some help/insight on the best way to convert some of our old Java Servlet code into new OSGi Bundles that can be accessed as servlets. I'd like to be able to install the new bundles then access them on one of our CQ instance using something like "/servlet/servlet_name".
So far I've been able to create a new bundle, and install it into CQ but I haven't been able to access the bundle at the servlet mapping URL that I would expect. So far what I've found online has lead me to believe that I need to use the Felix Annotations to describe my servlet.
@Component(immediate = true, metatype = true, label = "Servlet Name")
@Service
@Properties({
@Property(name = Constants.SERVICE_DESCRIPTION, value = "Servlet Name"),
@Property(name = "sling.servlet.methods", value={"GET"}),
@Property(name = "sling.servlet.paths", value = "/servlet/my_servlet_mapping"),
@Property(name = Constants.SERVICE_VENDOR, value = "VendorName")
public class TellAFriend extends HttpServlet {...
public void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException
Once I have this installed, and running without an error in the logs for CQ I tried to go on my local instance to http://localhost:4502/servlet/my_servlet_mapping but I only get 404 Resource Not Found errors. I've even gone to the Sling Resource Resolver and it doesn't resolve to anything either.
Is there more than the Servlet Information need into the Annotations to convert "old" code into a new OSGi Servlet Mapped Bundle?I must be missing something else configuration wise since I created a new Servlet basically using the code you provided above. I deployed it as part of the bundle that I'm trying to create.
The bundle installs and stars fine but I still can't access the servlet. Are there CRXDE based configurations that are requried too to configure Servlets.
Here's my test servlet file. I tried going to http://localhost:4502/servlet/TestCQServlet and just get the same 404 error I'm getting for the other 2 Servlets Java classes in my Bundle.
import java.io.IOException;
import javax.servlet.ServletException;
import org.apache.felix.scr.annotations.sling.SlingServlet;
import org.apache.sling.api.SlingHttpServletRequest;
import org.apache.sling.api.SlingHttpServletResponse;
import org.apache.sling.api.servlets.SlingSafeMethodsServlet;
@SlingServlet(paths = "/servlet/TestCQServlet", methods = "GET")
public class TestCQServlet extends SlingSafeMethodsServlet {
// @Reference
// private Repository repository;
private static final long serialVersionUID = 6239754936223276983L;
@Override
protected void doGet(SlingHttpServletRequest request, SlingHttpServletResponse response) throws ServletException, IOException {
response.setHeader("Content-Type", "application/json");
response.getWriter().print("whatever"); -
Compiling the java file related to Servlet and Core java files in heirarchy
I am working in Jakarta-Tomcat 4.0.4 with j2sdk1.4.1_01 and i have put all servlet files in package "com.java.servlet"
and other core java files in package "com.java.action" . Also I am imorting java files in package
"com.java.action" to the package "com.java.servlet".
But when I am compiling the servlet files in package "com.java.servlet"
then the servlet files are not compiling because it cannot able to import
java files in package "com.java.action" . I have tried all the options.
If anybody has solution then please respond immediately.I agree with the previous poster, this sounds like a generic compiling problem. FYI: I do not think that packages that start with "com.java." are special or reserved in any way.
You are making a servlet, not a JSP, right? Since this is merely about compiling, you might want to re-post to "Java Programming". -
I Have exactly the same error and I would like to have a solution.....
It happens when weblogic tries to compile a jsp page.
So the result on the browser is the original jsp page: The jsp tags are not parsed.
This problem exists on my Weblogic 4.5.1 sp11 (on unix) nut not on my weblogic 4.5.2 NT ?
Any idea ?
Thanks.
Chris Opacki <[email protected]> wrote:
>Has anyone had this error and found a way to fix it?
>
>java.lang.NoSuchMethodError: javax.servlet.jsp.PageContext: method
><init>(Ljavax/servlet/jsp/JspFactory;)V not found
-
Hi ..
i make a simple struts application for login check which when i try to run tomcat i got the following error
i have installed Apache Tomcat/5.5.17, jdk1.5.0_09, eclipse 3.2
please tell me whats wrong with configuration
becoz same code working fine well in different machin..........
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: java.lang.NoSuchMethodError: javax.servlet.jsp.tagext.TagAttributeInfo.<init>(Ljava/lang/String;ZLjava/lang/String;ZZ)V
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:272)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
root cause
java.lang.NoSuchMethodError: javax.servlet.jsp.tagext.TagAttributeInfo.<init>(Ljava/lang/String;ZLjava/lang/String;ZZ)V
org.apache.jasper.compiler.TagLibraryInfoImpl.createAttribute(TagLibraryInfoImpl.java:576)
org.apache.jasper.compiler.TagLibraryInfoImpl.createTagInfo(TagLibraryInfoImpl.java:401)
org.apache.jasper.compiler.TagLibraryInfoImpl.parseTLD(TagLibraryInfoImpl.java:248)
org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:162)
org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:423)
org.apache.jasper.compiler.Parser.parseDirective(Parser.java:492)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1552)
org.apache.jasper.compiler.Parser.parse(Parser.java:126)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:211)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:100)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:155)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:295)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:276)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:264)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:303)
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:803)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.17 logs.
Apache Tomcat/5.5.17Could you include the content of your JSP page?
-
Hi,
I encountered this error when first deploying my Web App in the Apache Tomcat 5.5.7 Manager and launching my login .jsp:
Any ideas? *.tld files?
Thsiis a vendors *.war file so I am very unsure of code(jsp's) used.
Need more info?
Please let me know.
TIA!
java.lang.NoSuchMethodError: javax.servlet.jsp.tagext.TagAttributeInfo.<init>(Ljava/lang/String;ZLjava/lang/String;ZZ)V
Aug 3, 2005 4:40:44 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet jsp threw exception
java.lang.NoSuchMethodError: javax.servlet.jsp.tagext.TagAttributeInfo.<init>(Ljava/lang/String;ZLjava/lang/String;ZZ)V
at org.apache.jasper.compiler.TagLibraryInfoImpl.createAttribute(TagLibraryInfoImpl.java:568)
at org.apache.jasper.compiler.TagLibraryInfoImpl.createTagInfo(TagLibraryInfoImpl.java:401)
at org.apache.jasper.compiler.TagLibraryInfoImpl.parseTLD(TagLibraryInfoImpl.java:248)
at org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:179)
at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:418)
at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:483)
at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1539)
at org.apache.jasper.compiler.Parser.parse(Parser.java:126)
at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:211)
at org.apache.jasper.compiler.ParserController.parse(ParserController.java:100)
at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:146)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:296)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)
at javax.servlet.http.HttpServlet.service(HttpServlet.java)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
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:825)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:738)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:526)
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(Unknown Source)Hi,
Apparently changig the CLASSPATH did the trick.(changing path to servlet-api.jar)
We can view the JSP's in the WAR file now without exceptions, able to use the Logon.jsp page now.
Else, Thanks for the insight to looking inside the WAR file...
[root@msnweb webapps]# jar tvf optix-web.war | grep -i "api"
124720 Thu Aug 04 13:09:28 CDT 2005 WEB-INF/lib/xml-apis.jar
[root@msnweb webapps]# jar tvf optix-web.war | grep -i "servlet"
11930 Thu Aug 04 13:09:26 CDT 2005 WEB-INF/classes/DataStreamServlet.class
5203 Thu Aug 04 13:09:26 CDT 2005 WEB-INF/classes/DeleteFolderItemServlet.class
12307 Thu Aug 04 13:09:26 CDT 2005 WEB-INF/classes/OpenObjectServlet.class
66697 Thu Aug 04 13:09:28 CDT 2005 WEB-INF/lib/servlet-lib.jar
I just looked in the /Webapps dir where Tomcat extracted the *.war file and put the JSP's, that correct as well? -
Hi,
I have an application which is executing properly in jboss 3.2.5 but as we are trying to upgrade the jboss version i am getting above mentioned error.
The application is deployed in jboss as an ear file and the ear contains one jar file that has been removed from the ear and still i am getting this error.
I am posting the full stack trace over here.
ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
java.lang.AbstractMethodError: javax.servlet.jsp.JspFactory.getJspApplicationContext(Ljavax/servlet/ServletContext;)Ljavax/servlet/jsp/JspApplicationContext;
at org.apache.jsp.Jsp.Common.logout_jsp._jspInit(logout_jsp.java:22)
at org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:52)
at org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:158)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:336)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at clime.messadmin.filter.MessAdminFilter.doFilter(MessAdminFilter.java:104)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:524)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
at java.lang.Thread.run(Thread.java:595)It is happening in logout.jsp, but all other main jsp's are working properly ( login.jsp etc ).
I am posting the jsp code over here.
<html>
<head>
<script language="JavaScript">
function init() {
window.history.forward(1);
</script>
</head>
<body onLoad="init();" >
<%@ page language="java" %>
<%@ page isThreadSafe="true" %>
<%
session.invalidate();
response.sendRedirect("../../logout.html");
%>
</body>
</html>Please guide me to solve the issue.evnafets wrote:
My guess would be that you have some of the servlet classes deployed with your application.
Yes.
Any jar files that contain the javax.servlet.* packages should NOT be part of a web application, but are intended to be on the server.
First up all there is no such jar files.
Common candidates:
servlet.jar
servlet-api.jar
j2ee.jar
All those jars are in lib directory of my app server. I have jsp-api and servlet-api.jar as i am using embedded tomcat 6 in jboss appsever.
Check the WEB-INF/lib directory of your web application to see that there are none of those there.
Nothing similar deployed in your ear file?I have extracted my application ear , jar and war then when i checked i found one jar file inside the war but in that no servlet*.jarr files. It is my application oriented files only. I have deleted this ar files and then i executedi am getting same error. Is there any way to find out the exact issue ????.
Regards
Rasa -
Hi All,
I am getting the following error when i create a jsf jsp page and build it in jdeveloper.
Error:java.lang.NoSuchMethodError:javax.servlet.jsp.tagext.TagAttributeInfo.<init>(Ljava/lang/String;ZLjava/lang/String;ZZ)V
when i build the application by simply creating jsp not jsf jsp then it works well.
Could you any tell me how to fix this? i searched in forums but i didn't find relevant solution.
Thanks,
UdhayaHi!
Can you tell us what version of JDeveloper you are using, and what steps you took to create the JSF page? Like, write from scratch or use the JSF page wizard?
Also, can you check your project properties, and check that the JSF libraries are included, and JSF tag libraries set up?
Regards,
Jeroen van Veldhuizen -
When running weblogic 4.5.1 on our staging server we get the following
exceptions happening intermitently
Our other servers have identical code and properties files and they are fine
Tue Jul 11 12:03:53 GMT+01:00 2000:<E> <ServletContext-Servlets> Servlet
failed with RuntimeException
Tue Jul 11 12:03:53 GMT+01:00 2000:<E> <ServletContext-Servlets>
java.lang.ClassCastException: javax.servlet.http.NoBodyOutputStream
at weblogic.servlet.FileServlet.sendFile(Compiled Code)
at weblogic.servlet.FileServlet.doGet(Compiled Code)
at javax.servlet.http.HttpServlet.doHead(Compiled Code)
at javax.servlet.http.HttpServlet.service(Compiled Code)
at javax.servlet.http.HttpServlet.service(Compiled Code)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(Compiled Code)
at weblogic.servlet.internal.ServletContextImpl.invokeServlet(Compiled
Code)
at weblogic.servlet.internal.ServletContextImpl.invokeServlet(Compiled
Code)
at weblogic.socket.MuxableSocketHTTP.invokeServlet(Compiled Code)
at weblogic.socket.MuxableSocketHTTP.execute(Compiled Code)
at weblogic.t3.srvr.ExecuteThread.run(Compiled Code)
Tue Jul 11 12:03:53 GMT+01:00 2000:<E> <HTTP> Servlet request terminated
with IOException:
Tue Jul 11 12:03:53 GMT+01:00 2000:<E> <HTTP> java.net.ProtocolException:
Exceeded stated content-length of: 1230 bytes
at java.lang.Throwable.fillInStackTrace(Native Method)
at java.lang.Throwable.fillInStackTrace(Compiled Code)
at java.lang.Throwable.<init>(Compiled Code)
at java.lang.Exception.<init>(Compiled Code)
at java.io.IOException.<init>(Compiled Code)
at java.net.ProtocolException.<init>(Compiled Code)
at weblogic.servlet.internal.ServletOutputStreamImpl.print(Compiled Code)
at javax.servlet.ServletOutputStream.println(ServletOutputStream.java:252)
at
weblogic.servlet.internal.ServletResponseImpl.sendError(ServletResponseImpl.
java:307)
at weblogic.servlet.internal.ServletResponseImpl.sendError(Compiled Code)
at weblogic.servlet.internal.ServletContextImpl.invokeServlet(Compiled
Code)
at weblogic.servlet.internal.ServletContextImpl.invokeServlet(Compiled
Code)
at weblogic.socket.MuxableSocketHTTP.invokeServlet(Compiled Code)
at weblogic.socket.MuxableSocketHTTP.execute(Compiled Code)
at weblogic.t3.srvr.ExecuteThread.run(Compiled Code)
Any ideas ?When running weblogic 4.5.1 on our staging server we get the following
exceptions happening intermitently
Our other servers have identical code and properties files and they are fine
Tue Jul 11 12:03:53 GMT+01:00 2000:<E> <ServletContext-Servlets> Servlet
failed with RuntimeException
Tue Jul 11 12:03:53 GMT+01:00 2000:<E> <ServletContext-Servlets>
java.lang.ClassCastException: javax.servlet.http.NoBodyOutputStream
at weblogic.servlet.FileServlet.sendFile(Compiled Code)
at weblogic.servlet.FileServlet.doGet(Compiled Code)
at javax.servlet.http.HttpServlet.doHead(Compiled Code)
at javax.servlet.http.HttpServlet.service(Compiled Code)
at javax.servlet.http.HttpServlet.service(Compiled Code)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(Compiled Code)
at weblogic.servlet.internal.ServletContextImpl.invokeServlet(Compiled
Code)
at weblogic.servlet.internal.ServletContextImpl.invokeServlet(Compiled
Code)
at weblogic.socket.MuxableSocketHTTP.invokeServlet(Compiled Code)
at weblogic.socket.MuxableSocketHTTP.execute(Compiled Code)
at weblogic.t3.srvr.ExecuteThread.run(Compiled Code)
Tue Jul 11 12:03:53 GMT+01:00 2000:<E> <HTTP> Servlet request terminated
with IOException:
Tue Jul 11 12:03:53 GMT+01:00 2000:<E> <HTTP> java.net.ProtocolException:
Exceeded stated content-length of: 1230 bytes
at java.lang.Throwable.fillInStackTrace(Native Method)
at java.lang.Throwable.fillInStackTrace(Compiled Code)
at java.lang.Throwable.<init>(Compiled Code)
at java.lang.Exception.<init>(Compiled Code)
at java.io.IOException.<init>(Compiled Code)
at java.net.ProtocolException.<init>(Compiled Code)
at weblogic.servlet.internal.ServletOutputStreamImpl.print(Compiled Code)
at javax.servlet.ServletOutputStream.println(ServletOutputStream.java:252)
at
weblogic.servlet.internal.ServletResponseImpl.sendError(ServletResponseImpl.
java:307)
at weblogic.servlet.internal.ServletResponseImpl.sendError(Compiled Code)
at weblogic.servlet.internal.ServletContextImpl.invokeServlet(Compiled
Code)
at weblogic.servlet.internal.ServletContextImpl.invokeServlet(Compiled
Code)
at weblogic.socket.MuxableSocketHTTP.invokeServlet(Compiled Code)
at weblogic.socket.MuxableSocketHTTP.execute(Compiled Code)
at weblogic.t3.srvr.ExecuteThread.run(Compiled Code)
Any ideas ? -
Call java class by using servlet
i written simple servlet with doGet(0. I need call java class when i run servlet
my requirement is when i start the server i will call servlet it will redirect to another page.
but before that servlet will run java class. which i have written externally.
i need to run java class by using servlet then it will redirect to another page.
could you give the proper solutionYou don't call classes - you call methods.
There's nothing special about servlets except the requirement that they implement HttpServlet. Servlets and other classes they interact with all get compiled into WEB-INF/classes on the server.
To forward a request to, say, "other.jsp" you do:
getServletContext().getRequestDispatcher("/other.jsp").forward(request,response);
Maybe you are looking for
-
How to import and display an applet from JSP
i m using netbeans 5.0 i have class named myapplet.class and jsp named myjsp.jsp now i want to access(import) this myapplet.class from jsp also i want to display this applet from this jsp i am able to do either thing but not both so please help me it
-
Cant restore my apple id on my ipad
hi i gave my ipod to my daughter and reset it to her e mail but after that i cant use my apple id on my ipad and mail not work on my iphone and both display username and pass word not matched i tried id manger can not help as either say this email is
-
Error opening JSP file weblogic 8.1
Hi, I'm using weblogic 8.1 and testing few JSP pages on my local machine they work well but when the .war file is deployed on to our production server (which is remote), error message in the domainname.log file java.io.FileNotFoundException
-
Hi all, I need to allow a user to fill out some forms with the following info: Name, Title, Supervisor, Division, Status, Salary, Effective Date and Remarks. After filling out the info, it needs to be sent via a link that will allow the recipient acc
-
Events past 5 in the notification center in ios 7?
Just upgraded to iOS 7. In notification center, my calendar stops at 5 pm, not showing any events after that. Is there a way to get those to show? iPad 4, iOS 7