[JBoss Seam] - Injection and relation between components
by rmemoria
Hi all,
I'm using JBOSS 4.0.5 and SEAM 1.2.1
I don't know if it's a bug or my (wrong) way of using components.
I have a long running conversation and a java bean component declared like this:
@Name("drugOrderHome")
| public class DrugOrderHome extends EntityHome<DrugOrder>{
| private static final long serialVersionUID = 2666375478687085792L;
|
| @In(create=true)
| private SourceConsumptionHome sourceConsumptionHome;
this entityHome component remains in memory until the end of the conversation. And there are several requests during the conversation .
PROBLEM: The state of the component injected (sourceConsumptionHome) is lost between every request inside the long running conversation, while the DrugOrderHome component remains intact.
Is this a feature or a bug? Is there a way of preserving the state of the injected component?
Regards,
Ricardo Memória
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4051572#4051572
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4051572
18Â years, 10Â months
[JBoss Seam] - Re: Trouble Using <s:convertEntity/> on Glassfish
by soluble
Thanks for the clarification. Seam really does have some neat features!
I am trying to get to the root of my problem so have reverted to using the "jboss-seam-1.2.1.GA/examples/glassfish" example. I tried adding <core:entity-manager-factory name="dbFactory" persistence-unit-name="bookingDatabase"/> to the components.xml file expecting the example app to still work. However I got the following error:
| javax.persistence.PersistenceException: java.lang.NullPointerException
| at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:252)
| at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:120)
| at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:96)
| at org.jboss.seam.core.EntityManagerFactory.startup(EntityManagerFactory.java:74)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| ...
|
Does anyone know what config I should tweak to get the entity-manager-factory working on the glassfish example? I suspect it is a visibility problem with the persistence.xml file and associated entities. However, it is late and I would like to stop experimenting for the night. Maybe once that works, I can try thinking about <s:convertEntity/> again. ;)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4051561#4051561
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4051561
18Â years, 10Â months
[Tomcat, HTTPD, Servlets & JSP] - JSF 1.1 RI + JSTL + JBoss doesn't work
by pjsa
Hi JBoss Community!
I developed an application (using Netbeans 5.5 with Sun AS 9.0) that uses following technologies:
- Database
MySQL 5.0
- Persistence
JPA
- Business Layer
EJB 3.0
- Web
Servlet
JSP with JSTL 1.1
JSF 1.1
Everything work fine in my development environment, but the production environment uses JBoss 4.05 GA. I confess: I'm newbie with JBoss and I am having many problems to deploy my application in this server. Lets go to the issues:
1- JSF doesn't work
When I used My Faces (already installed in the server), JSF page worked, but layout was corrupted. So, I tried use JSF RI 1.1 (as in my development environment). For it:
- I deleted jsf-lib directory
- I upload jsf-api.jar and jsf-impl (and dependencies) to
<jboss home>/server/default/deploy/jbossweb-tomcat55.sar/ (because I want the .ear be small)
- I modified <jboss home>/server/default/deploy/jbossweb-tomcat55.sar/conf/web.xml, commenting the part below:
<init-param>
<param-name>engineOptionsClass</param-name>
<param-value>
org.jboss.web.tomcat.tc5.jasper.JspServletOptions
</param-value>
</init-param>
Specify the jars relative to the jbossweb-tomcat55.sar that should
be scanned for common tag lib descriptors to include in every war
deployment.
<init-param>
MyFaces tlds
<param-name>tagLibJar0</param-name>
<param-value>jsf-libs/myfaces-impl.jar</param-value>
</init-param>
And finally, I cleaned work and tmp directories. After it, I restart JBoss, but when I test the application, I get the following error:
java.lang.NoClassDefFoundError: org.apache.myfaces.taglib.core.ViewTag
at org.apache.jsp.views.apps.artigos.listarArtigos_jsp._jspx_meth_f_view_0(listarArtigos_jsp.java:115)
at org.apache.jsp.views.apps.artigos.listarArtigos_jsp._jspService(listarArtigos_jsp.java:91)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:147)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at com.sivople.web.site.filters.LoadNewsControllerFilter.doFilter(LoadNewsControllerFilter.java:58)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
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)
2- JSTL Expression Language are not been interpreted
Code like this:
<c:forEach items="${sessionScope.news}" var="item">
<a href="/sivople/views/apps/noticias/lerNoticia.jsp?noticia=<c:out value='${item.contentUrl}' />"> <c:out value="${item.title}" />
</c:forEach>
is rendering as below:
${item.title}
In this case, there isn't errors in the log.
Any sugestions?
*** My web.xml: ***
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
<context-param>
<param-name>com.sun.faces.verifyObjects</param-name>
<param-value>false</param-value>
</context-param>
<context-param>
<param-name>com.sun.faces.validateXml</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>client</param-value>
</context-param>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
<servlet-name>ViewGalleryControllerServlet</servlet-name>
<servlet-class>com.sivople.web.site.servlets.ViewGalleryControllerServlet</servlet-class>
<init-param>
<param-name>forwardUrl</param-name>
<param-value>/views/apps/verGaleria.jsp</param-value>
</init-param>
<filter-name>LoadNewsControllerFilter</filter-name>
<filter-class>com.sivople.web.site.filters.LoadNewsControllerFilter</filter-class>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>ViewGalleryControllerServlet</servlet-name>
<url-pattern>/servlet/galerias/ViewGalleryControllerServlet</url-pattern>
</servlet-mapping>
<filter-mapping>
<filter-name>LoadNewsControllerFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>
index.jsp
</welcome-file>
</welcome-file-list>
<jsp-config>
<taglib-uri>
http://java.sun.com/jstl/core
</taglib-uri>
<taglib-location>
/WEB-INF/c.tld
</taglib-location>
</jsp-config>
</web-app>
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4051560#4051560
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4051560
18Â years, 10Â months