[JBoss Seam] - Base is null Error.
by xterm
Greetings,
I'm building a simple Seam application from scratch. However i've ran into an error when trying to access a method in a session bean. Sadly i was unable to debug the error granted i'm fairly new to JBoss Seam.
The application merely retrieves data from the database and lists them using jsf DataTable.
Here's a detailed list of the data i currently have:
application.xml
| <display-name>Phone Directory</display-name>
| <module>
| <web>
| <web-uri>phonedir.war</web-uri>
| <context-root>/phonedir</context-root>
| </web>
| </module>
| <module>
| <ejb>phonedir.ejb3</ejb>
| </module>
| <module>
| <java>jboss-seam.jar</java>
| </module>
| </application>
|
components.xml
| <?xml version="1.0" encoding="utf-8"?>
| <components>
| <component name="org.jboss.seam.core.init">
| <property name="jndiPattern">phonedir/#{ejbName}/local</property>
| </component>
| </components>
|
ejb-jar.xml
| <ejb-jar>
| <assembly-descriptor>
| <interceptor-binding>
| <ejb-name>*</ejb-name>
| <interceptor-class>org.jboss.seam.ejb.SeamInterceptor</interceptor-class>
| </interceptor-binding>
| </assembly-descriptor>
| </ejb-jar>
|
faces-config.xml
| <faces-config>
| <lifecycle>
| <phase-listener>org.jboss.seam.jsf.SeamExtendedManagedPersistencePhaseListener</phase-listener>
| </lifecycle>
| </faces-config>
|
persistence.xml
| <persistence>
| <persistence-unit name="userDatabase">
| <provider>org.hibernate.ejb.HibernatePersistence</provider>
| <jta-data-source>java:/PhonedirDS</jta-data-source>
| <properties>
| <property name="hibernate.hbm2ddl.auto" value="update"/>
| </properties>
| </persistence-unit>
| </persistence>
|
web.xml
| <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">
| <!-- Seam -->
| <listener>
| <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
| </listener>
| <!-- MyFaces -->
| <listener>
| <listener-class>
| org.apache.myfaces.webapp.StartupServletContextListener
| </listener-class>
| </listener>
|
| <context-param>
| <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
| <param-value>client</param-value>
| </context-param>
|
| <servlet>
| <servlet-name>Faces Servlet</servlet-name>
| <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
| <load-on-startup>1</load-on-startup>
| </servlet>
|
| <!-- Faces Servlet Mapping -->
| <servlet-mapping>
| <servlet-name>Faces Servlet</servlet-name>
| <url-pattern>*.seam</url-pattern>
| </servlet-mapping>
|
| </web-app>
|
Contact entity bean
| @Entity
| @Name("contact")
| @Table(name="phonedir")
| public class Contact implements Serializable {
| private int id;
| private String fullName;
| private String telephone;
| private String extension;
| private String company;
| private String switchBoard;
|
| @Id @GeneratedValue
| public int getId(){
| return id;
| }
|
| public void setId(int id){
| this.id = id;
| }
|
| public String getFullName(){
| return fullName;
| }
|
| public void setFullName(String fullName){
| this.fullName = fullName;
| }
|
| public String getTelephone(){
| return telephone;
| }
|
| public void setTelephone(String telephone){
| this.telephone = telephone;
| }
|
| public String getExtension(){
| return extension;
| }
|
| public void setExtension(String extension){
| this.extension = extension;
| }
|
| public String getCompany(){
| return company;
| }
|
| public void setCompany(String company){
| this.company = company;
| }
|
| public String getSwitchboard(){
| return switchBoard;
| }
|
| public void setSwitchboard(String switchboard){
| this.switchBoard = switchboard;
| }
| }
|
Local interface ContactManager
| @Local
| public interface ContactManager {
| public String getAllContacts();
| }
|
Stateless bean
| @Stateless
| @Name("contactManager")
| @Interceptors(SeamInterceptor.class)
| public class ContactManagerBean implements ContactManager{
| @Out
| private List <Contact> allContacts;
|
| @PersistenceContext
| private EntityManager em;
|
| public String getAllContacts(){
| System.out.println("Inside method");
| allContacts = em.createQuery("from Contact c").getResultList();
| return null;
| }
| }
|
jsf page (omitted headers)
| <f:view>
| <head>
| <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
| <title></title>
| </head>
| <body>
| <h:form>
| <h:commandButton type="submit" value="fetch" action="#{contactManager.getAllContacts}"/>
| </h:form>
| <f:subview id="allContacts" rendered="#{!empty(allContacts)}">
| <f:verbatim>
| <p>List of Contacts:</p>
| </f:verbatim>
| ------- 1
| <h:dataTable value="#{allContacts}" var="contact">
| <h:column>
| <h:outputText value="#{contact.fullName}"/>
| </h:column>
| </h:dataTable>
| ------- 2
| </f:subview>
|
| </body>
| </f:view>
|
-------------
Packaging and deploying the application generates no header. Loading the initial page as well generates no errors. However upon clicking the button. The following error is generated: (Note that the debug statement does not print hence the method was not invoked to begin with.)
anonymous wrote :
| 12:05:37,605 ERROR [[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw exception
| javax.faces.FacesException: Error calling action method of component with id _idJsp0:_idJsp1
| at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:74)
| at javax.faces.component.UICommand.broadcast(UICommand.java:106)
| at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:94)
| at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:168)
| at org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:343)
| at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:86)
| at javax.faces.webapp.FacesServlet.service(FacesServlet.java:137)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
| at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
| at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
| at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
| at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
| at java.lang.Thread.run(Thread.java:595)
| Caused by: javax.faces.el.EvaluationException: Exception while invoking expression #{contactManager.getAllContacts}
| at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:165)
| at org.jboss.seam.actionparam.ActionParamBindingHelper.invokeTheExpression(ActionParamBindingHelper.java:58)
| at org.jboss.seam.actionparam.ActionParamMethodBinding.invoke(ActionParamMethodBinding.java:71)
| at org.jboss.seam.actionparam.ActionParamBindingHelper.invokeTheExpression(ActionParamBindingHelper.java:58)
| at org.jboss.seam.actionparam.ActionParamMethodBinding.invoke(ActionParamMethodBinding.java:71)
| at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:63)
| ... 25 more
| Caused by: javax.faces.el.PropertyNotFoundException: Base is null: contactManager
| at org.apache.myfaces.el.ValueBindingImpl.resolveToBaseAndProperty(ValueBindingImpl.java:460)
| at org.apache.myfaces.el.MethodBindingImpl.resolveToBaseAndProperty(MethodBindingImpl.java:180)
| at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:114)
| ... 30 more
|
Please advise.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3984842#3984842
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3984842
19Â years, 6Â months
[JNDI/Naming/Network] - Network is unreachable exception when "create()" called but
by agonnet
Hi,
Can anyone tell me what is happening in the EJB "create()" call from a network perspective?
I have a JBOSS app with identical clients deployed at various sites around the world, connected via an internal company WAN. All clients work except one, which gives "java.rmi.ConnectIOException: Exception creating connection to: -.--.---.---; nested exception is: java.net.SocketException: Network is unreachable: connect" (full details below) when "create( )" is called, i.e. the JNDI lookup is ok (well, no exceptions) but "create()" isn't.
This tells me there is something in the network which is blocking the "create()" network traffic.
To test, and to produce a simple test program for the network guys to test with, I built the Sun RMI "hello world" demo program (see http://java.sun.com/j2se/1.5.0/docs/guide/rmi/hello/hello-world.html). But when I ran this, between the non working location & the location where JBOSS is, it worked fine. (This makes some sense, as the JBOSS JNDI lookup uses RMI and this is ok, but doesn't help with the create problem).
I'm guessing the "create()" failed because it's using different ports, or JBOSS is trying to open a port in the opposite direction when it gets the "create()" call. But I'm guessing! Hence my question above.
Thanks
Andrew Gonnet.
Exception example:
-----------------------
java.rmi.ConnectIOException: Exception creating connection to: -.--.---.---; nested exception is:
java.net.SocketException: Network is unreachable: connect
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:587)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:94)
at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Lorg.jboss.invocation.Invocation;)Ljava.lang.Object;(Unknown Source)
at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:119)
at org.jboss.invocation.InvokerInterceptor.invokeInvoker(InvokerInterceptor.java:227)
at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:167)
at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46)
at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:55)
at org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:169)
at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:86)
at $Proxy0.create()Lgeogpii.copyinsp.ejb.SvrInfoRemote;(Unknown Source)
at geogpii.copyinsp.HeartBeat.register(HeartBeat.java:102)
I'm using:
-----------
Server:
JBOSS (server) 4.0.3 SP1
JVM JRockit 1.5.0_03
OS MS Windows server 2003
Client:
JVM JRockit 1.5.0_03
OS MS Windows server 2003
JBOSS Client jar files from JBOSS 4.0.3 SP1 (as on the server)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3984841#3984841
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3984841
19Â years, 6Â months