[JBoss Seam] - Seam without JSF + Servlet
by reind
My application is deployed as an EAR with multiple webapps. One of the webapps has a single servlet within which I'd like to use a Seam component. Seam works on the other JSF webapp in the same ear, but I can't get it to work on the servlet.
I've added a context-filter for the same url-pattern as the servlet uses (as described in the Seam docs):
components.xml
<web:context-filter url-pattern="/request/*" />
web.xml
<servlet-mapping>
| <servlet-name>Controller</servlet-name>
| <url-pattern>/request/*</url-pattern>
| </servlet-mapping>
The seam components that are in the jar are getting picked up by the ComponentScanner but when I try to inject or use Components.getIntance(...), I get:
java.lang.IllegalStateException: No application context active
| org.jboss.seam.Component.forName(Component.java:1577)
| org.jboss.seam.Component.getInstance(Component.java:1627)
| org.jboss.seam.Component.getInstance(Component.java:1610)
| org.jboss.seam.Component.getInstance(Component.java:1604)
but I do have the listener configured in web.xml
<listener>
| <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
| </listener>
Any ideas?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4073683#4073683
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4073683
18Â years, 11Â months
[EJB 3.0] - Re: regardig jboss-beans.xml
by ALRubinger
I use an alternative approach, using the Service Binding Manager...
In $JBOSS_HOME/server/[serverName]/conf I have service-bindings.xml (obtained from $JBOSS_HOME/docs/examples/binding-manager/sample-bindings.xml in a new installation), and this is sufficient for 4 configurations of servers. Then, I deploy the Service Binding Manager in an MBean (new binding_manager-service.xml file):
<mbean code="org.jboss.services.binding.ServiceBindingManager"
| name="jboss.system:service=ServiceBindingManager">
| <attribute name="ServerName">ports-default</attribute>
| <attribute name="StoreURL">file:../server/port-bindings.xml</attribute>
| <attribute name="StoreFactoryClassName">
| org.jboss.services.binding.XMLServicesStoreFactory
| </attribute>
| </mbean>
...where I can pass in the ServerName specific to each instance I'd like to use.
S,
ALR
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4073677#4073677
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4073677
18Â years, 11Â months