This week's book giveaway is in the Spring forum.
We're giving away four copies of Spring in Action (5th edition) and have Craig Walls on-line!
See this thread for details.
Win a copy of Spring in Action (5th edition) this week in the Spring forum!

carol wind

Greenhorn
+ Follow
since Mar 07, 2013
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by carol wind

Servlet.service() for servlet [jsp] in context with path [/rsglxt] threw exception [java.lang.IllegalStateException: getOutputStream() has already been called for this response] with root cause
java.lang.IllegalStateException: getOutputStream() has already been called for this response
at org.apache.catalina.connector.Response.getWriter(R esponse.java:639)
at org.apache.catalina.connector.ResponseFacade.getWr iter(ResponseFacade.java:214)
at org.apache.jasper.runtime.JspWriterImpl.initOut(Js pWriterImpl.java:125)
at org.apache.jasper.runtime.JspWriterImpl.flushBuffe r(JspWriterImpl.java:118)
at org.apache.jasper.runtime.PageContextImpl.release( PageContextImpl.java:190)
at org.apache.jasper.runtime.JspFactoryImpl.internalR eleasePageContext(JspFactoryImpl.java:126)
at org.apache.jasper.runtime.JspFactoryImpl.releasePa geContext(JspFactoryImpl.java:80)
at org.apache.jsp.yanzhengma_jsp._jspService(yanzheng ma_jsp.java:138)
at org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:728)
at org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:432)
at org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:390)
at org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:334)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:728)
at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:210)
at org.apache.struts2.dispatcher.ActionContextCleanUp .doFilter(ActionContextCleanUp.java:99)
at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:210)
at org.apache.struts2.dispatcher.FilterDispatcher.doF ilter(FilterDispatcher.java:413)
at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBas e.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(A ccessLogValve.java:936)
at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.p rocess(AbstractHttp11Processor.java:1004)
at org.apache.coyote.AbstractProtocol$AbstractConnect ionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProce ssor.run(JIoEndpoint.java:312)
at java.util.concurrent.ThreadPoolExecutor.runWorker( Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (Unknown Source)
at java.lang.Thread.run(Unknown Source)

My server.xml:

<Context path="/rsglxt" docBase="D:\Users\wind\workspace\rsglxt"
debug="5" reloadable="true" crossContext="true" workDir="D:\Users\wind\workspace\rsglxt\work">
<Resource name="jdbc/rsglxt"
auth="Container"
type="javax.sql.DataSource"
maxActive="100" maxIdle="30" maxWait="10000"
username="admin" password="123456"
driverClassName="com.microsoft.sqlserver.jdbc.SQLS erverDriver"
url="jdbc:sqlserver://localhost:1433;DatabaseName=tempdb"/>
</Context>

I have tested connect sqlserver successfully by odbc data source. But I log in from homepage of my java programe, it shows this error.
5 years ago
org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [Faces Servlet] in context with path [/jdyd] threw exception [/nowOrder.jsp (line: 58, column: 16) A literal value was specified for attribute actionListener that is defined as a deferred method with a return type of void. JSP.2.3.4 does not permit literal values in this case] with root cause
org.apache.jasper.JasperException: /nowOrder.jsp (line: 58, column: 16) A literal value was specified for attribute actionListener that is defined as a deferred method with a return type of void. JSP.2.3.4 does not permit literal values in this case
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:42)
at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:408)
at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:149)
at org.apache.jasper.compiler.Validator$ValidateVisitor.checkXmlAttributes(Validator.java:1151)
at org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:875)
at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1539)
at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2376)
at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2428)
at org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:894)
at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1539)
at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2376)
at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2428)
at org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:894)
at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1539)
at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2376)
at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2428)
at org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:894)
at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1539)
at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2376)
at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2428)
at org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:894)
at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1539)
at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2376)
at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2428)
at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2434)
at org.apache.jasper.compiler.Node$Root.accept(Node.java:475)
at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2376)
at org.apache.jasper.compiler.Validator.validateExDirectives(Validator.java:1795)
at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:217)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:373)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:353)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:340)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:646)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:749)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:487)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:412)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:339)
at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:546)
at com.sun.faces.application.view.JspViewHandlingStrategy.executePageToBuildView(JspViewHandlingStrategy.java:363)
at com.sun.faces.application.view.JspViewHandlingStrategy.buildView(JspViewHandlingStrategy.java:153)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:100)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:594)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

My web.xml:

<?xml version="1.0" encoding="GBK"?>
<web-app version="2.4" 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">

<resource-ref>
<description>DB Connection</description>
<res-ref-name>jdbc/jdyd</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>

<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/appcontext.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoade rListener</listener-class>
</listener>


<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>

<welcome-file-list>
<welcome-file>
forward.jsp
</welcome-file>
</welcome-file-list>
</web-app>

My server.xml:

<Context path="/jdyd" docBase="jdyd"
debug="5" reloadable="true" crossContext="true" workDir="">
<Resource name="jdbc/jdyd"
auth="Container"
type="javax.sql.DataSource"
maxActive="100" maxIdle="30" maxWait="10000"
username="sys" password="123456"
driverClassName="oracle.jdbc.driver.OracleDriver" url="jdbcracle:thin:@192.168.100.195:1521rcl"/>
</Context>
5 years ago
JSF
SEVERE: Servlet.service() for servlet [Faces Servlet] in context with path [/SecondHandHouse] threw exception [null] with root cause
java.lang.IllegalArgumentException
at com.sun.faces.renderkit.SelectItemsIterator.initia lizeItems(SelectItemsIterator.java:216)
at com.sun.faces.renderkit.SelectItemsIterator.hasNex t(SelectItemsIterator.java:135)
at com.sun.faces.renderkit.html_basic.MenuRenderer.re nderOptions(MenuRenderer.java:762)
at com.sun.faces.renderkit.html_basic.MenuRenderer.re nderSelect(MenuRenderer.java:844)
at com.sun.faces.renderkit.html_basic.MenuRenderer.en codeEnd(MenuRenderer.java:298)
at javax.faces.component.UIComponentBase.encodeEnd(UI ComponentBase.java:875)
at javax.faces.component.UIComponent.encodeAll(UIComp onent.java:1786)
at javax.faces.render.Renderer.encodeChildren(Rendere r.java:168)
at javax.faces.component.UIComponentBase.encodeChildr en(UIComponentBase.java:845)
at javax.faces.component.UIComponent.encodeAll(UIComp onent.java:1779)
at javax.faces.component.UIComponent.encodeAll(UIComp onent.java:1782)
at com.sun.faces.application.view.JspViewHandlingStra tegy.doRenderView(JspViewHandlingStrategy.java:431 )
at com.sun.faces.application.view.JspViewHandlingStra tegy.renderView(JspViewHandlingStrategy.java:232)
at com.sun.faces.application.view.MultiViewHandler.re nderView(MultiViewHandler.java:124)
at com.sun.faces.lifecycle.RenderResponsePhase.execut e(RenderResponsePhase.java:121)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:1 01)
at com.sun.faces.lifecycle.LifecycleImpl.render(Lifec ycleImpl.java:139)
at javax.faces.webapp.FacesServlet.service(FacesServl et.java:594)
at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBas e.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(A ccessLogValve.java:936)
at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.p rocess(AbstractHttp11Processor.java:1004)
at org.apache.coyote.AbstractProtocol$AbstractConnect ionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProce ssor.run(JIoEndpoint.java:312)
at java.util.concurrent.ThreadPoolExecutor.runWorker( Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (Unknown Source)
at java.lang.Thread.run(Unknown Source)

The page can't open:

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
javax.faces.webapp.FacesServlet.service(FacesServl et.java:606)
root cause

java.lang.IllegalArgumentException
com.sun.faces.renderkit.SelectItemsIterator.initia lizeItems(SelectItemsIterator.java:216)
com.sun.faces.renderkit.SelectItemsIterator.hasNex t(SelectItemsIterator.java:135)
com.sun.faces.renderkit.html_basic.MenuRenderer.re nderOptions(MenuRenderer.java:762)
com.sun.faces.renderkit.html_basic.MenuRenderer.re nderSelect(MenuRenderer.java:844)
com.sun.faces.renderkit.html_basic.MenuRenderer.en codeEnd(MenuRenderer.java:298)
javax.faces.component.UIComponentBase.encodeEnd(UI ComponentBase.java:875)
javax.faces.component.UIComponent.encodeAll(UIComp onent.java:1786)
javax.faces.render.Renderer.encodeChildren(Rendere r.java:168)
javax.faces.component.UIComponentBase.encodeChildr en(UIComponentBase.java:845)
javax.faces.component.UIComponent.encodeAll(UIComp onent.java:1779)
javax.faces.component.UIComponent.encodeAll(UIComp onent.java:1782)
com.sun.faces.application.view.JspViewHandlingStra tegy.doRenderView(JspViewHandlingStrategy.java:431 )
com.sun.faces.application.view.JspViewHandlingStra tegy.renderView(JspViewHandlingStrategy.java:232)
com.sun.faces.application.view.MultiViewHandler.re nderView(MultiViewHandler.java:124)
com.sun.faces.lifecycle.RenderResponsePhase.execut e(RenderResponsePhase.java:121)
com.sun.faces.lifecycle.Phase.doPhase(Phase.java:1 01)
com.sun.faces.lifecycle.LifecycleImpl.render(Lifec ycleImpl.java:139)
javax.faces.webapp.FacesServlet.service(FacesServl et.java:594)
note The full stack trace of the root cause is available in the Apache Tomcat/7.0.34 logs.

My web.xml:

<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app version="2.4" 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">

<resource-ref>
<description>DB Connection</description>
<res-ref-name>jdbc/secondHandHouse</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>

<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/appcontext.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoade rListener</listener-class>
</listener>


<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>Nav.jsp</welcome-file>
</welcome-file-list>
</web-app>


My Tomcat7.0 server.xml:

..........
<Context path="/SecondHandHouse" docBase="D:\Users\wind\workspace\SecondHandHouse"
reloadable="true" crossContext="true" workDir="D:\Users\wind\workspace\SecondHandHouse\w ork">
<Resource name="jdbc/secondHandHouse"
auth="Container"
type="javax.sql.DataSource"
maxActive="100" maxIdle="30" maxWait="10000"
username="root" password="123456"
driverClassName="org.gjt.mm.mysql.Driver"
url="jdbc:mysql://localhost/test"/>
</Context>
...........
5 years ago
JSF
SEVERE: Servlet.service() for servlet [Faces Servlet] in context with path [/SecondHandHouse] threw exception [null] with root cause
java.lang.IllegalArgumentException
at com.sun.faces.renderkit.SelectItemsIterator.initia lizeItems(SelectItemsIterator.java:216)
at com.sun.faces.renderkit.SelectItemsIterator.hasNex t(SelectItemsIterator.java:135)
at com.sun.faces.renderkit.html_basic.MenuRenderer.re nderOptions(MenuRenderer.java:762)
at com.sun.faces.renderkit.html_basic.MenuRenderer.re nderSelect(MenuRenderer.java:844)
at com.sun.faces.renderkit.html_basic.MenuRenderer.en codeEnd(MenuRenderer.java:298)
at javax.faces.component.UIComponentBase.encodeEnd(UI ComponentBase.java:875)
at javax.faces.component.UIComponent.encodeAll(UIComp onent.java:1786)
at javax.faces.render.Renderer.encodeChildren(Rendere r.java:168)
at javax.faces.component.UIComponentBase.encodeChildr en(UIComponentBase.java:845)
at javax.faces.component.UIComponent.encodeAll(UIComp onent.java:1779)
at javax.faces.component.UIComponent.encodeAll(UIComp onent.java:1782)
at com.sun.faces.application.view.JspViewHandlingStra tegy.doRenderView(JspViewHandlingStrategy.java:431 )
at com.sun.faces.application.view.JspViewHandlingStra tegy.renderView(JspViewHandlingStrategy.java:232)
at com.sun.faces.application.view.MultiViewHandler.re nderView(MultiViewHandler.java:124)
at com.sun.faces.lifecycle.RenderResponsePhase.execut e(RenderResponsePhase.java:121)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:1 01)
at com.sun.faces.lifecycle.LifecycleImpl.render(Lifec ycleImpl.java:139)
at javax.faces.webapp.FacesServlet.service(FacesServl et.java:594)
at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBas e.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(A ccessLogValve.java:936)
at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.p rocess(AbstractHttp11Processor.java:1004)
at org.apache.coyote.AbstractProtocol$AbstractConnect ionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProce ssor.run(JIoEndpoint.java:312)
at java.util.concurrent.ThreadPoolExecutor.runWorker( Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (Unknown Source)
at java.lang.Thread.run(Unknown Source)

The page can't open:

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
javax.faces.webapp.FacesServlet.service(FacesServl et.java:606)
root cause

java.lang.IllegalArgumentException
com.sun.faces.renderkit.SelectItemsIterator.initia lizeItems(SelectItemsIterator.java:216)
com.sun.faces.renderkit.SelectItemsIterator.hasNex t(SelectItemsIterator.java:135)
com.sun.faces.renderkit.html_basic.MenuRenderer.re nderOptions(MenuRenderer.java:762)
com.sun.faces.renderkit.html_basic.MenuRenderer.re nderSelect(MenuRenderer.java:844)
com.sun.faces.renderkit.html_basic.MenuRenderer.en codeEnd(MenuRenderer.java:298)
javax.faces.component.UIComponentBase.encodeEnd(UI ComponentBase.java:875)
javax.faces.component.UIComponent.encodeAll(UIComp onent.java:1786)
javax.faces.render.Renderer.encodeChildren(Rendere r.java:168)
javax.faces.component.UIComponentBase.encodeChildr en(UIComponentBase.java:845)
javax.faces.component.UIComponent.encodeAll(UIComp onent.java:1779)
javax.faces.component.UIComponent.encodeAll(UIComp onent.java:1782)
com.sun.faces.application.view.JspViewHandlingStra tegy.doRenderView(JspViewHandlingStrategy.java:431 )
com.sun.faces.application.view.JspViewHandlingStra tegy.renderView(JspViewHandlingStrategy.java:232)
com.sun.faces.application.view.MultiViewHandler.re nderView(MultiViewHandler.java:124)
com.sun.faces.lifecycle.RenderResponsePhase.execut e(RenderResponsePhase.java:121)
com.sun.faces.lifecycle.Phase.doPhase(Phase.java:1 01)
com.sun.faces.lifecycle.LifecycleImpl.render(Lifec ycleImpl.java:139)
javax.faces.webapp.FacesServlet.service(FacesServl et.java:594)
note The full stack trace of the root cause is available in the Apache Tomcat/7.0.34 logs.

My web.xml:

<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app version="2.4" 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">

<resource-ref>
<description>DB Connection</description>
<res-ref-name>jdbc/secondHandHouse</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>

<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/appcontext.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoade rListener</listener-class>
</listener>


<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>Nav.jsp</welcome-file>
</welcome-file-list>
</web-app>


My Tomcat7.0 server.xml:

..........
<Context path="/SecondHandHouse" docBase="D:\Users\wind\workspace\SecondHandHouse"
reloadable="true" crossContext="true" workDir="D:\Users\wind\workspace\SecondHandHouse\w ork">
<Resource name="jdbc/secondHandHouse"
auth="Container"
type="javax.sql.DataSource"
maxActive="100" maxIdle="30" maxWait="10000"
username="root" password="123456"
driverClassName="org.gjt.mm.mysql.Driver"
url="jdbc:mysql://localhost/test"/>
</Context>
...........
5 years ago
JSP