<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">
<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>
                                <td>
                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="https://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>
                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px; -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
JSF and datasource problem
</h3>
<span style="margin-bottom: 10px;">
created by <a href="https://community.jboss.org/people/vmaric">Vladica Maric</a> in <i>Beginner's Corner</i> - <a href="https://community.jboss.org/message/778806#778806">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><p>I make JSF beginner's aplikacation and goal is that with index.html simply <span class="short_text" id="result_box" lang="en"><span class="hps">present the content of database table.</span></span></p><p><span class="short_text" lang="en"><span class="hps">I make customerBean.java for connecting and read content of datatable.</span></span></p><p><span id="result_box" lang="en"><span class="hps">I handling</span> <span class="hps">connection over datasource:</span></span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Database is Derby .</p><p>I made datsourc in jboss7.1 standalone and I can ping database.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>@Resource(name="java:/MyDerby", type=DataSource.class)</p><p>    private DataSource ds;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Is it correct that JDNI for @Resource written above?  </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>I made datsourc in jboss7.1 standalone and I can ping database.</p><p><span class="short_text" id="result_box" lang="en"><br/><span class="hps">But</span> <span class="hps">when I start aplication on server I have got error on web server with code http status 500.</span></span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>***************************************************************************************************************</p><p><span class="short_text" lang="en"><span class="hps">**************************Here is logs from web browser:</span></span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><h1>HTTP Status 500 - </h1><hr noshade="noshade" size="1"/><p><strong>type</strong> Exception report</p><p><strong>message</strong> </p><p><strong>description</strong> <span style="text-decoration: underline;">The server encountered an internal error () that prevented it from fulfilling this request.</span></p><p><strong>exception</strong> </p><pre class="jive-pre">javax.servlet.ServletException: Unexpected error processing managed bean customerBean javax.faces.webapp.FacesServlet.service(FacesServlet.java:606) </pre><p><strong>root cause</strong> </p><pre class="jive-pre">com.sun.faces.mgbean.ManagedBeanPreProcessingException: Unexpected error processing managed bean <br/>customerBean com.sun.faces.mgbean.BeanManager.preProcessBean(BeanManager.java:398)<br/> com.sun.faces.mgbean.BeanManager.create(BeanManager.java:262) com.sun.faces.el.ManagedBeanELResolver.resolveBean(ManagedBeanELResolver.java:244)<br/> com.sun.faces.el.ManagedBeanELResolver.getValue(ManagedBeanELResolver.java:116) <br/>com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176) com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203) org.apache.el.parser.AstIdentifier.getValue(AstIdentifier.java:72) org.apache.el.parser.AstValue.getValue(AstValue.java:147) org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:189) com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:109) javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:194) javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:182) javax.faces.component.UIData.getValue(UIData.java:731) javax.faces.component.UIData.getDataModel(UIData.java:1798) javax.faces.component.UIData.setRowIndexWithoutRowStatePreserved(UIData.java:484) javax.faces.component.UIData.setRowIndex(UIData.java:473) com.sun.faces.renderkit.html_basic.TableRenderer.encodeBegin(TableRenderer.java:81) javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:820) javax.faces.component.UIData.encodeBegin(UIData.java:1118) javax.faces.component.UIComponent.encodeAll(UIComponent.java:1777) javax.faces.render.Renderer.encodeChildren(Renderer.java:168) javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:845) javax.faces.component.UIComponent.encodeAll(UIComponent.java:1779) javax.faces.component.UIComponent.encodeAll(UIComponent.java:1782) javax.faces.component.UIComponent.encodeAll(UIComponent.java:1782) com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:402) com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:125) com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121) com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139) javax.faces.webapp.FacesServlet.service(FacesServlet.java:594) </pre><p><strong>root cause</strong> </p><pre class="jive-pre">com.sun.faces.mgbean.ManagedBeanPreProcessingException: Unexpected error processing managed property customerList <br/>com.sun.faces.mgbean.ManagedBeanBuilder.bake(ManagedBeanBuilder.java:117) com.sun.faces.mgbean.BeanManager.preProcessBean(BeanManager.java:353)<br/>com.sun.faces.mgbean.BeanManager.create(BeanManager.java:262) com.sun.faces.el.ManagedBeanELResolver.resolveBean(ManagedBeanELResolver.java:244) <br/>com.sun.faces.el.ManagedBeanELResolver.getValue(ManagedBeanELResolver.java:116) com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176) com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203) org.apache.el.parser.AstIdentifier.getValue(AstIdentifier.java:72) org.apache.el.parser.AstValue.getValue(AstValue.java:147) org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:189) com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:109) javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:194) javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:182) javax.faces.component.UIData.getValue(UIData.java:731) javax.faces.component.UIData.getDataModel(UIData.java:1798) javax.faces.component.UIData.setRowIndexWithoutRowStatePreserved(UIData.java:484) javax.faces.component.UIData.setRowIndex(UIData.java:473) com.sun.faces.renderkit.html_basic.TableRenderer.encodeBegin(TableRenderer.java:81) javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:820) javax.faces.component.UIData.encodeBegin(UIData.java:1118) javax.faces.component.UIComponent.encodeAll(UIComponent.java:1777) javax.faces.render.Renderer.encodeChildren(Renderer.java:168) javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:845) javax.faces.component.UIComponent.encodeAll(UIComponent.java:1779) javax.faces.component.UIComponent.encodeAll(UIComponent.java:1782) javax.faces.component.UIComponent.encodeAll(UIComponent.java:1782) com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:402) com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:125) com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121) com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139) javax.faces.webapp.FacesServlet.service(FacesServlet.java:594) </pre><p><strong>root cause</strong> </p><pre class="jive-pre">java.lang.NullPointerException com.sun.faces.mgbean.ManagedBeanBuilder.bakeBeanProperty(ManagedBeanBuilder.java:350) <br/>com.sun.faces.mgbean.ManagedBeanBuilder.bake(ManagedBeanBuilder.java:107) com.sun.faces.mgbean.BeanManager.preProcessBean(BeanManager.java:353) <br/>com.sun.faces.mgbean.BeanManager.create(BeanManager.java:262) com.sun.faces.el.ManagedBeanELResolver.resolveBean(ManagedBeanELResolver.java:244) <br/>com.sun.faces.el.ManagedBeanELResolver.getValue(ManagedBeanELResolver.java:116) com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176) com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203) org.apache.el.parser.AstIdentifier.getValue(AstIdentifier.java:72) org.apache.el.parser.AstValue.getValue(AstValue.java:147) org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:189) com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:109) javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:194) javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:182) javax.faces.component.UIData.getValue(UIData.java:731) javax.faces.component.UIData.getDataModel(UIData.java:1798) javax.faces.component.UIData.setRowIndexWithoutRowStatePreserved(UIData.java:484) javax.faces.component.UIData.setRowIndex(UIData.java:473) com.sun.faces.renderkit.html_basic.TableRenderer.encodeBegin(TableRenderer.java:81) javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:820) javax.faces.component.UIData.encodeBegin(UIData.java:1118) javax.faces.component.UIComponent.encodeAll(UIComponent.java:1777) javax.faces.render.Renderer.encodeChildren(Renderer.java:168) javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:845) javax.faces.component.UIComponent.encodeAll(UIComponent.java:1779) javax.faces.component.UIComponent.encodeAll(UIComponent.java:1782) javax.faces.component.UIComponent.encodeAll(UIComponent.java:1782) com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:402) com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:125) com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121) com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139) javax.faces.webapp.FacesServlet.service(FacesServlet.java:594) </pre><p><strong>note</strong> <span style="text-decoration: underline;">The full stack trace of the root cause is available in the JBoss Web/7.0.13.Final logs.</span></p><hr noshade="noshade" size="1"/><h3>JBoss Web/7.0.13.Final</h3><p><span class="short_text" lang="en"><span class="hps"><br/></span></span></p><p>****************************************************************************************</p><p><span id="result_box" lang="en"><span class="hps">********My</span> <span class="hps">logs</span> <span class="hps">as they are in</span> <span class="hps">the console </span></span><span id="result_box" lang="en"><span class="hps">my</span> <span class="hps">logs</span> <span class="hps">when I dodeploy project</span></span><span id="result_box" lang="en"><span class="hps">:</span></span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>12:01:02,036 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015876: Starting deployment of "BaseProba1.war"</p><p>12:01:02,599 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-1) Class Path entry derbyLocale_cs.jar in "/C:/jboss-as-7.1.1.Final/standalone/deployments/BaseProba1.war/WEB-INF/lib/derbyclient.jar"  does not point to a valid jar for a Class-Path reference.</p><p>12:01:02,614 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-1) Class Path entry derbyLocale_de_DE.jar in "/C:/jboss-as-7.1.1.Final/standalone/deployments/BaseProba1.war/WEB-INF/lib/derbyclient.jar"  does not point to a valid jar for a Class-Path reference.</p><p>12:01:02,614 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-1) Class Path entry derbyLocale_es.jar in "/C:/jboss-as-7.1.1.Final/standalone/deployments/BaseProba1.war/WEB-INF/lib/derbyclient.jar"  does not point to a valid jar for a Class-Path reference.</p><p>12:01:02,614 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-1) Class Path entry derbyLocale_fr.jar in "/C:/jboss-as-7.1.1.Final/standalone/deployments/BaseProba1.war/WEB-INF/lib/derbyclient.jar"  does not point to a valid jar for a Class-Path reference.</p><p>12:01:02,614 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-1) Class Path entry derbyLocale_hu.jar in "/C:/jboss-as-7.1.1.Final/standalone/deployments/BaseProba1.war/WEB-INF/lib/derbyclient.jar"  does not point to a valid jar for a Class-Path reference.</p><p>12:01:02,630 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-1) Class Path entry derbyLocale_it.jar in "/C:/jboss-as-7.1.1.Final/standalone/deployments/BaseProba1.war/WEB-INF/lib/derbyclient.jar"  does not point to a valid jar for a Class-Path reference.</p><p>12:01:02,630 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-1) Class Path entry derbyLocale_ja_JP.jar in "/C:/jboss-as-7.1.1.Final/standalone/deployments/BaseProba1.war/WEB-INF/lib/derbyclient.jar"  does not point to a valid jar for a Class-Path reference.</p><p>12:01:02,630 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-1) Class Path entry derbyLocale_ko_KR.jar in "/C:/jboss-as-7.1.1.Final/standalone/deployments/BaseProba1.war/WEB-INF/lib/derbyclient.jar"  does not point to a valid jar for a Class-Path reference.</p><p>12:01:02,630 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-1) Class Path entry derbyLocale_pl.jar in "/C:/jboss-as-7.1.1.Final/standalone/deployments/BaseProba1.war/WEB-INF/lib/derbyclient.jar"  does not point to a valid jar for a Class-Path reference.</p><p>12:01:02,630 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-1) Class Path entry derbyLocale_pt_BR.jar in "/C:/jboss-as-7.1.1.Final/standalone/deployments/BaseProba1.war/WEB-INF/lib/derbyclient.jar"  does not point to a valid jar for a Class-Path reference.</p><p>12:01:02,630 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-1) Class Path entry derbyLocale_ru.jar in "/C:/jboss-as-7.1.1.Final/standalone/deployments/BaseProba1.war/WEB-INF/lib/derbyclient.jar"  does not point to a valid jar for a Class-Path reference.</p><p>12:01:02,630 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-1) Class Path entry derbyLocale_zh_CN.jar in "/C:/jboss-as-7.1.1.Final/standalone/deployments/BaseProba1.war/WEB-INF/lib/derbyclient.jar"  does not point to a valid jar for a Class-Path reference.</p><p>12:01:02,630 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-1) Class Path entry derbyLocale_zh_TW.jar in "/C:/jboss-as-7.1.1.Final/standalone/deployments/BaseProba1.war/WEB-INF/lib/derbyclient.jar"  does not point to a valid jar for a Class-Path reference.</p><p>12:01:02,927 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015893: Encountered invalid class name 'com.sun.faces.vendor.Tomcat6InjectionProvider:org.apache.catalina.util.DefaultAnnotationProcessor' for service type 'com.sun.faces.spi.injectionprovider'</p><p>12:01:02,927 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015893: Encountered invalid class name 'com.sun.faces.vendor.Jetty6InjectionProvider:org.mortbay.jetty.plus.annotation.InjectionCollection' for service type 'com.sun.faces.spi.injectionprovider'</p><p><strong>12:01:03,536 WARN  [org.jboss.as.ee] (MSC service thread 1-4) JBAS011001: Could not resolve resource-env-ref java:/MyDerby</strong></p><p>12:01:03,786 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-4) JBAS010403: Deploying JDBC-compliant driver class org.apache.derby.jdbc.ClientDriver (version 10.9)</p><p>12:01:03,911 INFO  [org.apache.catalina.core.StandardContext] (MSC service thread 1-1) The listener "com.sun.faces.config.ConfigureListener" is already configured for this context. The duplicate definition has been ignored.</p><p>12:01:03,958 INFO  [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-1) Initializing Mojarra 2.1.7-jbossorg-1 (20120227-1401) for context '/BaseProba1'</p><p>12:01:05,521 INFO  [org.hibernate.validator.util.Version] (MSC service thread 1-1) Hibernate Validator 4.2.0.Final</p><p><strong>12:01:05,630 WARNING [javax.enterprise.resource.webcontainer.jsf.managedbean] (MSC service thread 1-1) JSF1074: Managed bean named 'customerBean' has already been registered.  Replacing existing managed bean class type corejsf.CustomerBean with corejsf.CustomerBean.</strong></p><p>12:01:06,021 INFO  [org.jboss.web] (MSC service thread 1-1) JBAS018210: Registering web context: /BaseProba1</p><p>12:01:06,177 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018559: Deployed "BaseProba1.war"</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span class="short_text" lang="en"><span class="hps">I copied earlier derbyclient.jar file in /WEB-INF/lib/ dir in eclipse is that wrong???</span></span></p><p><span class="short_text" lang="en"><span class="hps">*********And what mean bolded message:</span></span></p><p><br/><strong>12:01:03,536 WARN  [org.jboss.as.ee] (MSC service thread 1-4) JBAS011001: Could not resolve resource-env-ref java:/MyDerby</strong></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>********and another message:</p><p><br/><strong>12:01:05,630 WARNING [javax.enterprise.resource.webcontainer.jsf.managedbean] (MSC service thread 1-1) JSF1074: Managed bean named 'customerBean' has already been registered.  Replacing existing managed bean class type corejsf.CustomerBean with corejsf.CustomerBean.</strong></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><strong>Please help me!!!<br/></strong></p></div>
<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
<p style="margin: 0;">Reply to this message by <a href="https://community.jboss.org/message/778806#778806">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in Beginner's Corner at <a href="https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2075">Community</a></p>
</div></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>