[JBoss Seam] - Re: Any experiences with the Tomahawk components?
by IceBearOZ
Hi Together,
maybe someone of you lucky guys can give me little hint.
I am trying to run tomahawk but it does not work.
What I have:
JBoss 4.0.4-GA JEMS with the MyFaces installation as it comes with JBoss.
I did it as nhpvti and some of you other guys said:
I placed tomahawk-1.1.3.jar , commons-fileupload-1.1.1.jar , commons-lang-2.1.jar into $JBOSS_HOME/server/default/deploy/tomcat55.sar/jsf-libs
Then I altered the web.xml in $JBOSS_HOME/server/default/deploy/tomcat55.sar/conf
Now it looks like:
| <?xml version="1.0" encoding="ISO-8859-1"?>
| <web-app 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"
| version="2.4">
|
| <!-- ======================== Introduction ============================== -->
| <!-- This document defines default values for *all* web applications -->
| <!-- loaded into this instance of Tomcat. As each application is -->
| <!-- deployed, this file is processed, followed by the -->
| <!-- "/WEB-INF/web.xml" deployment descriptor from your own -->
| <!-- applications. -->
| <!-- -->
| <!-- WARNING: Do not configure application-specific resources here! -->
| <!-- They should go in the "/WEB-INF/web.xml" file in your application. -->
|
| <!-- ================== Common filter Configuration ==================== -->
| <filter>
| <filter-name>CommonHeadersFilter</filter-name>
| <filter-class>org.jboss.web.tomcat.filters.ReplyHeaderFilter</filter-class>
| <init-param>
| <param-name>X-Powered-By</param-name>
| <param-value>Servlet 2.4; JBoss-4.0.4.GA (build: CVSTag=JBoss_4_0_4_GA date=200605151000)/Tomcat-5.5</param-value>
| </init-param>
| </filter>
|
| <filter-mapping>
| <filter-name>CommonHeadersFilter</filter-name>
| <url-pattern>/*</url-pattern>
| </filter-mapping>
|
|
| <filter>
| <filter-name>MyFacesExtensionsFilter</filter-name>
| <filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
| <init-param>
| <param-name>maxFileSize</param-name>
| <param-value>20m</param-value>
| <description>Set the size limit for uploaded files.
| Format: 10 - 10 bytes
| 10k - 10 KB
| 10m - 10 MB
| 1g - 1 GB
| </description>
| </init-param>
| </filter>
|
| <!-- extension mapping for adding <script/>, <link/>, and other resource tags to JSF-pages -->
| <filter-mapping>
| <filter-name>MyFacesExtensionsFilter</filter-name>
| <url-pattern>*.jsf</url-pattern>
| </filter-mapping>
|
| <!-- extension mapping for serving page-independent resources (javascript, stylesheets, images, etc.) -->
| <filter-mapping>
| <filter-name>MyFacesExtensionsFilter</filter-name>
| <url-pattern>/faces/myFacesExtensionResource/*</url-pattern>
| </filter-mapping>
|
|
|
|
| <!-- ================== Common Listener Configuration ==================== -->
| <listener>
| ......
| ....
| ..
|
|
After that I declared the taglib in my web.xml file in my project in:
web/WEB-INF/
Here how it looks now:
| <?xml version="1.0" encoding="UTF-8"?>
|
| <!DOCTYPE web-app PUBLIC
| "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
| "http://java.sun.com/dtd/web-app_2_3.dtd">
|
| <web-app>
|
| <!-- Einbinden des JSF Controller-Servlets -->
| <servlet>
| <servlet-name>Faces Servlet</servlet-name>
| <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
| <load-on-startup>1</load-on-startup>
| </servlet>
|
| <!-- Binden des Servlets an alle URL mit der Endung *.faces -->
| <servlet-mapping>
| <servlet-name>Faces Servlet</servlet-name>
| <url-pattern>*.faces</url-pattern>
| </servlet-mapping>
|
| <context-param>
| <param-name>facelets.LIBRARIES</param-name>
| <param-value>/WEB-INF/tomahawk.taglib.xml</param-value>
| </context-param>
|
|
| </web-app>
|
|
And finally I create the tomahawk.taglib.xml in /WEB/INF folder of my project.
JBoss starts without any error-messages. And everything looks fine.
When I try to deploy my project everything is still fine.
As soon as I start my browser and access the project the page is displayed but JBoss throws the following errors:
|
| 21:59:59,945 INFO [[/syncbaker-war]] No state saving method defined, assuming default server state saving
| 22:00:01,930 INFO [BaseBean] Accessing login service: successful
| 22:00:01,945 INFO [BaseBean] Accessing executer: successful
| 22:00:01,976 INFO [MyfacesConfig] No context init parameter 'org.apache.myfaces.PRETTY_HTML' found, using default value true
| 22:00:01,976 INFO [MyfacesConfig] No context init parameter 'org.apache.myfaces.ALLOW_JAVASCRIPT' found, using default value true
| 22:00:01,976 INFO [MyfacesConfig] No context init parameter 'org.apache.myfaces.DETECT_JAVASCRIPT' found, using default value false
| 22:00:01,976 INFO [MyfacesConfig] No context init parameter 'org.apache.myfaces.AUTO_SCROLL' found, using default value false
| 22:00:02,055 ERROR [[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw exception
| java.lang.NoSuchMethodError: org.apache.myfaces.renderkit.html.util.DummyFormUtils.isWriteDummyForm(Ljavax/faces/context/FacesContext;)Z
| at org.apache.myfaces.renderkit.html.util.ExtensionsPhaseListener.writeCodeBeforeBodyEnd(ExtensionsPhaseListener.java:110)
| at org.apache.myfaces.renderkit.html.util.ExtensionsPhaseListener.getCodeBeforeBodyEnd(ExtensionsPhaseListener.java:96)
| at org.apache.myfaces.renderkit.html.util.ExtensionsPhaseListener.renderCodeBeforeBodyEnd(ExtensionsPhaseListener.java:86)
| at org.apache.myfaces.renderkit.html.util.ExtensionsPhaseListener.afterPhase(ExtensionsPhaseListener.java:66)
| at org.apache.myfaces.lifecycle.LifecycleImpl.informPhaseListenersAfter(LifecycleImpl.java:536)
| at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:359)
| at javax.faces.webapp.FacesServlet.service(FacesServlet.java:107)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
| 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.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)
|
|
|
The project does not have any tomahawk tags yet. Only standard jsf-tags. It worked fine before (with the plain installation shiped with JBoss).
Any ideas what I am doing wrong?
Tanks for your help in advance. I really appreciate it.
Regards
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3975210#3975210
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3975210
18 years, 4 months
[Persistence, JBoss/CMP, Hibernate, Database] - Re: Hibernate and JBOSS JTA failed transactions
by smithbstl
ggreaves: I think with Jboss 4.0.4, you must name your hibernate-service.xml file jboss-service.xml I am not sure this became necessary but it did.
Here is how I am using JTA Transactions with Hibernate
I created a transaction service helper that basically just does exception handling
package com.stlouiscity.util;
| import javax.transaction.*;
|
| public class TransactionService {
|
| /**
| * Creates a new instance of TransactionService
| */
| public TransactionService() {
| }
| public static UserTransaction getUserTransaction() {
| UserTransaction ut = null;
| ut = ServiceLocator.getUserTransaction();
| return ut;
| }
|
| public static void beginUserTransaction(UserTransaction ut) {
| try {
| ut.begin();
| } catch(NotSupportedException nse) {
| throw new TransactionServiceException(nse);
| } catch(SystemException se) {
| throw new TransactionServiceException(se);
| }
| }
|
| public static void commitUserTransaction(UserTransaction ut) {
| try {
| ut.commit();
| } catch (RollbackException re) {
| throw new TransactionServiceException(re);
| } catch (HeuristicMixedException hme) {
| throw new TransactionServiceException(hme);
| } catch (HeuristicRollbackException hre) {
| throw new TransactionServiceException(hre);
| } catch (java.lang.SecurityException se) {
| throw new TransactionServiceException(se);
| } catch (java.lang.IllegalStateException ise) {
| throw new TransactionServiceException(ise);
| } catch (SystemException syse) {
| throw new TransactionServiceException(syse);
| }
| }
|
| public static void rollbackUserTransaction(UserTransaction ut) {
| try {
| ut.rollback();
| } catch (java.lang.IllegalStateException ise) {
| throw new TransactionServiceException(ise);
| } catch (java.lang.SecurityException se) {
| throw new TransactionServiceException(se);
| } catch (SystemException syse) {
| throw new TransactionServiceException(syse);
| }
| }
| }
Here is the TransactionServiceException Class
public class TransactionServiceException extends RuntimeException {
|
| /**
| * Creates a new instance of TransactionServiceException
| */
| public TransactionServiceException() {
| super();
| }
|
| public TransactionServiceException(String message) {
| super(message);
| }
|
| public TransactionServiceException(Throwable cause) {
| super(cause);
| }
|
| public TransactionServiceException(String message, Throwable cause) {
| super(message, cause);
| }
|
| }
Here is the actual DAO logic
package com.stlouiscity.budget.database.dao;
|
| import com.stlouiscity.budget.database.beans.AccountBean;
| import com.stlouiscity.database.util.HibernateUtil;
| import com.stlouiscity.util.TransactionService;
| import com.stlouiscity.util.ServiceLocator;
|
| import java.util.List;
| import java.util.Iterator;
|
| import javax.transaction.UserTransaction;
|
| import org.hibernate.Session;
| import org.hibernate.Query;
| import org.hibernate.Transaction;
|
| public class AccountDAOHibernateImpl implements AccountDAO {
|
| private long minRange;
| private long maxRange;
| private static final String HIBERNATE_SESSION_FACTORY
| = "java:comp/env/hibernate/SessionFactory";
|
| /** Creates a new instance of AccountDAOImpl */
| public AccountDAOHibernateImpl() {
| }
| public void update(AccountBean acctBean) {
| Session session = null;
| UserTransaction ut = null;
| try {
| ut = TransactionService.getUserTransaction();
| TransactionService.beginUserTransaction(ut);
| session = ServiceLocator.getHibernateSession(HIBERNATE_SESSION_FACTORY);
| session.update(acctBean);
| TransactionService.commitUserTransaction(ut);
| } catch (Exception e) {
| System.out.println(e);
| TransactionService.rollbackUserTransaction(ut);
| } finally {
| try {
| if (session !=null) {
| if (session.isOpen()) {
| session.close();
| }
| }
| } catch (Exception e) {
| System.out.println(e);
| }
| }
| }
Here is HibernateUtil - I think i copied it from Hibernate In Action
package com.stlouiscity.database.util;
| import org.hibernate.*;
| import org.hibernate.cfg.*;
|
| public class HibernateUtil {
|
| private static final SessionFactory sessionFactory;
| /** Creates a new instance of HibernateUtil */
|
| static {
| try {
| sessionFactory = new Configuration().configure().buildSessionFactory();
| } catch (Throwable ex) {
| System.err.println("Initial SessionFactory creation failed." + ex);
| throw new ExceptionInInitializerError(ex);
| }
| }
| public static SessionFactory getSessionFactory() {
| return sessionFactory;
| }
| }
I hope this help you sort it out
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3975208#3975208
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3975208
18 years, 4 months
[JBoss jBPM] - Specifying jbpm config xml file
by michaelholtzman
Greetings. In order to run multiple instances of our application on the same box, we typically qualify configuration files with the database and server that we are connecting to.
I would like to start jBPM with "database.server.jbpm.cfg.xml" as the configuration file. In my main program, which drives jBPM, I have
| static JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance("database.server.jbpm.cfg.xml");
|
which works as expected.
However, when I start the scheduler thread, I see a log entry that
| JbpmConfiguration : using jbpm configuration resource 'jbpm.cfg.xml'
|
even though I specify my private jbpmConfiguration in the constructor:
| public class Scheduler extends org.jbpm.scheduler.impl.Scheduler {
| private static final Log log = LogFactory.getLog(Scheduler.class);
|
| /* NOTE: This class should override the start method of jBPM's Scheduler class,
| * so we can supply our custom configuration factory.
| */
| public void start() {
| SchedulerThread schedThread = getSchedulerThread();
| log.info("Starting the scheduler thread");
|
| schedThread = new SchedulerThread(Manager.jbpmConfiguration);
|
| schedThread.setInterval(getInterval());
| schedThread.addListener(new HistoryListener());
| schedThread.start();
| log.info("Scheduler thread is running");
| }
|
| class HistoryListener implements SchedulerListener {
| public void timerExecuted(Date date, Timer timer) {
| List historyLogs = getSchedulerHistoryLogs();
| historyLogs.add(new SchedulerHistoryLog(date, timer));
| if (historyLogs.size() > getHistoryMaxSize()) {
| ((LinkedList)historyLogs).removeLast();
| }
| }
| }
|
| }
|
I don't see where a new JbpmConfiguration is being created, but it is somewhere between the creation and start of the scheduler thread.
How can I specify that one particular configuration file is to be used for the creation of all jBPM contexts and services? Thanx.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3975207#3975207
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3975207
18 years, 4 months