[JBoss Seam] - SEAM2 fails to inject EntityManager
by bulloncito
Trying to migrate from jBoss4.0.5.GA+Seam1.2.1.GA to jBoss4.2.1.GA+Seam2.0.0.B1, after updating lots of code, app deploys properly, but when I try to acces initial page, an EntityHome complains and sends me to error page:
In attribute requires non-null value: complexHome.entityManager
at this arbitrary piece of code:
@Name("complexHome")
| public class ComplexHome extends GenericEntityHome<Complex> {
|
| @In EntityManager entityManager ;
|
| ...
|
I believe it fails here due to life cycle but has nothing to do with this (works nice and smooth with old jBoss + old seam). App has deployed properly, logs do not report any errors, components.xml looks like this (fragment):
Components.xml (fragment)
|
| <core:managed-persistence-context name="entityManager"
| auto-create="true" persistence-unit-jndi-name="java:/EntityManagerFactories/LaboraemPersistenceFactory" />
... and EJTool's "JNDI Browser" (http://www.ejtools.org/) reports:
java:/
| ConnectionFactory (org.jboss.mq.SpyConnectionFactory)
| DefaultDS
| DefaultJMSProvider (org.jboss.jms.jndi.JNDIProviderAdapter)
| EntityManagerFactories
| LaboraemPersistenceFactory (org.jboss.ejb3.entity.InjectedEntityManagerFactory)
| EntityManagers
| LaboraemPersistence (org.jboss.ejb3.entity.TransactionScopedEntityManager)
| JmsXA (org.jboss.resource.adapter.jms.JmsConnectionFactoryImpl)
| ... (more) ...
... so, the persistence unit has been deployed, I'm using the same injection I used for old seam, as seen in examples (even seam2 examples), so I believe things should work, yet, they don't :(
Am I missing something ? Anybody ?
Here's a bit of the stacktrace:
org.jboss.seam.RequiredException: In attribute requires non-null value: complexHome.entityManager
| at org.jboss.seam.Component.getValueToInject(Component.java:2042)
| at org.jboss.seam.Component.injectAttributes(Component.java:1481)
| at org.jboss.seam.Component.inject(Component.java:1302)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4071808#4071808
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4071808
18Â years, 8Â months
[Installation, Configuration & DEPLOYMENT] - Use of XML Schema and DTD
by stuart_wildcat
I'm not sure exactly what forum this post belongs in but this seems like the best.
Is there any reason that so many of the XML configuration files for JBoss are still based on DTDs and not Schemas? It seems like XML schemas are the preferred method of defining XML structure.
The main benefit of XML files based on schemas is that XML editors seem to be more capable editing XML files based on XML schemas. I have been using the XML tools in Eclipse and importing the JBoss schema definitions into the Eclipse XML catalog feature so Eclipse is aware of the structure and can properly validate and provide content assist for the allowed properties and settings in the file.
This makes it MUCH easier to edit JBoss configuration files and worry about what the values for the settings are and not "did I make a typo or use an invalid property?"
Thanks,
Stuart
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4071804#4071804
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4071804
18Â years, 8Â months
[JBoss Portal] - help me with Jboss Forums Problem?
by Scott_Feng
Hi, All.
I have encountered a porblem, when running jboss-forums. I use jboss-portal 2.6. I have modified the web.xml undering "jboss-4.2.1.GA\server\default\deploy\jboss-web.deployer\conf" and added myfaces 1.1.5 jars, as http://wiki.jboss.org/wiki/Wiki.jsp?page=Running2.6WithJBossAS4.2.xAndMyF.... The console give me error information as follows:
09:54:33,004 ERROR [DefaultPageControlPolicy] Rendering portlet window produced an error
javax.portlet.PortletException: javax.portlet.PortletException: java.lang.NullPointerException
at org.jboss.portlet.forums.ui.ForumsJSFPortlet.doView(ForumsJSFPortlet.java:367)
Caused by: java.lang.NullPointerException
at org.apache.myfaces.portlet.MyFacesGenericPortlet.restoreRequestAttributes(MyFacesGenericPortlet.java:290)
--------------------------------------------------------------------
In addition, I have encountered another error,when deploying the anonymous wrote : helloworldjsfportlet.war. Its error information is anonymous wrote : javax.faces.FacesException: org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jsf/html cannot be resolved in either web.xml or the jar files deployed with this application. I think I have done the prerequisite.
Can you help me with the two questions? Thanks a lot.
------------------------------
Scott.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4071802#4071802
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4071802
18Â years, 8Â months
[JBoss Seam] - Clean way to attach debugger for drools
by zaya
I'm trying to debug drools by attaching the debugger.
This is my code:
|
| @Name("workingMemoryControl")
| @Scope(ScopeType.EVENT)
| public class WorkingMemoryControl {
|
| @In
| WorkingMemory workingMemory;
|
| @Observer("org.jboss.seam.postCreate.workingMemory")
| public void attachDebugger() {
| workingMemory.addEventListener(new DebugWorkingMemoryEventListener());
| List listeners = workingMemory.getWorkingMemoryEventListeners();
| for (Object listener: listeners) {
| System.out.println("[listener] Added in working memeory:" + listener);
| }
| }
| }
|
And this is the security method:
| @Restrict("#{s:hasPermission('register','register',user)}")
| public String secured() {//some code }
|
The problem is the postCreate event is always after authorization, which is not what I want.
| 09:40:23,014 INFO [STDOUT] Drools rule triggered!
| 09:40:23,027 INFO [STDOUT] [listener] Added in working memeory:org.drools.event.DebugWorkingMemoryEventListener@7c9c8a7b
|
Can anyone provide some suggestions?
Thanks in advance.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4071798#4071798
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4071798
18Â years, 8Â months