[JBoss Portal] - Seam Portlet in Jboss Portal
by Shinerella
I'm trying to make just a small seam app and get it working as a portlet
Currently I have
jboss-seam 1.0 GA
jboss portal 2.4 and
AS jboss_4.0.5GA
Just to start testing if this works I made a sportlet.war as follows
WEB-INF
META-INF
main.xhtml
Into the WEB-INF directory the following conf files and libs can be found
- web.xml, sportlet-object.xml, portlet.xml, jboss.web.xml, jboss-portlet.xml, jboss-app.xml, faces-config.xml, and components.xml
| <?xml version="1.0" encoding="UTF-8"?>
| <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">
|
|
|
| <!-- MY FACES -->
|
|
| <context-param>
| <param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name>
| <param-value>true</param-value>
| </context-param>
|
| <context-param>
| <param-name>org.apache.myfaces.DETECT_JAVASCRIPT</param-name>
| <param-value>false</param-value>
| </context-param>
|
| <context-param>
| <param-name>org.apache.myfaces.PRETTY_HTML</param-name>
| <param-value>true</param-value>
| </context-param>
|
| <context-param>
| <param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
| <param-value>true</param-value>
| </context-param>
|
| <!-- Extensions Filter -->
| <filter>
| <filter-name>extensionsFilter</filter-name>
| <filter-class>org.apache.myfaces.component.html.util.ExtensionsFilter</filter-class>
| <init-param>
| <param-name>uploadMaxFileSize</param-name>
| <param-value>100m</param-value>
| </init-param>
| <init-param>
| <param-name>uploadThresholdSize</param-name>
| <param-value>100k</param-value>
| </init-param>
| </filter>
|
| <!-- Seam -->
|
| <listener>
| <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
| </listener>
|
|
| <!-- Propagate conversations across redirects -->
| <filter>
| <filter-name>Seam Redirect Filter</filter-name>
| <filter-class>org.jboss.seam.servlet.SeamRedirectFilter</filter-class>
| </filter>
|
| <filter-mapping>
| <filter-name>Seam Redirect Filter</filter-name>
| <url-pattern>*.seam</url-pattern>
| </filter-mapping>
|
| <filter-mapping>
| <filter-name>Seam Redirect Filter</filter-name>
| <url-pattern>*.xhtml</url-pattern>
| </filter-mapping>
|
| <!-- JSF -->
|
| <context-param>
| <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
| <param-value>client</param-value>
| </context-param>
|
| <context-param>
| <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
| <param-value>.xhtml</param-value>
| </context-param>
|
| <context-param>
| <param-name>facelets.DEVELOPMENT</param-name>
| <param-value>true</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>
|
| <!-- Servlet Mapping -->
| <servlet-mapping>
| <servlet-name>Faces Servlet</servlet-name>
| <url-pattern>*.seam</url-pattern>
| </servlet-mapping>
|
| <servlet-mapping>
| <servlet-name>Faces Servlet</servlet-name>
| <url-pattern>*.xhtml</url-pattern>
| </servlet-mapping>
|
|
| </web-app>
|
components.xml
<components>
|
| <component name="org.jboss.seam.core.init">
| <property name="debug">true</property>
| <property name="myFacesLifecycleBug">false</property>
| <property name="jndiPattern">sportlet/#{ejbName}/local</property>
| </component>
|
| <component class="org.jboss.seam.core.Ejb" installed="false"/>
|
| <!-- Bootstrap Hibernate -->
|
| </components>
portlet.xml
| <?xml version="1.0" encoding="UTF-8"?>
| <portlet-app
| xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd /opt/SUNWps/dtd/portlet.xsd"
| version="1.0">
| <portlet>
| <portlet-name>SPortlet</portlet-name>
| <init-param>
| <name>default-view</name>
| <value>/main.xhtml</value>
| </init-param>
| <portlet-class>org.apache.myfaces.portlet.MyFacesGenericPortlet</portlet-class>
| <supports>
| <mime-type>text/html</mime-type>
| <portlet-mode>VIEW</portlet-mode>
| </supports>
| <portlet-info>
| <title>SPortlet</title>
| </portlet-info>
| </portlet>
| </portlet-app>
|
etc...
In my lib directory into WEB-INF I just included :
- my sportlet.jar with seam.properties file and the my java classes
- jboss-seam.jar
- jboss-seam-ui.jar
facelets libs:
- el-ri.jar
- el-api.jar
- jsf-facelets.jar
The thing is that I get the following errors, when deploying this app to my jboss AS
20:51:10,418 ERROR [[/sportlet]] StandardWrapper.Throwable
java.lang.IllegalStateException: No Factories configured for this Application. This happens if the faces-initialization does not work at all - make sure that you properly include all configuration settings necessary for a basic faces application and that all the necessary libs are included. Also check the logging output of your web application and your container for any exceptions!
If you did that and find nothing, the mistake might be due to the fact that you use some special web-containers which do not support registering context-listeners via TLD files and a context listener is not setup in your web.xml.
A typical config looks like this;
<listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:90)
at javax.faces.webapp.FacesServlet.init(FacesServlet.java:88)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1105)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:932)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3951)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4225)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
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.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503)
at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.apache.catalina.core.StandardContext.init(StandardContext.java:5052)
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)
----
Well, but it deploys anyways, I can run my Jboss portal but when I access the sportlet it crashes with this exception :
|
| 21:59:22,970 ERROR [PhaseListenerManager] Exception in PhaseListener RENDER_RESPONSE(6) afterPhase
| java.lang.IllegalStateException: No active session context
| at org.jboss.seam.Seam.isSessionInvalid(Seam.java:176)
| at org.jboss.seam.contexts.Lifecycle.endRequest(Lifecycle.java:
|
|
|
| at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:416)
| at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:234)
| at org.jboss.seam.jsf.SeamViewHandler.renderView(SeamViewHandler.java:59)
| at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
| at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
| 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 org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:416)
| at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:234)
| at org.jboss.seam.jsf.SeamViewHandler.renderView(SeamViewHandler.java:59)
| at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
| at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
| 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 org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:416)
| at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:234)
| at org.jboss.seam.jsf.SeamViewHandler.renderView(SeamViewHandler.java:59)
| at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
| at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
| 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 org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:416)
| at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:234)
| at org.jboss.seam.jsf.SeamViewHandler.renderView(SeamViewHandler.java:59)
| at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
| at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
| 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)
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3995456#3995456
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3995456
19 years, 4 months
[JBoss Eclipse IDE (users)] - Re: How contribute to Freemarker plugin and add my Plugin ec
by max.andersen@jboss.com
"azerr" wrote : Hi max,
| thank you for you answer. I will send you my Freemarker Plugin updated and I will explain you new features that I added.
|
Please send a *patch* and not just an updated plugin.
anonymous wrote :
| For Akrogen, I'm agree with you, at first you believe Akrogen is the same thing that hibernate tool, because it can generate Bean although Hibernate tool generate it.
|
| But Akrogen can generate any component of Web Application, like DAO, Service, Action Struts, JSP. With Hibernate mapping you can generate XML PageConfig (XML Akrogen description for describe a form (CRUD form, list form,...).
|
Hibernate tools can also generate different artifacts; nothing special about that.
anonymous wrote :
| It exist's a lot of Generator Plugin which generate code, BUT just for one technology and architecture (ex : EclipseWork which generate components just for Web Work). With Akrogen, I would like give several default template for My Architecture that I use (Service/DAO with Spring and Hibernate and Struts). But I want add wizzard to add easily your own template, because each project and people use their own architetecture.
|
ditto for Hibernate Tools.
anonymous wrote :
| With Akrogen, you could generate components for PHP project.
| XML is the model of your template (XSL or freemarker), so you could use for instance WSDL XML model to generate other components, or XMI,...
|
| XML Akrogen component is the XML description for the component that you want generate (description, title, input parameters, template to use,...). Once you have create an XML component, you can register it to use with Wizard Eclipse.
|
In Hibernate Tools these are called "Exporters"; we don't have a generic way of describing them but if someone wants to add it feel free ;)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3995454#3995454
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3995454
19 years, 4 months