2 Replies Latest reply on Apr 7, 2011 8:44 AM by Ohm Samkoses

    Could not instantiate Seam component (Seam 2.2.1 + Websphere 7.0)

    Ohm Samkoses Newbie
      "*
      = ||I am completely Newbie in Seam and I'm suffering with this error for a while. These are my environments and errors. Hope someone could help me out of this misery..

      Webserver : IBM Websphere 7.0
      Seam Version : Seam 2.2.1 Final
      IDE : RAD 7.5.4
      JBoss Webtool Version : 3.0

      After tried to print out data from database. I get this error:|

      [6/4/2554, 15:57:42:757 CEST] 0000002d lifecycle     E   JSF1054: (Phase ID: INVOKE_APPLICATION 5, View ID: /home.xhtml) Exception thrown during phase execution: javax.faces.event.PhaseEvent[source=com.sun.faces.lifecycle.LifecycleImpl@63d163d1]
      [6/4/2554, 15:57:42:764 CEST] 0000002d servlet       E com.ibm.ws.webcontainer.servlet.ServletWrapper service SRVE0068E: Uncaught exception created in one of the service methods of the servlet Faces Servlet in application TestSeam-ear. Exception created : javax.servlet.ServletException: Could not instantiate Seam component: customer_controller
              at javax.faces.webapp.FacesServlet.service(FacesServlet.java:277)
              at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1655)
              at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1595)
              at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:131)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
              at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:206)
              at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
              at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388)
              at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515)
              at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
              at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:188)
              at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:116)
              at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:77)
              at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:895)
              at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:932)
              at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:500)
              at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)
              at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:91)
              at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:864)
              at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1583)
              at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:183)
              at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:455)
              at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:384)
              at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:83)
              at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
              at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
              at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
              at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
              at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
              at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
              at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
              at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1550)
      Caused by: org.jboss.seam.InstantiationException: Could not instantiate Seam component: customer_controller
              at org.jboss.seam.Component.newInstance(Component.java:2170)
              at org.jboss.seam.Component.getInstance(Component.java:2024)
              at org.jboss.seam.Component.getInstance(Component.java:1986)
              at org.jboss.seam.Component.getInstance(Component.java:1980)
              at org.jboss.seam.Namespace.getComponentInstance(Namespace.java:55)
              at org.jboss.seam.Namespace.getComponentInstance(Namespace.java:50)
              at org.jboss.seam.el.SeamELResolver.resolveBase(SeamELResolver.java:148)
              at org.jboss.seam.el.SeamELResolver.getValue(SeamELResolver.java:51)
              at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:143)
              at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:73)
              at org.jboss.el.parser.AstIdentifier.getValue(AstIdentifier.java:44)
              at org.jboss.el.parser.AstValue.getTarget(AstValue.java:34)
              at org.jboss.el.parser.AstValue.invoke(AstValue.java:95)
              at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
              at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
              at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:94)
              at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
              at javax.faces.component.UICommand.broadcast(UICommand.java:387)
              at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:329)
              at org.ajax4jsf.component.AjaxViewRoot.broadcastEventsForPhase(AjaxViewRoot.java:304)
              at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:261)
              at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:474)
              at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
              at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
              at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
              at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
              ... 45 more
      Caused by: javax.naming.NameNotFoundException: Context: PeNGuiNLoVeRNode01Cell/nodes/PeNGuiNLoVeRNode01/servers/server1, name: TestSeam-ear/CustomerControllerBean/local: First component in name TestSeam-ear/CustomerControllerBean/local not found. [Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0]
              at com.ibm.ws.naming.jndicos.CNContextImpl.mapNotFoundException(CNContextImpl.java:4365)
              at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1794)
              at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1749)
              at com.ibm.ws.naming.jndicos.CNContextImpl.lookupExt(CNContextImpl.java:1500)
              at com.ibm.ws.naming.jndicos.CNContextImpl.lookup(CNContextImpl.java:637)
              at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:165)
              at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:179)
              at javax.naming.InitialContext.lookup(Unknown Source)
              at org.jboss.seam.Component.instantiateSessionBean(Component.java:1403)
              at org.jboss.seam.Component.instantiate(Component.java:1367)
              at org.jboss.seam.Component.newInstance(Component.java:2148)
              ... 70 more
      Caused by: org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0
              at com.ibm.ws.naming.ipcos.WsnOptimizedNamingImpl.handleNameNotFound(WsnOptimizedNamingImpl.java:2519)
              at com.ibm.ws.naming.ipcos.WsnOptimizedNamingImpl.getNextWsnOptimizedNamingContext(WsnOptimizedNamingImpl.java:1270)
              at com.ibm.ws.naming.cosbase.WsnOptimizedNamingImplBase$3.run(WsnOptimizedNamingImplBase.java:4738)
              at com.ibm.ws.naming.cosbase.WsnOptimizedNamingImplBase$3.run(WsnOptimizedNamingImplBase.java:4733)
              at com.ibm.ws.naming.util.CommonHelpers.retry(CommonHelpers.java:763)
              at com.ibm.ws.naming.cosbase.WsnOptimizedNamingImplBase.getTargetContext(WsnOptimizedNamingImplBase.java:4732)
              at com.ibm.ws.naming.cosbase.WsnOptimizedNamingImplBase$LeafOperationData.<init>(WsnOptimizedNamingImplBase.java:5311)
              at com.ibm.ws.naming.cosbase.WsnOptimizedNamingImplBase.resolve_complete_info(WsnOptimizedNamingImplBase.java:2155)
              at com.ibm.WsnOptimizedNaming._NamingContextStub.resolve_complete_info(_NamingContextStub.java:538)
              at com.ibm.ws.naming.jndicos.CNContextImpl$2.run(CNContextImpl.java:2797)
              at com.ibm.ws.naming.jndicos.CNContextImpl$2.run(CNContextImpl.java:2793)
              at com.ibm.ws.naming.util.CommonHelpers.retry(CommonHelpers.java:763)
              at com.ibm.ws.naming.jndicos.CNContextImpl.cosResolve(CNContextImpl.java:2791)
              at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1790)
              ... 79 more



      Do anyone know what's wrong? Is it related to this exception which throws while init server?

      E com.ibm.ws.webcontainer.webapp.WebApp notifyServletContextCreated SRVE0283E: Exception caught while initializing context: {0}
      java.lang.IllegalStateException: duplicate factory for: org.jboss.seam.web.webSession (duplicate is specified in components.xml)

      Thank you in advance :)
      |

      *"
        • 1. Re: Could not instantiate Seam component (Seam 2.2.1 + Websphere 7.0)
          Carvel Baus Newbie

          Have you checked your components.xml file? The IllegalStateException is complaining about something in there.

          • 2. Re: Could not instantiate Seam component (Seam 2.2.1 + Websphere 7.0)
            Ohm Samkoses Newbie
            I don't think there's something wrong with my components.xml since, it generated automatically by JBoss Webtool. This is my components.xml :

            <?xml version="1.0" encoding="UTF-8"?>
            <components xmlns="http://jboss.com/products/seam/components"
                        xmlns:core="http://jboss.com/products/seam/core"
                        xmlns:persistence="http://jboss.com/products/seam/persistence"
                        xmlns:drools="http://jboss.com/products/seam/drools"
                        xmlns:bpm="http://jboss.com/products/seam/bpm"
                        xmlns:security="http://jboss.com/products/seam/security"
                        xmlns:mail="http://jboss.com/products/seam/mail"
                        xmlns:web="http://jboss.com/products/seam/web"
                        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                        xsi:schemaLocation=
                            "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.2.xsd
                             http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.2.xsd
                             http://jboss.com/products/seam/drools http://jboss.com/products/seam/drools-2.2.xsd
                             http://jboss.com/products/seam/bpm http://jboss.com/products/seam/bpm-2.2.xsd
                             http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.2.xsd
                             http://jboss.com/products/seam/mail http://jboss.com/products/seam/mail-2.2.xsd
                             http://jboss.com/products/seam/web http://jboss.com/products/seam/web-2.2.xsd
                             http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.2.xsd">

               <!-- <core:init debug="true" jndi-pattern="@jndiPattern@"/> -->
               <core:init debug="true" jndi-pattern="@jndiPattern@"/>

               <core:manager concurrent-request-timeout="500"
                             conversation-timeout="120000"
                             conversation-id-parameter="cid"
                             parent-conversation-id-parameter="pid"/>

               <!-- Make sure this URL pattern is the same as that used by the Faces Servlet -->
               <web:hot-deploy-filter url-pattern="*.seam"/>

               <persistence:managed-persistence-context name="entityManager" auto-create="true"
                                  persistence-unit-jndi-name="java:/TestSeamEntityManagerFactory"/>

               <drools:rule-base name="securityRules">
                  <drools:rule-files>
                     <value>/security.drl</value>
                  </drools:rule-files>
               </drools:rule-base>

               <security:rule-based-permission-resolver security-rules="#{securityRules}"/>

               <security:identity authenticate-method="#{authenticator.authenticate}" remember-me="true"/>

               <event type="org.jboss.seam.security.notLoggedIn">
                  <action execute="#{redirect.captureCurrentView}"/>
               </event>
               <event type="org.jboss.seam.security.loginSuccessful">
                  <action execute="#{redirect.returnToCapturedView}"/>
               </event>

               <mail:mail-session host="localhost" port="25"/>

               <!-- For use with jBPM pageflow or process management -->
               <!--
               <bpm:jbpm>
                  <bpm:process-definitions></bpm:process-definitions>
                  <bpm:pageflow-definitions></bpm:pageflow-definitions>
               </bpm:jbpm>
               -->

            </components>

            Are there anything wrong with this components.xml? Anyways, is it related to my first error?