Web.xml error

In my log file I get this error:
####<Oct 2, 2002 10:55:39 AM PDT> <Info> <HTTP> <hewlett-yf9yyzb> <myserver>
<ExecuteThread: '1' for queue: '__weblogic_admin_html_queue'> <system> <>
<101160> <Deployment descriptor is malformed, check against the DTD:
org.xml.sax.SAXParseException: Element type "ejb-local-ref" is not declared
in the dtd or schema..>
####<Oct 2, 2002 10:55:39 AM PDT> <Info> <HTTP> <hewlett-yf9yyzb> <myserver>
<ExecuteThread: '1' for queue: '__weblogic_admin_html_queue'> <system> <>
<101160> <Deployment descriptor is malformed, check against the DTD:
org.xml.sax.SAXParseException: Element type "local-home" is not declared in
the dtd or schema..>
####<Oct 2, 2002 10:55:39 AM PDT> <Info> <HTTP> <hewlett-yf9yyzb> <myserver>
<ExecuteThread: '1' for queue: '__weblogic_admin_html_queue'> <system> <>
<101160> <Deployment descriptor is malformed, check against the DTD:
org.xml.sax.SAXParseException: Element type "local" is not declared in the
dtd or schema..>
But what I don't understand is that the dtd for web.xml is
"http://java.sun.com/dtd/web-app_2_3.dtd" and they use ejb-local-ref,
local-home and local. Why do I still get the error when the dtd mentions it.
<web-app>
<ejb-ref>
<ejb-local-ref>
<description>
Reference EJB resources in Weblogic Resources
</description>
<ejb-ref-name>GangsterEJB</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<local-home>com.sempire.builder.business_component.GangsterHome</local-home>
<local>com.sempire.builder.business_component.Gangster</local>
</ejb-local-ref>
<ejb-local-ref>
<description>
Reference EJB resources in Weblogic Resources
</description>
<ejb-ref-name>OrganizationEJB</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<local-home>com.sempire.builder.business_component.OrganizationHome</local-h
ome>
<local>com.sempire.builder.business_component.Organization</local>
</ejb-local-ref>
<ejb-local-ref>
<description>
Reference EJB resources in Weblogic Resources
</description>
<ejb-ref-name>JobEJB</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<local-home>com.sempire.builder.business_component.JobHome</local-home>
<local>com.sempire.builder.business_component.Job</local>
</ejb-local-ref>
</web-app>
Do I need to specify ejb-local-ref in my ejb-jar.xml also??
and my ejb-jar.xml is:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-jar PUBLIC
"-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
"http://java.sun.com/dtd/ejb-jar_2_0.dtd">
<ejb-jar>
<display-name>Business Component CMP 2.0</display-name>
<enterprise-beans>
<entity>
<display-name>Gangster Entity Bean</display-name>
<ejb-name>GangsterEJB</ejb-name>
<local-home>com.sempire.builder.business_component.GangsterHome</local-home>
<local>com.sempire.builder.business_component.Gangster</local>
<ejb-class>com.sempire.builder.business_component.GangsterBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.Integer</prim-key-class>
<reentrant>False</reentrant>
<cmp-version>2.x</cmp-version>
<abstract-schema-name>GangsterEJB</abstract-schema-name>
<cmp-field><field-name>iD</field-name></cmp-field>
<cmp-field><field-name>name</field-name></cmp-field>
<cmp-field><field-name>nickname</field-name></cmp-field>
<cmp-field><field-name>badness</field-name></cmp-field>
<primkey-field>iD</primkey-field>
<resource-ref>
<res-ref-name>jdbc/GangsterDB</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<query>
<query-method>
<method-name>findAll</method-name>
<method-params></method-params>
</query-method>
<ejb-ql>
<![CDATA[SELECT OBJECT(a) FROM GangsterEJB AS a]]>
</ejb-ql>
</query>
</entity>
<entity>
<display-name>Organization Entity Bean</display-name>
<ejb-name>OrganizationEJB</ejb-name>
<local-home>com.sempire.builder.business_component.OrganizationHome</local-h
ome>
<local>com.sempire.builder.business_component.Organization</local>
<ejb-class>com.sempire.builder.business_component.OrganizationBean</ejb-clas
s>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.Integer</prim-key-class>
<reentrant>False</reentrant>
<cmp-version>2.x</cmp-version>
<abstract-schema-name>OrganizationEJB</abstract-schema-name>
<cmp-field><field-name>iD</field-name></cmp-field>
<cmp-field><field-name>name</field-name></cmp-field>
<cmp-field><field-name>description</field-name></cmp-field>
<primkey-field>iD</primkey-field>
<resource-ref>
<res-ref-name>jdbc/OrganizationDB</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<query>
<query-method>
<method-name>findAll</method-name>
<method-params></method-params>
</query-method>
<ejb-ql>
<![CDATA[SELECT OBJECT(a) FROM OrganizationEJB AS a]]>
</ejb-ql>
</query>
</entity>
<entity>
<display-name>Job Entity Bean</display-name>
<ejb-name>JobEJB</ejb-name>
<local-home>com.sempire.builder.business_component.JobHome</local-home>
<local>com.sempire.builder.business_component.Job</local>
<ejb-class>com.sempire.builder.business_component.JobBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.Integer</prim-key-class>
<reentrant>False</reentrant>
<cmp-version>2.x</cmp-version>
<abstract-schema-name>JobEJB</abstract-schema-name>
<cmp-field><field-name>iD</field-name></cmp-field>
<cmp-field><field-name>name</field-name></cmp-field>
<cmp-field><field-name>score</field-name></cmp-field>
<cmp-field><field-name>setupCost</field-name></cmp-field>
<primkey-field>iD</primkey-field>
<resource-ref>
<res-ref-name>jdbc/JobDB</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<query>
<query-method>
<method-name>findAll</method-name>
<method-params></method-params>
</query-method>
<ejb-ql>
<![CDATA[SELECT OBJECT(a) FROM JobEJB AS a]]>
</ejb-ql>
</query>
</entity>
</enterprise-beans>
Thanks
Ronak Parekh

Remove lone <ejb-ref> from your web.xml
"Ronak Parekh" <[email protected]> wrote in message
news:[email protected]...
In my log file I get this error:
####<Oct 2, 2002 10:55:39 AM PDT> <Info> <HTTP> <hewlett-yf9yyzb><myserver>
<ExecuteThread: '1' for queue: '__weblogic_admin_html_queue'> <system> <>
<101160> <Deployment descriptor is malformed, check against the DTD:
org.xml.sax.SAXParseException: Element type "ejb-local-ref" is notdeclared
in the dtd or schema..>
####<Oct 2, 2002 10:55:39 AM PDT> <Info> <HTTP> <hewlett-yf9yyzb><myserver>
<ExecuteThread: '1' for queue: '__weblogic_admin_html_queue'> <system> <>
<101160> <Deployment descriptor is malformed, check against the DTD:
org.xml.sax.SAXParseException: Element type "local-home" is not declaredin
the dtd or schema..>
####<Oct 2, 2002 10:55:39 AM PDT> <Info> <HTTP> <hewlett-yf9yyzb><myserver>
<ExecuteThread: '1' for queue: '__weblogic_admin_html_queue'> <system> <>
<101160> <Deployment descriptor is malformed, check against the DTD:
org.xml.sax.SAXParseException: Element type "local" is not declared in the
dtd or schema..>
But what I don't understand is that the dtd for web.xml is
"http://java.sun.com/dtd/web-app_2_3.dtd" and they use ejb-local-ref,
local-home and local. Why do I still get the error when the dtd mentionsit.
>
<web-app>
<ejb-ref>
<ejb-local-ref>
<description>
Reference EJB resources in Weblogic Resources
</description>
<ejb-ref-name>GangsterEJB</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<local-home>com.sempire.builder.business_component.GangsterHome</local-home>
>
<local>com.sempire.builder.business_component.Gangster</local>
>
</ejb-local-ref>
<ejb-local-ref>
<description>
Reference EJB resources in Weblogic Resources
</description>
<ejb-ref-name>OrganizationEJB</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<local-home>com.sempire.builder.business_component.OrganizationHome</local-h
ome>
<local>com.sempire.builder.business_component.Organization</local>
</ejb-local-ref>
<ejb-local-ref>
<description>
Reference EJB resources in Weblogic Resources
</description>
<ejb-ref-name>JobEJB</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<local-home>com.sempire.builder.business_component.JobHome</local-home>
<local>com.sempire.builder.business_component.Job</local>
</ejb-local-ref>
</web-app>
Do I need to specify ejb-local-ref in my ejb-jar.xml also??
and my ejb-jar.xml is:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-jar PUBLIC
"-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
"http://java.sun.com/dtd/ejb-jar_2_0.dtd">
<ejb-jar>
<display-name>Business Component CMP 2.0</display-name>
<enterprise-beans>
<entity>
<display-name>Gangster Entity Bean</display-name>
<ejb-name>GangsterEJB</ejb-name>
<local-home>com.sempire.builder.business_component.GangsterHome</local-home>
<local>com.sempire.builder.business_component.Gangster</local>
<ejb-class>com.sempire.builder.business_component.GangsterBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.Integer</prim-key-class>
<reentrant>False</reentrant>
<cmp-version>2.x</cmp-version>
<abstract-schema-name>GangsterEJB</abstract-schema-name>
<cmp-field><field-name>iD</field-name></cmp-field>
<cmp-field><field-name>name</field-name></cmp-field>
<cmp-field><field-name>nickname</field-name></cmp-field>
<cmp-field><field-name>badness</field-name></cmp-field>
<primkey-field>iD</primkey-field>
<resource-ref>
<res-ref-name>jdbc/GangsterDB</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<query>
<query-method>
<method-name>findAll</method-name>
<method-params></method-params>
</query-method>
<ejb-ql>
<![CDATA[SELECT OBJECT(a) FROM GangsterEJB AS a]]>
</ejb-ql>
</query>
</entity>
<entity>
<display-name>Organization Entity Bean</display-name>
<ejb-name>OrganizationEJB</ejb-name>
<local-home>com.sempire.builder.business_component.OrganizationHome</local-h
ome>
<local>com.sempire.builder.business_component.Organization</local>
<ejb-class>com.sempire.builder.business_component.OrganizationBean</ejb-clas
s>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.Integer</prim-key-class>
<reentrant>False</reentrant>
<cmp-version>2.x</cmp-version>
<abstract-schema-name>OrganizationEJB</abstract-schema-name>
<cmp-field><field-name>iD</field-name></cmp-field>
<cmp-field><field-name>name</field-name></cmp-field>
<cmp-field><field-name>description</field-name></cmp-field>
<primkey-field>iD</primkey-field>
<resource-ref>
<res-ref-name>jdbc/OrganizationDB</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<query>
<query-method>
<method-name>findAll</method-name>
<method-params></method-params>
</query-method>
<ejb-ql>
<![CDATA[SELECT OBJECT(a) FROM OrganizationEJB AS a]]>
</ejb-ql>
</query>
</entity>
<entity>
<display-name>Job Entity Bean</display-name>
<ejb-name>JobEJB</ejb-name>
<local-home>com.sempire.builder.business_component.JobHome</local-home>
<local>com.sempire.builder.business_component.Job</local>
<ejb-class>com.sempire.builder.business_component.JobBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.Integer</prim-key-class>
<reentrant>False</reentrant>
<cmp-version>2.x</cmp-version>
<abstract-schema-name>JobEJB</abstract-schema-name>
<cmp-field><field-name>iD</field-name></cmp-field>
<cmp-field><field-name>name</field-name></cmp-field>
<cmp-field><field-name>score</field-name></cmp-field>
<cmp-field><field-name>setupCost</field-name></cmp-field>
<primkey-field>iD</primkey-field>
<resource-ref>
<res-ref-name>jdbc/JobDB</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<query>
<query-method>
<method-name>findAll</method-name>
<method-params></method-params>
</query-method>
<ejb-ql>
<![CDATA[SELECT OBJECT(a) FROM JobEJB AS a]]>
</ejb-ql>
</query>
</entity>
</enterprise-beans>
Thanks
Ronak Parekh
Dimitri

Similar Messages

  • Display error page using web.xml error-page

    I need to dispaly error page when IOException in thrown. How to do that with web.xml error-page tag?
    start.jsf
    public String doButton1Action() throws IOException{
              String value = getText1().getValue().toString();
              try {
                   File f = new File(value);          
                   InputStream in = new FileInputStream(f);
              } catch (IOException e) {
                   throw new IOException();
              return "success";
         }I have this in web.xml:
         <error-page>
              <exception-type>java.io.IOException</exception-type>
              <location>/ioerror.jsp</location>
         </error-page>

    I tried that earlier but then I get error just printed to console and HTTP 500 - Internal server error -page, bubt not my errorPage.
    [26.1.2007 21:19:16:543 EET] 00000038 jsf           E com.sun.faces.lifecycle.InvokeApplicationPhase execute #{pc_Start.doButton1Action}: javax.faces.el.EvaluationException: java.io.FileNotFoundException: c:\temp\ghostfile.jpg
                                     javax.faces.FacesException: #{pc_Start.doButton1Action}: javax.faces.el.EvaluationException: java.io.FileNotFoundException: c:\temp\ghostfile.jpg
         at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:79)
         at javax.faces.component.UICommand.broadcast(UICommand.java:312)
         at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:298)
         at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:412)
         at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:77)
         at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:220)
         at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:91)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
         at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:966)
         at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:478)
         at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:463)
         at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:92)
         at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:744)
         at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1433)
         at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:93)
         at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:465)
         at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:394)
         at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:102)
         at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:152)
         at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:213)
         at com.ibm.io.async.AbstractAsyncFuture.fireCompletionActions(AbstractAsyncFuture.java:195)
         at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
         at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:194)
         at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:741)
         at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:863)
         at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1510)
    Caused by: javax.faces.el.EvaluationException: java.io.FileNotFoundException: c:\temp\ghostfile.jpg
         at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:131)
         at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:73)
         ... 25 more

  • Servlet 2.4 web.xml error - Cant load the Schema

    i have coded the web.xml for my application as below,
    i am using Servlet 2.4 and Tomcat 5.5
    when i viewed the same in XML editor, it gave the following error -
    "Can't Load the W3C XML Schema" , cant figure what is the reason for this error. Any help would be greatly appreciated
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app
    xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
    http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
    version="2.4">
         <display-name>Rdp</display-name>
         <servlet>
              <servlet-name>action</servlet-name>
              <servlet-class>com.rdp.util.RDServlet</servlet-class>
              <init-param>
                   <param-name>config</param-name>
                   <param-value>/WEB-INF/config/struts-config.xml</param-value>
              </init-param>
              <init-param>
                   <param-name>debug</param-name>
                   <param-value>2</param-value>
              </init-param>
              <init-param>
                   <param-name>detail</param-name>
                   <param-value>2</param-value>
              </init-param>
              <init-param>
                   <param-name>validate</param-name>
                   <param-value>true</param-value>
              </init-param>
              <init-param>
                   <param-name>programe-name</param-name>
                   <param-value>Rdp</param-value>
              </init-param>
              <init-param>
                   <param-name>application</param-name>
                   <param-value>ApplicationResources</param-value>
              </init-param>                              
              <load-on-startup>2</load-on-startup>
         </servlet>
         <servlet-mapping>
              <servlet-name>action</servlet-name>
              <url-pattern>*.do</url-pattern>
         </servlet-mapping>
         <welcome-file-list>
              <welcome-file>index.html</welcome-file>
              <welcome-file>index.htm</welcome-file>
              <welcome-file>index.jsp</welcome-file>
              <welcome-file>default.html</welcome-file>
              <welcome-file>default.htm</welcome-file>
              <welcome-file>default.jsp</welcome-file>
         </welcome-file-list>
         <taglib>
              <taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
              <taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
         </taglib>
         <taglib>
              <taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
              <taglib-location>/WEB-INF/struts-html.tld</taglib-location>
         </taglib>
         <taglib>
              <taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri>
              <taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
         </taglib>
    </web-app>

    i have coded the web.xml for my application as below,
    i am using Servlet 2.4 and Tomcat 5.5
    when i viewed the same in XML editor, it gave the
    following error -
    "Can't Load the W3C XML Schema" , cant figure what is
    the reason for this error. Any help would be greatly
    appreciated
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app
    xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
    http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
    version="2.4">
    <display-name>Rdp</display-name>
         <servlet>
              <servlet-name>action</servlet-name>
              <servlet-class>com.rdp.util.RDServlet</servlet-class
    >
              <init-param>
                   <param-name>config</param-name>
                   <param-value>/WEB-INF/config/struts-config.xml</par
    am-value>
              </init-param>
              <init-param>
                   <param-name>debug</param-name>
                   <param-value>2</param-value>
              </init-param>
              <init-param>
                   <param-name>detail</param-name>
                   <param-value>2</param-value>
              </init-param>
              <init-param>
                   <param-name>validate</param-name>
                   <param-value>true</param-value>
              </init-param>
              <init-param>
                   <param-name>programe-name</param-name>
                   <param-value>Rdp</param-value>
              </init-param>
              <init-param>
                   <param-name>application</param-name>
                   <param-value>ApplicationResources</param-value>
              </init-param>                              
              <load-on-startup>2</load-on-startup>
         </servlet>
         <servlet-mapping>
              <servlet-name>action</servlet-name>
              <url-pattern>*.do</url-pattern>
         </servlet-mapping>
         <welcome-file-list>
              <welcome-file>index.html</welcome-file>
              <welcome-file>index.htm</welcome-file>
              <welcome-file>index.jsp</welcome-file>
              <welcome-file>default.html</welcome-file>
              <welcome-file>default.htm</welcome-file>
              <welcome-file>default.jsp</welcome-file>
         </welcome-file-list>
         <taglib>
              <taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
              <taglib-location>/WEB-INF/struts-bean.tld</taglib-lo
    cation>
         </taglib>
         <taglib>
              <taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
              <taglib-location>/WEB-INF/struts-html.tld</taglib-lo
    cation>
         </taglib>
         <taglib>
              <taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri>
              <taglib-location>/WEB-INF/struts-logic.tld</taglib-l
    ocation>
         </taglib>
    </web-app>
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee web-app_2_4.xsd"
    version="2.4">
    It looks the schema specified in your application is slightly different or wrong.
    Please correct it !!

  • Error-page in web.xml: error page doesn't show

    Hi,
    I added the following block in web.xml file:
    <error-page>
    <exception-type>java.lang.Exception</exception-type>
    <location>/ESU9098J.jsp</location>
    </error-page>
    When I force an exception, I get a pop-up for downloading a file named EAC0002Se04379bf (where EAC0002S is the name of the servlet in which the exception happens). Can anybody help?
    I use OC4J 10221 on Win Xp with JDK 1.3.1
    Thanks
    Jean

    This is due to a erroneous MIME type mapping in one of the OC4J config files.
    To resolve it:
    Modify mime.types under $OC4J_HOME/config by removing the line application/jsp (for some unknown reason, there are two of them in the file) or renaming the
    word jsp into some other name, ex.:
    "application/jsp jsptemp"
    for both the 2 lines. Then add "jsp" to the end of the "text/html" line, ex.:
    "text/html html htm jsp".
    This will make oc4j use text/html in the response when a jsp file is being processed that's why it's very important to eliminate application/jsp by renaming jsp or simply deleting the line.
    We fixed this error in the config file in a later release.
    cheers
    -steve-

  • Problems with the tag error-page in web.xml

    hi all, here is my code in my web.xml:
    <error-page>
    <exception-type>java.sql.SQLException</exception-type>
    <location>/ex.html</location>
    </error-page>
    it seems not to work, because my JavaBean where its the code to connect to my database and execute a query has an error i made it at purpose to see if the error page works, my JavaBean reports an error: column name not valid but the error-page didn�t work, i use a servlet which instantiates my JavaBean and then my servlet redirects to a JSP, obviouslly if an error occurs my servlet didnt redirect to any place, here is the code into my JavaBean, if anyone could help me i really appreciate it...
    public BeanLista seleccionaCliente()
    int nBandera = 0;
    BeanList lp = new BeanList();
    String cadena = "SELECT CODCLI, APEPATI FROM TESO.CLIENTE WHERE CODCLI like '2001120%' ";
    try
    context = new InitialContext();
    pool = (DataSource)context.lookup("jdbc/PRUEBADS");
    catch (NamingException ne)
    ne.printStackTrace();
    System.out.println("No se ha podido efectuar el Pool de Conexiones");
    try
    cc = pool.getConnection();
    ResultSet rs = cc.createStatement().executeQuery(cadena);
    cc.close();
    while(rs.next())
    BeanPrueba bp = new BeanPrueba();
    bp.setCodcli(rs.getString(1));
    bp.setApepat(rs.getString(2));
    lp.add(bp);
    return lp;
    }catch(SQLException sql){
    System.out.println("A ocurrido un error de SQL");
    System.out.println("Error de SQl capturado como : "+sql.getMessage());
    //sql.printStackTrace();
    return lp;
    }

    Can it be because you are catching your exception? Why don't you try throwing the same exception in the catch block and let the server handle it for you.
    Just a guess... Hope it works.
    VM

  • Using error code in web.xml

    hi I have following servlet ..
    sevlet :
    PrintWriter out = res.getWriter();
    out.println("<p>I will throw a ServletEexception now....</p>");
    //res.sendError(404, "messagge");
    In the above code res.sendError(404, "messagge"); is commented and i get the result as expected, when i call above servlet.
    After that i un-comment res.sendError(404, "messagge"); and get error.jsp, since web.xml contains :
    <error-page>
    <error-code>404</error-code>
    <location>/error.jsp</location>
    </error-page>
    But if i open a different browser and access the above servlet , then i am getting The page cannot be found.
    I am getting the following stack trace(sun app server) :
    [#|2006-06-18T17:12:30.593-0400|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.stream.out|_ThreadID=61;|
    NotifyUtil::java.net.ConnectException: Connection refused: no further information
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:525)
    at com.sun.enterprise.server.ss.ASClientSocketImpl.connect(ASClientSocketImpl.java:175)
    at java.net.Socket.connect(Socket.java:507)
    at java.net.Socket.connect(Socket.java:457)
    at sun.net.NetworkClient.doConnect(NetworkClient.java:157)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:365)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:477)
    at sun.net.www.http.HttpClient.<init>(HttpClient.java:214)
    at sun.net.www.http.HttpClient.New(HttpClient.java:287)
    at sun.net.www.http.HttpClient.New(HttpClient.java:299)
    at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:792)
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:744)
    at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:669)
    at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:836)
    at org.netbeans.modules.web.monitor.server.NotifyUtil$RecordSender.run(NotifyUtil.java:237)
    |#]
    [#|2006-06-18T17:12:31.593-0400|INFO|sun-appserver-pe8.1_02|javax.enterprise.system.stream.out|_ThreadID=62;|
    NotifyUtil::java.net.ConnectException: Connection refused: no further information
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:525)
    at com.sun.enterprise.server.ss.ASClientSocketImpl.connect(ASClientSocketImpl.java:175)
    at java.net.Socket.connect(Socket.java:507)
    at java.net.Socket.connect(Socket.java:457)
    at sun.net.NetworkClient.doConnect(NetworkClient.java:157)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:365)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:477)
    at sun.net.www.http.HttpClient.<init>(HttpClient.java:214)
    at sun.net.www.http.HttpClient.New(HttpClient.java:287)
    at sun.net.www.http.HttpClient.New(HttpClient.java:299)
    at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:792)
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:744)
    at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:669)
    at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:836)
    at org.netbeans.modules.web.monitor.server.NotifyUtil$RecordSender.run(NotifyUtil.java:237)
    |#]---------------------------------------------------------------
    I have tried the same in Tomcat 5 and i am still getting similar problem.
    Any help will be appreciated
    Message was edited by:
    java_do_pro

    Hi my web.xml error entry looks like
    <error-page>
         <error-code>404</error-code>
         <location>/404.jsp</location>
    </error-page>
    Want I want to do is that is user asks for WEB_URL/anypage.jsp or anypage.html
    and if the page does not exist in the web application then the control shall be transfered to the jsp page which will display the error details (and do some processing as well)
    hth,
    Asif

  • Handling 404 error through web.xml

    In my application i made the following entry in web.xml:
      <error-page>
        <error-code>404</error-code>
        <location>/error.jspx</location>
      </error-page>
    error.jspx is a jspx file and exist in the public_html folder and has following entry:
    <f:view>
        <af:document id="d1">
          <af:form id="f1">
          <af:outputText value="Hello There error occured" id="ot_11" />
          </af:form>
        </af:document>
      </f:view>
    when a 404 occurs in the application, i am getting following application in the log:
    <[ServletContext@3806419[app:j2ee-app module:retailer path:/retailer spec-version:2.5]] error-page location: "/error.jspx" for the error-code: "404" does not exist. Serving the default error page.>
    Any suggestion what to do next?

    on more thing,
    404 errors are handled by web.xml using following:
    <error-page>
       <error-code>404</error-code>
       <location>/login/404errorPage404.html</location>
    </error-page>
    but in case of 500 errors or nullpointers i treid a no of options, but neither one  worked:
    <error-page>
    <error-code>500</error-code>
       <location>/login/500errorPage500.html</location>
    </error-page>
    <error-page>
       <exception-type>javax.el.ELException</exception-type>
       <location>/login/500errorPage500.html</location>
    </error-page>
    <error-page>
       <exception-type>java.lang.Exception</exception-type>
       <location>/login/500errorPage500.html</location>
    </error-page>
    <error-page>
       <exception-type>java.lang.Throwable</exception-type>
       <location>/login/500errorPage500.html</location>
    </error-page>
    Any advise?

  • Configure web.xml to redirect on exception

    hi
    I am using creator and its default webServer to check my application.
    I want that if a class throws facesException then my page would be redirected to some failure.jsp
    I addede failure.jsp and the entry is there in managed beans.
    i edited the following in the web.xml
    <error-page>
    <exception-type>javax.faces.FacesException</exception-type>
    <location>/error/ExceptionHandler</location>
    </error-page>
    -------------------------- TO--------------
    <error-page>
    <exception-type>javax.faces.FacesException</exception-type>
    <location>/failure.jsp</location>
    </error-page>
    but now with error(i made the application to throw exception) it shows 404 error.
    i changed the <location>/failure.jsp</location>
    and <location>/web/failure.jsp</location>
    but nothing worked.. I know it works with context root.
    but how can i find what is the context root of deployed application.. how can i make this work .. Suppose my application name is MyWebApp then what path should i give to it.
    thanks

    hi i experience this problem too. e.g. my project name is webapplication
    i try redirecting 404 error to a html page but the webpage cannot be found although i already include the webpage into my "webapplication" folder/web. Please help. Thanks alot!
    <error-page>
    <error-code>404</error-code>
    <url-pattern>/error.html</url-pattern>
    </error-page>
    <error-page>
    <error-code>404</error-code>
    <url-pattern>/faces/error.html</url-pattern>
    </error-page>
    Both also doesnt work. Please help, need it urgently!! thanks in advance!

  • Is this the right exception to put in the web.xml??????

    Hi guys,
    i've a question.
    I've defined a custom error page for my jsf application and now i've to
    define in web.xml how calling this page when it's needed.
    In my application i've some mysql exceptions like
    java.sql.SQLException: Cannot delete or update a parent row: a foreign
    key constraint fails (`microarray/esperimento`, CONSTRAINT
    `FK_RELATIONSHIP_2` FOREIGN KEY (`USERNAME`) REFERENCES `utente`
    (`USERNAME`))
            at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2975)
            at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1600)
            at
    com.mysql.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatemen�t.java:1125) i've defined in this way my web.xml
    <error-page>
      <exception-type>java.sql.SQLException</exception-type>
      <location>/pages/protected/errorDisplay.jsp</location>
    </error-page> but when this exception is throwned i see it in normal stacktrace and
    not in a jsp page.
    Can someone help me solving my problem?
    Thanks

    To report bugs or suggest improvements:
    http://www.adobe.com/cfusion/mmform/index.cfm?name=wishform

  • WEB.XML gives me an error while deploying a Web Application in Weblogic 5.1

    I have a Web.xml which I copied the one from their documentation and edited for my servlet specific data. When I try to deploy it I am getting the following error.
              Wed Nov 15 17:10:37 EST 2000:<E> <HTTP> Error reading Web application 'C:/tomcat
              /webapps/La/'
              java.net.UnknownHostException: java.sun.com
              Can you throw some light on this? I have included the first three lines from the WEB,XML file where weblogic is choking.
              <?xml version="1.0" encoding="UTF-8"?>
              <!DOCTYPE web-app PUBLIC '-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN'
              'http://java.sun.com/j2ee/dtds/webapp_2_2.dtd'>
              Thank You
              Trisula P. Siripurapu
              

              Hi Jacek,
              Thank you for your suggestion. I changed the Web App version to 1.2 instead of 2.2. It worked. Thanks once again for the timely response. I really do appreciate it.
              Trisula Pani Siripurapu.
              Jacek Laskowski <[email protected]> wrote:
              >"Trisula P. Siripurapu" wrote:
              >>
              >> I have a Web.xml which I copied the one from their documentation and edited for my servlet specific data. When I try to deploy it I am getting the following error.
              >> Wed Nov 15 17:10:37 EST 2000:<E> <HTTP> Error reading Web application 'C:/tomcat
              >> /webapps/La/'
              >> java.net.UnknownHostException: java.sun.com
              >
              >I remember having the same problem before I added the latest service
              >pack (SP 6). If you don't want to download it, just change DOCTYPE to
              >
              ><!DOCTYPE web-app PUBLIC '-//Sun Microsystems, Inc.//DTD Web Application
              >1.2//EN' 'http://java.sun.com/j2ee/dtds/webapp_2_2.dtd'>
              >
              >and it should work. Notice the change of Web Application version - 1.2
              >rather then 2.2. I'm (almost) sure, I saw one example - examples/webapp
              >(?) - with this header. Take a look at the accompanying examples.
              >
              >When you apply SP6, things should work as they suppose to.
              >
              >> Trisula P. Siripurapu
              >
              >Jacek Laskowski
              

  • Error trying to update web.xml

    I'm trying to update  web.xml via these instructions:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d0eb8120-b66c-2910-5795-894f384fc054
    The upload fails, and I see this excetpion in the log:
    Caused by: java.rmi.RemoteException: Error occurred during single file update of
           application sap.com/irj. Reason: Updating the security information in the
           deployment descriptors is not allowed in this operation.; nested exception is:
         com.sap.engine.services.servlets_jsp.server.exceptions.WebDeploymentException:
           Updating the security information in the deployment descriptors is not
           allowed in this operation.
    Ideas?  I'm signing in as Administrator, so why would the operation not be allowed?
    This is a 7.0 system, and the instructions are for a nw2004 system.  We've successfully uploaded the web.xml file before, so I'm thinking that something has changed in 7.0 that's preventing the upload.

    This page of the documentation indicates that the technique is the correct case:
    http://help.sap.com/saphelp_nw70/helpdata/en/6e/8590f1d6d349c9adc34c6a8085189b/frameset.htm
    So, one of two things has happened:
    1. The documentation is in error, or
    2. A bug has been introduced.
    I'm hoping it's #2....

  • JDev 10.1.3 compile error in servlet 2.4 web.xml

    I built a Servlet 2.4/JSP 2.0 application in JDev 10.1.3. When I try to make/compile/deploy it the compiler gives me errors like the following for every JSP file that has a JSTL 1.1 taglib:
    Error(2,9): Element "web-app' used but not declared
    Error(2,63): Attribute 'xmlns:xsi' used but not declared
    Error(3,103): Attribute 'xsi:schemaLocation' used but not declared
    Error(4,16): Attribute 'version' used but not declared
    Error(4,56): Attribute 'xmlns' used but not declared
    Error(4,57): Can not build schema 'http://java.sun.com/xml/ns/j2ee' located at 'http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd'
    Error(5,15): Element 'description used but not declared
    It is obviously havng problems with the web.xml file (which is in the servlet 2.4 format) and is probably not finding the web.xml DTD document. How do I fix it?
    Installation is on Solaris 9 using J2SDK 1.4.2_04-b05
    By the way, this system is on a disconnected network. How do I get JDeveloper updates for a system not connected to the Internet?

    Allen,
    A JSP with web.xml web-app element
    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee">
    runs in JDeveloper 10.1.3
    thanks,
    Deepak

  • Error while deploying in web.xml with web-app_2_5.xsd

    Weblogic version 10.3.5 and java is 1.6.0_31
    context root is - "/" (slash)
    Web.xml - old
    has following declaration and works fine
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
    i am trying to change web.xml's web-app definition as below
    Web.xml - new
    <web-app xmlns="http://java.sun.com/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
         version="2.5">
    and to accommodate above change i enclosed all "tag libs" inside <jsp-config> tag which is as per 2.5
    when i try to deploy with above changes, i am getting following error but with old definition i am not getting any error.
    <Error> <Deployer> <clbblr-4423> <StoreFront> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1358234763292> <BEA-149205> <Failed to initialize the application 'shopstr' due to error weblogic.application.ModuleException: Failed to load webapp: '/'.
    weblogic.application.ModuleException: Failed to load webapp: '/'
         at weblogic.servlet.internal.WebAppModule.prepare(WebAppModule.java:393)
         at weblogic.application.internal.flow.ScopedModuleDriver.prepare(ScopedModuleDriver.java:176)
         at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:199)
         at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:517)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
         at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:159)
         at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:45)
         at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:613)
    Caused By: java.lang.ClassNotFoundException: atg.web.tagsupport.CollectionTagSupport
         at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:297)
         at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:270)
         at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:64)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
         at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:179)
         at weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAwareClassLoader.java:43)
         at java.lang.ClassLoader.defineClass1(Native Method)
    Would appreciate suggestions. Thanks

    added JAR file pwsTaglib2_0.jar and now problems are resolved. will open this thread if i see any other error

  • Validation error when using env-entry in web.xml

    I've added an env-entry element to my web.xml and it falls over at deploy time with a validation error. However, from what I can see, this is valid based on the schema.
    And infact, it matches the example in the weblogic doco - http://edocs.bea.com/wls/docs103/webapp/web_xml.html#wp1025195
    The error I'm getting is:
    <17/12/2008 11:45:56 AM EST> <Error> <J2EE> <BEA-160197> <Unable to load descriptor D:\workspace\source_checkout\investment_control\ic-web\src\main\webapp/WEB-INF/web.xml of module ic-web.war. The error is weblogic.descriptor.DescriptorException: VALIDATION PROBLEMS WERE FOUND
    problem: cvc-complex-type.2.4a: Expected elements 'mapped-name@http://java.sun.com/xml/ns/javaee injection-target@http://java.sun.com/xml/ns/javaee' instead of 'env-entry-type@http://java.sun.com/xml/ns/javaee' here in element env-entry@http://java.sun.com/xml/ns/javaee:<null>
         at weblogic.descriptor.internal.MarshallerFactory$1.evaluateResults(MarshallerFactory.java:234)
         at weblogic.descriptor.internal.MarshallerFactory$1.evaluateResults(MarshallerFactory.java:221)
    My web.xml looks like:
    <web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
         version="2.5">
         <description>IC Web</description>
         <env-entry>
              <env-entry-name>aEntry</env-entry-name>
              <env-entry-value>aValue</env-entry-value>
              <env-entry-type>java.lang.String</env-entry-type>
         </env-entry>
    </web-app>
    Any suggestions???

    Found a resolution to this in the end.
    Unless you have the sub-elements in the order below, it will get validation errors.
    <env-entry>
    <env-entry-name>maxAmount</env-entry-name>
    <env-entry-type>java.lang.String</env-entry-type>
    <env-entry-value>aString</env-entry-value>
    </env-entry>
    A bit weird and very frustrating....

  • Web.xml parsing error

    Hello,
    I am a newbie to servlet programming. I am using Tomcat4.1.24. When I
    am trying out some examples, I got a bunch of parsing errors. After double-checking my web.xml, I still do not see why it caused so many parsing errors. I am using NotePad to edit web.xml, does that affect this? These errors are always about the last line and the last column.
    Very weird. Please help.
    web.xml
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
    <display-name>Welcome to Tomcat</display-name>
    <description>
    Welcome to Tomcat
    </description>
    <servlet>
         <servlet-name>HelloWorld</servlet-name>
         <servlet-class>HelloWorld</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>HelloWorld</servlet-name>
    <url-pattern>*.myservlet</url-pattern>
    </servlet-mapping>
    <servlet>
         <servlet-name>Primes</servlet-name>
         <servlet-class>coreservlets.Primes</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>Primes</servlet-name>
    <url-pattern>*.do</url-pattern>
    </servlet-mapping>
    </web-app>
    [ERROR] Digester - -Parse Error at line 29 column 11: The content of element typ
    e "web-app" must match "(icon?,display-name?,description?,distributable?,context
    -param*,filter*,filter-mapping*,listener*,servlet*,servlet-mapping*,session-conf
    ig?,mime-mapping*,welcome-file-list?,error-page*,taglib*,resource-env-ref*,resou
    rce-ref*,security-constraint*,login-config?,security-role*,env-entry*,ejb-ref*,e
    jb-local-ref*)". <org.xml.sax.SAXParseException: The content of element type "we
    b-app" must match "(icon?,display-name?,description?,distributable?,context-para
    m*,filter*,filter-mapping*,listener*,servlet*,servlet-mapping*,session-config?,m
    ime-mapping*,welcome-file-list?,error-page*,taglib*,resource-env-ref*,resource-r
    ef*,security-constraint*,login-config?,security-role*,env-entry*,ejb-ref*,ejb-lo
    cal-ref*)".>

    Hi.
    The answer is rather simple. The file is not valid against the XML v.1.0 standard. That's because all <servlet> elements must come first before all <servlet-mapping> elements. If you change the order of the Primes <servlet> element, the file is valid and Tomcat should not throw an exception.
    This is the correct web deployment descriptor:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
    <display-name>Welcome to Tomcat</display-name>
    <description>
    Welcome to Tomcat
    </description>
    <servlet>
    <servlet-name>HelloWorld</servlet-name>
    <servlet-class>HelloWorld</servlet-class>
    </servlet>
    <servlet>
    <servlet-name>Primes</servlet-name>
    <servlet-class>coreservlets.Primes</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>HelloWorld</servlet-name>
    <url-pattern>*.myservlet</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>Primes</servlet-name>
    <url-pattern>*.do</url-pattern>
    </servlet-mapping>
    </web-app>

Maybe you are looking for