[JBoss Seam] - Re: Deploy Seam 1.1 to websphere without EJB
by jbnewb
Hi,
Downloaded the 1.1.5 - Was able to run the JPA example without any issues. Thanks.
For my app (WAR file) - I keep getting the exception below. The only way I get rid of it is to put the StartupServletContextListener line above the SeamListener line
My web.xml / build.xml mirrors what u have in the example - Question is
Questions
# Why is the "start" of the application so sensitive to order of the listeners in Websphere - What could I be doing wrong
# Mainly - Will this reordering affect Seam? Right now this is just a 2 page prototype -
Here is the exception (part of the trace)
[2/1/07 12:13:59:321 PST] 0000005e ServletWrappe E SRVE0100E: Did not realize init() exception thrown by servlet Faces Servlet: 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 com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:185)
at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.init(ServletWrapper.java:316)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.initialize(ServletWrapper.java:1119)
at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.initialize(ServletWrapper.java:149)
at com.ibm.wsspi.webcontainer.extension.WebExtensionProcessor.createServletWrapper(WebExtensionProcessor.java:99)
at com.ibm.ws.webcontainer.webapp.WebApp.getServletWrapper(WebApp.java:741)
at com.ibm.ws.webcontainer.webapp.WebApp.initializeTargetMappings(WebApp.java:421)
at com.ibm.ws.webcontainer.webapp.WebApp.commonInitializationFinish(WebApp.java:274)
at com.ibm.ws.wswebcontainer.webapp.WebApp.initialize(WebApp.java:271)
at com.ibm.ws.wswebcontainer.webapp.WebGroup.addWebApplication(WebGroup.java:88)
at com.ibm.ws.wswebcontainer.VirtualHost.addWebApplication(VirtualHost.java:157)
at com.ibm.ws.wswebcontainer.WebContainer.addWebApp(WebContainer.java:653)
at com.ibm.ws.wswebcontainer.WebContainer.addWebApplication(WebContainer.java:606)
at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:333)
at com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:549)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1295)
at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1129)
at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:567)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4009700#4009700
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4009700
19Â years, 2Â months
[JBoss Seam] - How to modify the messages example to connect to Oracle DB
by MonkeyKnifeFight
Hey guys another newbie question here. I'm trying to modify the messages example to connect to an Oracle database, then execute a simple query and display the results in a table. I'm having problems getting my configuration set up correctly. I added a -ds.xml file and edited the persistence.xml file to point to that datasource. Then I use the @PersistenceContext annotation to try to get a hold of that datasource and run the query. Problem I am having is:
javax.faces.el.EvaluationException: Cannot get value for expression '#{messageList.rowCount==0}
I assume because the query doesn't return anything. I'll post my config files and the code that executes the query. Am I on the right track with the configuration or just chasing my tail?
Thanks
Chris
persistence.xml
<?xml version="1.0" encoding="UTF-8"?>
| <persistence xmlns="http://java.sun.com/xml/ns/persistence"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
| version="1.0">
| <persistence-unit name="userDatabase">
| <provider>org.hibernate.ejb.HibernatePersistence</provider>
| <jta-data-source>java:/XAOracleDS</jta-data-source>
| <properties>
| <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle9Dialect" />
| <property name="hibernate.connection.driver_class" value="oracle.jdbc.driver.OracleDriver" />
| <property name="hibernate.connection.username" value="USER" />
| <property name="hibernate.connection.password" value="PASS" />
| <property name="hibernate.connection.datasource" value="java:/XAOracleDS"/>
| </properties>
| </persistence-unit>
| </persistence>
|
oracle-xa-ds.xml
<datasources>
| <xa-datasource>
| <jndi-name>XAOracleDS</jndi-name>
| <track-connection-by-tx>true</track-connection-by-tx>
| <isSameRM-override-value>false</isSameRM-override-value>
| <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
| <xa-datasource-property name="URL">
| jdbc:oracle:thin:@funeral:1521:DB
| </xa-datasource-property>
| <xa-datasource-property name="User">USER</xa-datasource-property>
| <xa-datasource-property name="Password">PASS</xa-datasource-property>
| <exception-sorter-class-name>
| org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter
| </exception-sorter-class-name>
| <no-tx-separate-pools/>
| </xa-datasource>
|
| <mbean code="org.jboss.resource.adapter.jdbc.vendor.OracleXAExceptionFormatter"
| name="jboss.jca:service=OracleXAExceptionFormatter">
| <depends optional-attribute-name="TransactionManagerService">
| jboss:service=TransactionManager
| </depends>
| </mbean>
| </datasources>
MessageManagerBean.java
//$Id: MessageManagerBean.java,v 1.7 2006/11/19 21:01:33 gavin Exp $
| package org.jboss.seam.example.messagesTest;
|
| import static javax.persistence.PersistenceContextType.EXTENDED;
| import static org.jboss.seam.ScopeType.SESSION;
|
| import java.io.Serializable;
| import java.util.List;
|
| import javax.ejb.Remove;
| import javax.ejb.Stateful;
| import javax.persistence.EntityManager;
| import javax.persistence.PersistenceContext;
|
| import org.jboss.seam.annotations.Destroy;
| import org.jboss.seam.annotations.Factory;
| import org.jboss.seam.annotations.Name;
| import org.jboss.seam.annotations.Out;
| import org.jboss.seam.annotations.In;
| import org.jboss.seam.annotations.Scope;
| import org.jboss.seam.annotations.datamodel.DataModel;
| import org.jboss.seam.annotations.datamodel.DataModelSelection;
|
| @Stateful
| @Scope(SESSION)
| @Name("messageManagerTest")
| public class MessageManagerBean implements Serializable, MessageManager
| {
|
| @DataModel
| private List<Message> messageList;
|
| @DataModelSelection
| @Out(required=false)
| private Message message;
|
| @PersistenceContext(type=EXTENDED)
| private EntityManager em;
|
| @Factory("messageList")
| public void findMessages()
| {
| messageList = em.createQuery("select unitid from iped_hd").getResultList();
| }
|
| @Remove @Destroy
| public void destroy() {}
|
| }
messages.jsp
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
| <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
| <%@ taglib uri="http://jboss.com/products/seam/taglib" prefix="s" %>
| <html>
| <head>
| <title>Messages</title>
| </head>
| <body>
| <f:view>
| <h2>Message List</h2>
| <h:outputText value="No messages to display" rendered="#{messageList.rowCount==0}"/>
| <h:dataTable var="msg" value="#{messageList}" rendered="#{messageList.rowCount>0}">
| <h:column>
| <f:facet name="header">
| <h:outputText value="Title"/>
| </f:facet>
| <h:outputText value="#{msg.unitid}"/>
| </h:column>
| </h:dataTable>
| </f:view>
| </body>
| </html>
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4009693#4009693
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4009693
19Â years, 2Â months
[Beginners Corner] - Re: Sakai 2.3 on JBoss - how to deploy?
by edwinmtriana
Hello
I also trying to deploy Sakai on Jboss, and Five minutes ago I got a correct deploy. I don't know if this is the better configuracion, but is a good way to begin.
The Sakai estructure:
- I download the sakai-bin_2-3-0.tar.gz file.
- Decompress the file
. In the Sakai directory i found:
| - common/
| - components/
| - licenses/
| - server/
| - shared/
| - webapps/
| - ECLv1.txt
|
|
| Now, I put the directories as follows:
|
| - The WAR files in the webapps in JBOSS_HOME/server/default/deploy (only the files, no the directory)
| - The "components" dir in JBOSS_HOME/server/default/
| - Create a sakai dir in JBOSS_HOME/server/default/
| - Copy the sakai properties in the sakai directory
| - You can found the sakai.properties file in /sakai-src/reference/docs/sakai.properties
| - Copy de JARs files of the "common, shared and server" directory in JBOSS_HOME/server/default/lib
|
| Finally, before to start the server you have to set the environment variable JAVA_OPTS as follows:
|
| export JAVA_OPTS="-server -Xms512m -Xmx768m -XX:PermSize=128m -XX:MaxPermSize=196m -XX:NewSize=192m -XX:MaxNewSize=384m"
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4009692#4009692
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4009692
19Â years, 2Â months