Ok, we're on the same page with application.xml, but after spending so much 
time on this I was starting to question the basics.  

I resolved my JNDI problem, which was do to collision between the myfaces 
classes in my WEB-INF/lib directory and the default jboss myfaces classes.  I 
had removed the ../deploy/jsf/libs directory to fix this a while ago, but it 
turns out that I needed to add back in a single commons jar.  

The bottomline is that I still have problem accessing the beans, but should be 
getting closer.  

Per your suggestion, I looked up the classloaders for RequirementsManagerBean:  
[EMAIL PROTECTED] url=file:/C:/Program Files/jboss-4.0.4RC1/server/all/conf/ 
,addedOrder=1}, [EMAIL PROTECTED] url=file:/C:/Program 
Files/jboss-4.0.4RC1/server/all/tmp/deploy/tmp33566jboss-service.xml 
,addedOrder=2}, [EMAIL PROTECTED] url=file:/C:/Program 
Files/jboss-4.0.4RC1/server/all/deploy/ejb3.deployer/ ,addedOrder=3}, [EMAIL 
PROTECTED] url=file:/C:/Program 
Files/jboss-4.0.4RC1/server/all/deploy/jboss-aop-jdk50.deployer/ 
,addedOrder=4}, [EMAIL PROTECTED] url=file:/C:/Program 
Files/jboss-4.0.4RC1/server/all/deploy/jbossweb-tomcat55.sar/ ,addedOrder=8}, 
[EMAIL PROTECTED] url=file:/C:/Program 
Files/jboss-4.0.4RC1/server/all/tmp/deploy/tmp33621jboss-local-jdbc.rar 
,addedOrder=26}, [EMAIL PROTECTED] url=file:/C:/Program 
Files/jboss-4.0.4RC1/server/all/tmp/deploy/tmp33622jms-ra.rar ,addedOrder=27}]
  | 

I'm not sure how to read this...is this showing me an array of multiple 
classloaders?  Am I looking for duplicates?


At any rate, the good news is that my bean is registered ok:

  | java: Namespace
  | 
  |   +- XAConnectionFactory (class: org.jboss.mq.SpyXAConnectionFactory)
  |   +- DefaultDS (class: org.jboss.resource.adapter.jdbc.WrapperDataSource)
  |   +- SecurityProxyFactory (class: 
org.jboss.security.SubjectSecurityProxyFactory)
  |   +- OracleDS (class: org.jboss.resource.adapter.jdbc.WrapperDataSource)
  |   +- DefaultJMSProvider (class: org.jboss.jms.jndi.JNDIProviderAdapter)
  |   +- comp (class: javax.naming.Context)
  |   +- JmsXA (class: org.jboss.resource.adapter.jms.JmsConnectionFactoryImpl)
  |   +- ConnectionFactory (class: org.jboss.mq.SpyConnectionFactory)
  |   +- jaas (class: javax.naming.Context)
  |   |   +- other (class: org.jboss.security.plugins.SecurityDomainContext)
  |   |   +- JmsXARealm (class: 
org.jboss.security.plugins.SecurityDomainContext)
  |   |   +- jbossmq (class: org.jboss.security.plugins.SecurityDomainContext)
  |   |   +- HsqlDbRealm (class: 
org.jboss.security.plugins.SecurityDomainContext)
  |   +- timedCacheFactory (class: javax.naming.Context)
  | Failed to lookup: timedCacheFactory, errmsg=org.jboss.util.TimedCachePolicy
  |   +- TransactionPropagationContextExporter (class: 
org.jboss.tm.TransactionPropagationContextFactory)
  |   +- StdJMSPool (class: org.jboss.jms.asf.StdServerSessionPoolFactory)
  |   +- comp.ejb3 (class: javax.naming.Context)
  |   |   NonContext: null
  |   +- TransactionPropagationContextImporter (class: 
org.jboss.tm.TransactionPropagationContextImporter)
  |   +- TransactionManager (class: org.jboss.tm.TxManager)
  | 
  | 
  | Global JNDI Namespace
  | 
  |   +- XAConnectionFactory (class: org.jboss.mq.SpyXAConnectionFactory)
  |   +- TopicConnectionFactory (class: org.jboss.naming.LinkRefPair)
  |   +- UIL2ConnectionFactory[link -> ConnectionFactory] (class: 
javax.naming.LinkRef)
  |   +- UserTransactionSessionFactory (proxy: $Proxy27 implements interface 
org.jboss.tm.usertx.interfaces.UserTransactionSessionFactory)
  |   +- alpha (class: org.jnp.interfaces.NamingContext)
  |   |   +- RequirementsManagerBean (class: org.jnp.interfaces.NamingContext)
  |   |   |   +- localStatefulProxyFactory (class: 
org.jboss.ejb3.stateful.StatefulLocalProxyFactory)
  |   |   |   +- local (class: java.lang.Object)
  |   |   +- MyTableManager (class: org.jnp.interfaces.NamingContext)
  |   |   |   +- local (proxy: $Proxy56 implements No ClassLoaders found for: 
com.test.gems.requirements.MyTableInterface (no security manager: RMI class 
loader disabled))
  |   +- UIL2XAConnectionFactory[link -> XAConnectionFactory] (class: 
javax.naming.LinkRef)
  |   +- QueueConnectionFactory (class: org.jboss.naming.LinkRefPair)
  |   +- topic (class: org.jnp.interfaces.NamingContext)
  |   |   +- testDurableTopic (class: org.jboss.mq.SpyTopic)
  |   |   +- testTopic (class: org.jboss.mq.SpyTopic)
  |   |   +- securedTopic (class: org.jboss.mq.SpyTopic)
  |   +- queue (class: org.jnp.interfaces.NamingContext)
  |   |   +- A (class: org.jboss.mq.SpyQueue)
  |   |   +- testQueue (class: org.jboss.mq.SpyQueue)
  |   |   +- ex (class: org.jboss.mq.SpyQueue)
  |   |   +- DLQ (class: org.jboss.mq.SpyQueue)
  |   |   +- D (class: org.jboss.mq.SpyQueue)
  |   |   +- C (class: org.jboss.mq.SpyQueue)
  |   |   +- B (class: org.jboss.mq.SpyQueue)
  |   +- ConnectionFactory (class: org.jboss.mq.SpyConnectionFactory)
  |   +- UserTransaction (class: 
org.jboss.tm.usertx.client.ClientUserTransaction)
  |   +- jmx (class: org.jnp.interfaces.NamingContext)
  |   |   +- invoker (class: org.jnp.interfaces.NamingContext)
  |   |   |   +- RMIAdaptor (proxy: $Proxy26 implements interface 
org.jboss.jmx.adaptor.rmi.RMIAdaptor,interface 
org.jboss.jmx.adaptor.rmi.RMIAdaptorExt)
  |   |   +- rmi (class: org.jnp.interfaces.NamingContext)
  |   |   |   +- RMIAdaptor[link -> jmx/invoker/RMIAdaptor] (class: 
javax.naming.LinkRef)
  |   +- UILXAConnectionFactory[link -> XAConnectionFactory] (class: 
javax.naming.LinkRef)
  |   +- UILConnectionFactory[link -> ConnectionFactory] (class: 
javax.naming.LinkRef)
  |  

Nevermind "MyTableManager"...that is from an earlier test I tried.


Now what I don't get is why I can't access any beans, be they normal 
FacesBacking beans or EJB 3.0 entity beans.  I've posted my faces-config.xml 
file above.   When I run something like:
<f:view>
  |     <h:outputText value="#{rmBean.name}"/>
  | </f:view>

I get a "javax.faces.el.EvaluationException: Cannot get value for expression 
'#{rmBean.name}'" when the above call is made.  Now many users have posted this 
type of problem and it's a persistence.xml or JNDI lookup problem, but I've 
posted my code in my earlier posting and it complies with the latest JBoss 
implementation of EJB 3.0 (i.e., following the migration guide and wiki 
postings).  The stack trace of the EvaluationException above ends with 
"java.lang.NulPointerException"



  | 2006-03-21 08:59:02,203 DEBUG [org.jboss.mx.loading.UnifiedClassLoader] New 
jmx UCL with url null
  | 2006-03-21 08:59:02,203 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] 
setRepository, [EMAIL PROTECTED], [EMAIL PROTECTED] url=null ,addedOrder=0}
  | 2006-03-21 08:59:02,203 INFO  [STDOUT] XXXXXXXXXX In method getName. 
XXXXXXXXXX
  | 2006-03-21 08:59:02,203 DEBUG [org.jboss.mx.loading.UnifiedClassLoader] New 
jmx UCL with url null
  | 2006-03-21 08:59:02,218 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] 
setRepository, [EMAIL PROTECTED], [EMAIL PROTECTED] url=null ,addedOrder=0}
  | 2006-03-21 08:59:02,218 INFO  
[org.apache.beehive.netui.pageflow.internal.DefaultExceptionsHandler] Handling 
Throwable javax.faces.el.EvaluationException
  | 2006-03-21 08:59:02,218 ERROR 
[org.apache.beehive.netui.pageflow.internal.DefaultExceptionsHandler] Throwable 
javax.faces.el.EvaluationException unhandled by the current page flow (and any 
shared flow)
  | 
  | Throwable: javax.faces.el.EvaluationException: Cannot get value for 
expression '#{rmBean.name}'
  | Stack Trace:
  | javax.faces.el.EvaluationException: Cannot get value for expression 
'#{rmBean.name}'
  |     at 
org.apache.myfaces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:397)
  |     at javax.faces.component.UIOutput.getValue(UIOutput.java:75)
  |     at 
org.apache.myfaces.renderkit.RendererUtils.getStringValue(RendererUtils.java:225)
  |     at 
org.apache.myfaces.renderkit.html.HtmlTextRendererBase.renderOutput(HtmlTextRendererBase.java:65)
  | 
  | *** 
  |      snipped stack trace to save space
  | 
  | ***
  | 
  | Caused by: javax.faces.el.EvaluationException: 
com.lmco.gems.requirements.RequirementsManagerBean
  |     at 
org.apache.myfaces.el.PropertyResolverImpl.getValue(PropertyResolverImpl.java:78)
  |     at 
org.apache.myfaces.el.ELParserHelper$MyPropertySuffix.evaluate(ELParserHelper.java:532)
  |     at org.apache.commons.el.ComplexValue.evaluate(ComplexValue.java:145)
  |     at 
org.apache.myfaces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:378)
  |     ... 71 more
  | Caused by: javax.faces.el.EvaluationException: Bean: 
com.lmco.gems.requirements.RequirementsManagerBean, property: name
  |     at 
org.apache.myfaces.el.PropertyResolverImpl.getProperty(PropertyResolverImpl.java:404)
  |     at 
org.apache.myfaces.el.PropertyResolverImpl.getValue(PropertyResolverImpl.java:71)
  |     ... 74 more
  | Caused by: java.lang.reflect.InvocationTargetException
  |     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  |     at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  |     at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  |     at java.lang.reflect.Method.invoke(Method.java:585)
  |     at 
org.apache.myfaces.el.PropertyResolverImpl.getProperty(PropertyResolverImpl.java:400)
  |     ... 75 more
  | Caused by: java.lang.NullPointerException
  |     at 
com.lmco.gems.requirements.RequirementsManagerBean.getRequirement(RequirementsManagerBean.java:71)
  |     at 
com.lmco.gems.requirements.RequirementsManagerBean.getName(RequirementsManagerBean.java:89)
  |     ... 80 more
  | 

The method I'm attempting to access is in fact getting called because I am 
printing a STDOUT from it.  Is it finding a copy of the bean class in my WAR 
file (I'll have to triple check that they're not there), and then failing to 
access the beans in the ear's jar file?

What is interesting (or not) is this exception that happens a bit earlier in 
the server log:


  | , [EMAIL PROTECTED] url=null ,addedOrder=0}
  | 2006-03-21 08:59:02,062 DEBUG [org.jboss.mx.loading.UnifiedClassLoader] New 
jmx UCL with url null
  | 2006-03-21 08:59:02,062 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] 
setRepository, [EMAIL PROTECTED], [EMAIL PROTECTED] url=null ,addedOrder=0}
  | 2006-03-21 08:59:02,062 ERROR [STDERR] java.lang.ClassCastException: 
$Proxy58
  | 2006-03-21 08:59:02,078 ERROR [STDERR]      at 
org.apache.jsp.tasking.page2_jsp.jspInit(org.apache.jsp.tasking.page2_jsp:35)
  | 
  | ***
  |    more trace
  | ***
  | 
  | 2006-03-21 08:59:02,078 ERROR [STDERR]      at 
org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
  | 2006-03-21 08:59:02,078 ERROR [STDERR]      at 
java.lang.Thread.run(Thread.java:595)
  | 2006-03-21 08:59:02,093 INFO  [STDOUT] caught exception in second catch 
block.
  | 2006-03-21 08:59:02,109 DEBUG [org.jboss.mx.loading.UnifiedClassLoader] New 
jmx UCL with url null
  | 2006-03-21 08:59:02,109 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] 
setRepository, [EMAIL PROTECTED], [EMAIL PROTECTED] url=null ,addedOrder=0}
  | 

Notice the bolded section...that is a result of attempting to peform a JNDI 
lookup.

FacesContext fc = FacesContext.getCurrentInstance();
  | rm = 
(RequirementsManagerBean)fc.getApplication().createValueBinding("#{rmBean}").getValue(fc);
  | 


I've also tried:

InitialContext ic = new InitialContext();
  | rm = 
(RequirementsManagerBean)ic.lookup("alpha/RequirementsManagerBean/local");
  | 

The above, however, I wouldn't expect to be valid since this is a jsf page and 
I'm trying to access RequirmentsManagerBean as a managed bean.

I really think this is a problem between JSF managed beans and the JNDI access, 
but I don't know where to go from here. The following forum postings have 
similar problems, but the most relevent ones don't have any responses.  
Googling for info on other sites has really created more questions than 
answers.  Is the war/jar file separation within my ear the culprit?  Are there 
better questions I should be asking?

"Inject EntityManager in JSF managed bean always NULL"
http://www.jboss.com/index.html?module=bb&op=viewtopic&t=78257

"ClassCastException on EntityBean returned from Stateless Se"
http://www.jboss.com/index.html?module=bb&op=viewtopic&t=72007

"JSF Problems on JBoss AS 4.0.4RC1
http://www.jboss.com/index.html?module=bb&op=viewtopic&t=78982


Asack, or anyone else...any suggestions?  

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3931643#3931643

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3931643


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to