[JBoss Seam] - Why do none of the samples work in Tomcat?
by krica
I simply cannot get ANY of the samples to run in Tomcat.
I started from a clean slate. New fresh download of Seam 1.0.1GA, new fresh install of Tomcat 5.5.20.
Edit build.properties and point to my newly installed Tomcat (tried with jbossHasMyFacesLifecycleBug = true and false)
>cd examples/issues
>ant
>ant deploy.tomcat
>cd .../MyTomcat
>startup.sh/bat
Tomcat starts up fine and deploys jboss-seam-issues.war without errors. However, on first access of http://localhost:8080/jboss-seam-issues/home.jsf, I get the following error (sorry...long)
| ERROR 09-12 20:08:33,593 (Log4JLogger.java:error:119) -Exception in PhaseListener RESTORE_VIEW(1) beforePhase.
| java.lang.IllegalStateException: Could not start transaction
| at org.jboss.seam.jsf.SeamExtendedManagedPersistencePhaseListener.begin(SeamExtendedManagedPersistencePhaseListener.java:77)
| at org.jboss.seam.jsf.SeamExtendedManagedPersistencePhaseListener.beforePhase(SeamExtendedManagedPersistencePhaseListener.java:35)
| at org.apache.myfaces.lifecycle.PhaseListenerManager.informPhaseListenersBefore(PhaseListenerManager.java:70)
| at org.apache.myfaces.lifecycle.LifecycleImpl.restoreView(LifecycleImpl.java:103)
| at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:66)
| at javax.faces.webapp.FacesServlet.service(FacesServlet.java:137)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.jboss.seam.servlet.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:45)
| 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.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.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
| at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
| at java.lang.Thread.run(Thread.java:595)
| Caused by: javax.naming.NamingException: Local server is not initialized
| at org.jnp.interfaces.LocalOnlyContextFactory.getInitialContext(LocalOnlyContextFactory.java:45)
| at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
| at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
| at javax.naming.InitialContext.init(InitialContext.java:223)
| at javax.naming.InitialContext.<init>(InitialContext.java:197)
| at org.jboss.seam.util.Naming.getInitialContext(Naming.java:26)
| at org.jboss.seam.util.Naming.getInitialContext(Naming.java:37)
| at org.jboss.seam.util.Transactions.getUserTransaction(Transactions.java:48)
| at org.jboss.seam.util.Transactions.isTransactionActiveOrMarkedRollback(Transactions.java:30)
| at org.jboss.seam.jsf.SeamExtendedManagedPersistencePhaseListener.begin(SeamExtendedManagedPersistencePhaseListener.java:68)
| ... 22 more
| ERROR 09-12 20:08:33,609 (Log4JLogger.java:error:119) -Exception in PhaseListener RENDER_RESPONSE(6) beforePhase.
| java.lang.IllegalStateException: No active application scope
| at org.jboss.seam.core.Init.instance(Init.java:48)
| at org.jboss.seam.jsf.SeamExtendedManagedPersistencePhaseListener.beforePhase(SeamExtendedManagedPersistencePhaseListener.java:30)
| at org.apache.myfaces.lifecycle.PhaseListenerManager.informPhaseListenersBefore(PhaseListenerManager.java:70)
| at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:373)
| 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.jboss.seam.servlet.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:45)
| 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.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.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
| at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
| at java.lang.Thread.run(Thread.java:595)
| ERROR 09-12 20:08:36,015 (Log4JLogger.java:error:119) -Servlet.service() for servlet jsp threw exception
| javax.faces.el.EvaluationException: Cannot get value for expression '#{messages.Home}'
| at org.apache.myfaces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:402)
| at javax.faces.component.UIOutput.getValue(UIOutput.java:77)
| at org.apache.myfaces.shared_impl.renderkit.RendererUtils.getStringValue(RendererUtils.java:217)
| at org.apache.myfaces.shared_impl.renderkit.html.HtmlTextRendererBase.renderOutput(HtmlTextRendererBase.java:69)
| at org.apache.myfaces.shared_impl.renderkit.html.HtmlTextRendererBase.encodeEnd(HtmlTextRendererBase.java:57)
| at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:536)
| at javax.faces.webapp.UIComponentTag.encodeEnd(UIComponentTag.java:495)
| at javax.faces.webapp.UIComponentTag.doEndTag(UIComponentTag.java:363)
| at org.apache.jsp.home_jsp._jspx_meth_h_outputText_0(home_jsp.java:210)
| at org.apache.jsp.home_jsp._jspx_meth_f_view_0(home_jsp.java:160)
| at org.apache.jsp.home_jsp._jspService(home_jsp.java:124)
| at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
| 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:802)
| 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.jboss.seam.servlet.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:45)
| 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.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.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
| at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
| at java.lang.Thread.run(Thread.java:595)
| Caused by: java.lang.IllegalStateException: No active application scope
| at org.jboss.seam.core.Init.instance(Init.java:48)
| at org.jboss.seam.Component.getInstanceFromFactory(Component.java:1283)
| at org.jboss.seam.Component.getInstance(Component.java:1260)
| at org.jboss.seam.Component.getInstance(Component.java:1246)
| at org.jboss.seam.jsf.SeamVariableResolver.resolveVariable(SeamVariableResolver.java:44)
| at org.apache.myfaces.config.LastVariableResolverInChain.resolveVariable(LastVariableResolverInChain.java:42)
| at org.apache.myfaces.el.ValueBindingImpl$ELVariableResolver.resolveVariable(ValueBindingImpl.java:574)
| at org.apache.commons.el.NamedValue.evaluate(NamedValue.java:124)
| at org.apache.commons.el.ComplexValue.evaluate(ComplexValue.java:140)
| at org.apache.myfaces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:383)
| ... 44 more
| ERROR 09-12 20:08:36,015 (Log4JLogger.java:error:119) -uncaught exception handled by Seam
| javax.servlet.ServletException: Cannot get value for expression '#{messages.Home}'
| at javax.faces.webapp.FacesServlet.service(FacesServlet.java:152)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.jboss.seam.servlet.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:45)
| 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.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.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
| at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
| at java.lang.Thread.run(Thread.java:595)
| ERROR 09-12 20:08:36,015 (Log4JLogger.java:error:119) -could not roll back transaction
| javax.naming.NamingException: Local server is not initialized
| at org.jnp.interfaces.LocalOnlyContextFactory.getInitialContext(LocalOnlyContextFactory.java:45)
| at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
| at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
| at javax.naming.InitialContext.init(InitialContext.java:223)
| at javax.naming.InitialContext.<init>(InitialContext.java:197)
| at org.jboss.seam.util.Naming.getInitialContext(Naming.java:26)
| at org.jboss.seam.util.Naming.getInitialContext(Naming.java:37)
| at org.jboss.seam.util.Transactions.getUserTransaction(Transactions.java:48)
| at org.jboss.seam.util.Transactions.isTransactionActiveOrMarkedRollback(Transactions.java:30)
| at org.jboss.seam.servlet.SeamExceptionFilter.rollbackTransactionIfNecessary(SeamExceptionFilter.java:83)
| at org.jboss.seam.servlet.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:56)
| 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.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.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
| at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
| at java.lang.Thread.run(Thread.java:595)
| ERROR 09-12 20:08:36,015 (Log4JLogger.java:error:119) -Servlet.service() for servlet Faces Servlet threw exception
| javax.faces.FacesException: Cannot get value for expression '#{messages.Home}'
| at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:435)
| 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.jboss.seam.servlet.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:45)
| 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.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.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
| at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
| at java.lang.Thread.run(Thread.java:595)
| Caused by: javax.faces.el.EvaluationException: Cannot get value for expression '#{messages.Home}'
| at org.apache.myfaces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:402)
| at javax.faces.component.UIOutput.getValue(UIOutput.java:77)
| at org.apache.myfaces.shared_impl.renderkit.RendererUtils.getStringValue(RendererUtils.java:217)
| at org.apache.myfaces.shared_impl.renderkit.html.HtmlTextRendererBase.renderOutput(HtmlTextRendererBase.java:69)
| at org.apache.myfaces.shared_impl.renderkit.html.HtmlTextRendererBase.encodeEnd(HtmlTextRendererBase.java:57)
| at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:536)
| at javax.faces.webapp.UIComponentTag.encodeEnd(UIComponentTag.java:495)
| at javax.faces.webapp.UIComponentTag.doEndTag(UIComponentTag.java:363)
| at org.apache.jsp.home_jsp._jspx_meth_h_outputText_0(home_jsp.java:210)
| at org.apache.jsp.home_jsp._jspx_meth_f_view_0(home_jsp.java:160)
| at org.apache.jsp.home_jsp._jspService(home_jsp.java:124)
| at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
| 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:802)
| 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)
| ... 21 more
| Caused by: java.lang.IllegalStateException: No active application scope
| at org.jboss.seam.core.Init.instance(Init.java:48)
| at org.jboss.seam.Component.getInstanceFromFactory(Component.java:1283)
| at org.jboss.seam.Component.getInstance(Component.java:1260)
| at org.jboss.seam.Component.getInstance(Component.java:1246)
| at org.jboss.seam.jsf.SeamVariableResolver.resolveVariable(SeamVariableResolver.java:44)
| at org.apache.myfaces.config.LastVariableResolverInChain.resolveVariable(LastVariableResolverInChain.java:42)
| at org.apache.myfaces.el.ValueBindingImpl$ELVariableResolver.resolveVariable(ValueBindingImpl.java:574)
| at org.apache.commons.el.NamedValue.evaluate(NamedValue.java:124)
| at org.apache.commons.el.ComplexValue.evaluate(ComplexValue.java:140)
| at org.apache.myfaces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:383)
| ... 44 more
|
It seems configured according to the documentation, but if I cannot get the "reference" to run, what hope do I have to get my app to run? :)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3992417#3992417
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3992417
19 years, 7 months
[JBoss Seam] - Passing messages using JBoss Seam managed exception handling
by zzzz8
I'm having some issues displaying Faces messages... Please tell me what I'm doing wrong:
Here's a snippet of my code. I'm not sure if I'm supposed to use facesMessages or just call the constructor for the exception class, so I tried both:
facesMessages.add(FacesMessage.SEVERITY_ERROR, "Error!");
|
| throw new ApplicationException("Error!");
|
Here's the class definition for the ApplicationException class:
package test;
|
| public class ApplicationException extends Exception {
| public ApplicationException() {
| super();
| }
|
| public ApplicationException(final String inputExceptionText) {
| super(inputExceptionText);
| }
| }
Here's my exceptions.xml file (a snippet):
<exception class="test.ApplicationException">
| <redirect view-id="/pages/confirmation/applicationException.xhtml">
| </redirect>
| <end-conversation />
| </exception>
Here's the snippet of the xhtml file:
<ui:composition>
|
| <h:messages showDetail="true" />
|
| <h:form>
| <h:commandButton value="#{messages['GoBack']}" action="go_Home" />
| </h:form>
| </ui:composition>
| |
| | The page does get redirected to /pages/confirmation/applicationException.xhtml, so at least the redirection part does work. However, no error message is displayed... The button does get displayed, so the page contents are getting rendered. What am I doing wrong (i.e. why isn't the error message shown)? Thanks!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3992404#3992404
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3992404
19 years, 7 months
[JBoss jBPM] - Re: Get finished tasks
by zhongboqing
1, you can add the query in the file "org\jbpm\db\hibernate.queries.hbm.xml" ,like
<![CDATA[
select ti
from org.jbpm.taskmgmt.exe.TaskInstance as ti
where ti.actorId = :actorId
and ti.isOpen = true and ti.end is not null
]]>
2, you can add the method findFinishedTaskInstances int the java file "org\jbpm\db\TaskMgmtSession.java"
/**
* get the finished tasllist for a given actor.
*/
public List findFinishedTaskInstances(String actorId) {
List result = null;
try {
Query query = session.getNamedQuery("TaskMgmtSession.findFinishedTaskInstancesByActorId");
query.setString("actorId", actorId);
result = query.list();
} catch (Exception e) {
log.error(e);
jbpmSession.handleException();
throw new JbpmException("couldn't get task instances list for actor '"+actorId+"'", e);
}
return result;
}
3, rebuild the jpdl
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3992402#3992402
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3992402
19 years, 7 months
[JBoss Seam] - Re: Project setup with Icefaces
by atzbert
Well, I guess I can't do anything more for you than sending my web.xml content for comparison. I read somewhere that even the element order is kinda important.... Don't know...
| <?xml version="1.0" ?>
|
| <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">
|
| <context-param>
| <param-name>javax.faces.CONFIG_FILES</param-name>
| <param-value>/WEB-INF/navigation.xml</param-value>
| </context-param>
|
| <context-param>
| <param-name>facelets.LIBRARIES</param-name>
| <param-value>
| <!--/WEB-INF/tags/jsf-core.taglib.xml;-->
| /WEB-INF/tags/artfact.taglib.xml
| </param-value>
| </context-param>
|
| <listener>
| <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
| </listener>
|
| <listener>
| <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
| </listener>
|
| <context-param>
| <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
| <param-value>client</param-value>
| </context-param>
|
| <context-param>
| <param-name>facelets.DEVELOPMENT</param-name>
| <param-value>true</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>com.icesoft.faces.actionURLSuffix</param-name>
| <param-value>.seam</param-value>
| </context-param>
|
| <context-param>
| <param-name>com.icesoft.faces.synchronousUpdate</param-name>
| <param-value>true</param-value>
| </context-param>
|
| <filter>
| <filter-name>Seam Exception Filter</filter-name>
| <filter-class>org.jboss.seam.servlet.SeamExceptionFilter</filter-class>
| </filter>
|
| <filter-mapping>
| <filter-name>Seam Exception Filter</filter-name>
| <url-pattern>/*</url-pattern>
| </filter-mapping>
|
| <servlet>
| <servlet-name>Faces Servlet</servlet-name>
| <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
| <load-on-startup>1</load-on-startup>
| </servlet>
|
| <!-- ICEFACES -->
| <servlet>
| <servlet-name>Blocking Servlet</servlet-name>
| <servlet-class>com.icesoft.faces.webapp.xmlhttp.BlockingServlet</servlet-class>
| <load-on-startup> 1 </load-on-startup>
| </servlet>
|
| <servlet>
| <servlet-name>Persistent Faces Servlet</servlet-name>
| <servlet-class>com.icesoft.faces.webapp.xmlhttp.PersistentFacesServlet</servlet-class>
| <load-on-startup>1</load-on-startup>
| </servlet>
|
| <servlet-mapping>
| <servlet-name>Persistent Faces Servlet</servlet-name>
| <url-pattern>/xmlhttp/*</url-pattern>
| </servlet-mapping>
|
| <servlet-mapping>
| <servlet-name>Persistent Faces Servlet</servlet-name>
| <url-pattern>/xmlhttp/*</url-pattern>
| </servlet-mapping>
|
| <servlet-mapping>
| <servlet-name>Persistent Faces Servlet</servlet-name>
| <url-pattern>*.iface</url-pattern>
| </servlet-mapping>
|
| <!-- Blocking Servlet Mapping -->
| <servlet-mapping>
| <servlet-name>Blocking Servlet</servlet-name>
| <url-pattern>/block/*</url-pattern>
| </servlet-mapping>
| <servlet-mapping>
| <servlet-name>Persistent Faces Servlet</servlet-name>
| <url-pattern>*.seam</url-pattern>
| </servlet-mapping>
| </web-app>
|
Good luck!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3992390#3992390
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3992390
19 years, 7 months
[Messaging, JMS & JBossMQ] - Re: namenotfound exception in JMS Client
by nsv
i have a queue connection factory and topic connection factory ,
i need to use both of them in my jmsclient
but i try to use these connection factories i get the exception as
AlarmMgrConnectionFactory not bound and also EventConnectionFactory not bound
But as per the server.log files these connection factories are bound
below is my code of jmsclient program, please check the program and let me know what i need to do to make this program run
| import com.tlc.utils.Utility;
| import com.tlc.event.TLEvent;
| import java.math.BigInteger;
| import java.io.*;
| import javax.jms.*;
| import java.util.*;
| import javax.naming.*;
| import java.rmi.RemoteException;
| import javax.rmi.PortableRemoteObject;
| import javax.ejb.CreateException;
| import java.sql.Timestamp;
| import org.apache.log4j.*;
|
| /**
| * The class schedules and manages time-based events.
| * External modules can interface with the AlarmManager only via JMS Messages.
| * See package level comments on how to send messages to the AlarmManager,
| * what kind of messages are sent by the AlarmManager.
| */
|
| public class AlarmManager extends TimerTask implements MessageListener
| {
| private static Category logger = Category.getInstance(AlarmManager.class.getName());
| private static java.util.Date now = new java.util.Date();
|
| private static final long CONNECTION_INITIAL_WAIT = 10000; // 10 seconds
| private static final long CONNECTION_TEST_PERIOD = 180000; // 3 minutes
| private static final long EVENT_RETRY_PERIOD = 300000; // 5 minutes
| private static final int MSG_PRIORITY = 5;
| private static final long MSG_TIMETOLIVE = 3600000; // One hour
| public String TLPROP_CLUSTER_MEMBERS = "cluster_members";
| private static String initJNDIInitialContextFactory = null;
| private static String initJMSInitialContextFactory = null;
| private static String initJMSAlarmConnFactoryName = "AlarmMgrConnectionFactory";
| private static String initJMSEventConnFactoryName = "EventConnectionFactory";
| private static String initJMSAlarmQueue = "queue/AlarmMgrRecvQueue";
| private static String initJMSEventTopic = "topic/Event";
| private static String initJMSProviders = "localhost:3099";
| private static String initAlarmHomeName = null;
|
| public static final String MSG_ADD_ALARM = "ADD_ALARM";
| public static final String MSG_DEL_ALARM = "DEL_ALARM";
|
| public static final String MSGTYPE = "MSGTYPE";
| public static final String ALARM_ID = "ALARM_ID";
| public static final String TIMESTAMP = "TIMESTAMP";
| public static final String TIMEINTERVAL = "TIMEINTERVAL";
| public static final String CID = "CID";
| public static final String USERID = "USERID";
| public Vector clusterMembers = new Vector();
| private Properties tlGlobalProperties = null;
|
| /*
| * The connectionTimer is used to periodically check the status of the
| * the JMS connections to all servers in the cluster and to attempt to
| * reestablish them, if necessary.
| */
| private Timer connectionTimer = null;
|
| /*
| * The alarmTimer is used to schedule all alarms.
| */
| private Timer alarmTimer = null;
|
| private boolean isActive = false;
| private Map alarmtasks = null;
| private Vector servers = new Vector();
|
| /*
| * Instances of the Server class are used to represent each server in the cluster
| */
| private static class Server implements ExceptionListener
| {
| public boolean valid;
| public AlarmManager am;
| public String provider;
| public javax.jms.Queue alarmQ;
| public javax.jms.Topic eventT;
| public String alarmQName;
| public String eventTName;
| public QueueConnection qconnection;
| public TopicConnection tconnection;
| public TopicSession tsession;
| public TopicPublisher eventPublisher;
| public QueueReceiver alarmReceiver;
| public Alarm alarmEJB;
|
| public Server(AlarmManager am, String provider)
| {
| this.valid = false;
| this.am = am;
| this.provider = provider;
| this.alarmQName = alarmQName;
| this.eventTName = eventTName;
| this.alarmQ = null;
| this.eventT = null;
| this.qconnection = null;
| this.tconnection = null;
| this.tsession = null;
| this.eventPublisher = null;
| this.alarmReceiver = null;
| this.alarmEJB = null;
| }
|
| public void init() throws NamingException, JMSException, RemoteException, CreateException
| {
| // Set up JMS stuff
| Hashtable env = new Hashtable();
| env.put(Context.INITIAL_CONTEXT_FACTORY, initJMSInitialContextFactory);
| System.out.println("initJMSInitialContextFactory" + initJMSInitialContextFactory);
| env.put(Context.PROVIDER_URL, provider);
| System.out.println("provider" + provider);
| InitialContext ctx = new InitialContext(env);
|
| qconnection = ((QueueConnectionFactory)ctx.lookup(initJMSAlarmConnFactoryName)).createQueueConnection();
| System.out.println("initJMSAlarmConnFactoryName " + initJMSAlarmConnFactoryName);
| qconnection.setExceptionListener(this);
| QueueSession qsession = qconnection.createQueueSession(false, Session.CLIENT_ACKNOWLEDGE);
| alarmQ = (javax.jms.Queue)ctx.lookup(initJMSAlarmQueue);
| alarmReceiver = qsession.createReceiver(alarmQ);
| alarmReceiver.setMessageListener(am);
|
| tconnection = ((TopicConnectionFactory)ctx.lookup(initJMSEventConnFactoryName)).createTopicConnection();
| tconnection.setExceptionListener(this);
| tsession = tconnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
| eventT = (Topic)ctx.lookup(initJMSEventTopic);
| eventPublisher = tsession.createPublisher(eventT);
|
| ctx.close();
|
| // Get Alarm EJB
| env.put(Context.INITIAL_CONTEXT_FACTORY, initJNDIInitialContextFactory);
| ctx = new InitialContext(env);
| Object obj = ctx.lookup(initAlarmHomeName);
| AlarmHome home = (AlarmHome)PortableRemoteObject.narrow(obj, AlarmHome.class);
| alarmEJB = home.create();
| ctx.close();
|
| valid = true;
| }
|
| public void onException(JMSException ex)
| {
| logger.error("onException() called", ex);
| valid = false;
| try {
| qconnection.close();
| tconnection.close();
| alarmEJB.remove();
| }
| catch (Exception e) {
| // ignore
| }
| finally {
| am.onServerException(this);
| }
| }
|
| public void start()
| {
| if (valid) {
| try {
| qconnection.start();
| tconnection.start();
| }
| catch (JMSException e) {
| // ignore
| }
| }
| }
|
| public void stop()
| {
| if (valid) {
| try {
| qconnection.close();
| tconnection.close();
| }
| catch (JMSException e) {
| // ignore
| }
| }
| }
| }
|
| public static void main(String args[])
| {
| // If a Log4j config file specified as an argument, use it.
| // Otherwise, if there is a "logger.props" in the current directory, use it.
| // If none of the above, configure the logger statically.
| if (args.length > 0)
| PropertyConfigurator.configure(args[0]);
| else {
| File configFile = new File("logger.props");
| if (configFile.exists())
| PropertyConfigurator.configure("logger.props");
| else {
| try {
| RollingFileAppender rfap =
| new RollingFileAppender(new PatternLayout("%5p %d{DATE} [%t] (%F:%L) - %m%n"), "am.log", true);
| rfap.setMaxBackupIndex(5);
| rfap.setMaxFileSize("1MB");
| BasicConfigurator.configure(rfap);
| }
| catch (IOException e) {
| BasicConfigurator.configure();
| }
| logger.setLevel(Level.DEBUG);
| }
| }
|
| AlarmManager as = new AlarmManager();
| }
|
| public Properties getTLProps() throws Exception
| {
| if (tlGlobalProperties == null) {
| // TightLink global properties
| String tlPropFile ="C:\\jboss\\bin\\Tightlink_prod\\config\\TLGlobal.properties";
| Properties tlProps = new Properties();
| try {
| tlProps.load(new FileInputStream(tlPropFile));
| tlGlobalProperties = tlProps;
| String prop = tlProps.getProperty(TLPROP_CLUSTER_MEMBERS);
| if (prop != null) {
| StringTokenizer stk = new StringTokenizer(prop, ";");
| while (stk.hasMoreTokens()) {
| clusterMembers.addElement(stk.nextToken().trim());
| }
| }
| }
| catch (FileNotFoundException fe) {
| throw new Exception(fe.getMessage());
| }
| catch (IOException ioe) {
| throw new Exception(ioe.getMessage());
| }
| }
| return tlGlobalProperties;
| }
|
| public AlarmManager()
| {
| try {
| // Get initialization parameters (from TLGlobal.properties):
| Properties globalProps = getTLProps();
| initJNDIInitialContextFactory = globalProps.getProperty("jndi_context_factory");
| initJMSInitialContextFactory = globalProps.getProperty("jms_context_factory");
| initJMSAlarmConnFactoryName = globalProps.getProperty("jms_alarm_connection_factory");
| initJMSEventConnFactoryName = globalProps.getProperty("jms_event_connection_factory");
| initJMSAlarmQueue = globalProps.getProperty("jms_alarm_queue");
| initJMSEventTopic = globalProps.getProperty("jms_event_topic");
| initJMSProviders = globalProps.getProperty("cluster_members");
| initAlarmHomeName = globalProps.getProperty("alarm_home");
| }
| catch (Exception ex) {
| logger.error("Error getting initialization properties.", ex);
| System.exit(1);
| return;
| }
|
| if (initJMSProviders != null) {
| StringTokenizer stk = new StringTokenizer(initJMSProviders, ",;");
| while (stk.hasMoreTokens()) {
| String provider = stk.nextToken().trim();
| Server s = new Server(this, provider);
| servers.add(s);
| //logger.debug("Added server: " + provider);
| }
| }
| else {
| logger.error("Error: no JMS providers (cluster members) specified.");
| System.exit(1);
| return;
| }
|
| connectionTimer = new Timer();
| connectionTimer.schedule(this, CONNECTION_INITIAL_WAIT, CONNECTION_TEST_PERIOD);
| }
|
| /**
| * This method (part of TimerTask interface) is called by the connectionTimer
| * periodically to test conncetions to the servers in the cluster.
| */
| public void run()
| {
| testConnections();
| }
|
| /**
| * Checks JMS connections to servers in the cluster and reestablishes them
| * if needed.
| */
| private void testConnections()
| {
| logger.debug("Entering testConnections()");
| int upServers = 0;
| Enumeration enum1 = servers.elements();
| if (enum1 != null) {
| while (enum1.hasMoreElements()) {
| Server s = (Server)enum1.nextElement();
| if (!s.valid) {
| try {
| s.init();
| upServers++;
| }
| catch (Exception ex) {
| logger.error("Error initializing " + s.provider, ex);
| s.stop();
| continue;
| }
| }
| else
| upServers++;
| }
| }
| if (upServers == 0) {
| logger.error("Couldn't connect to any servers.");
| setActive(false);
| }
| else if (!isActive) {
| setActive(true);
| }
| logger.debug("Exiting testConnections()");
| }
|
| /**
| * This method forces this instance of AlarmManager to become active or inactive.
| */
| private void setActive(boolean active)
| {
| if (active) {
| loadAlarms();
| // start processing JMS messages
| Enumeration enum1 = servers.elements();
| if (enum1 != null) {
| while (enum1.hasMoreElements()) {
| Server s = (Server)enum1.nextElement();
| s.start();
| }
| }
| isActive = true;
| }
| else {
| // stop processing JMS messages
| Enumeration enum1 = servers.elements();
| if (enum1 != null) {
| while (enum1.hasMoreElements()) {
| Server s = (Server)enum1.nextElement();
| s.stop();
| }
| }
|
| // stop alarm timer
| if (alarmTimer != null) {
| alarmTimer.cancel();
| alarmTimer = null;
| }
| isActive = false;
| }
| }
|
| /**
| * Invoked by JMS Provider when a JMS message is received for this
| * Alarm Manager.
| */
| public void onMessage(Message msg)
| {
| logger.debug("Entering onMessage()");
| try {
| String msgType = msg.getStringProperty(MSGTYPE);
| logger.debug("Message type: " + msgType);
| if (msgType == null) {
| logger.debug("Message Type is not set...");
| return;
| }
| else if (msgType.equals(MSG_ADD_ALARM)) {
| logger.debug("Add Alarm received...");
| createAlarm(msg);
| }
| else if (msgType.equals(MSG_DEL_ALARM)) {
| logger.debug("Delete Alarm received...");
| deleteAlarm(msg);
| }
| else {
| logger.debug("Invalid message type: " + msgType);
| return;
| }
|
| // Acknowledge the JMS message
| msg.acknowledge();
| }
| catch (Exception e) {
| logger.error("Exception in onMessage()", e);
| }
| finally {
| logger.debug("Exiting onMessage()");
| }
| }
|
| /**
| * This method is called by a Server after it has caught a JMS exception
| * and stopped itself.
| */
| public void onServerException(Server as)
| {
| isActive = false;
| Enumeration enum1 = servers.elements();
| if (enum1 != null) {
| while (enum1.hasMoreElements()) {
| Server s = (Server)enum1.nextElement();
| if (s.valid) {
| isActive = true;
| break;
| }
| }
| }
| }
|
| /**
| * Deletes the Alarm specified in the JMS message from the Alarms Table
| */
| private void deleteAlarm(Message msg)
| {
| logger.debug("Entering deleteAlarm(Message)");
| try {
| String alarmID = msg.getStringProperty(ALARM_ID);
| AlarmTask at = (AlarmTask)alarmtasks.get(alarmID);
| if (at == null)
| return;
| else
| deleteAlarm(at);
| }
| catch (JMSException e) {
| logger.error("Exception in deleteAlarm()", e);
| }
| finally {
| logger.debug("Exiting deleteAlarm(Message)");
| }
| }
|
| /**
| * Deletes the Alarm corresponding to an AlarmTask
| */
| private void deleteAlarm(AlarmTask at)
| {
| logger.debug("Entering deleteAlarm(AlarmTask)");
| try {
| logger.debug("Deleting Alarm...");
|
| at.setDeleted(true);
| alarmtasks.remove(at.getId());
| Alarm alarm = getAlarmEJB();
| alarm.deleteAlarm(at.getId());
| }
| catch (Exception e) {
| logger.error("Exception in deleteAlarm()", e);
| }
| finally {
| logger.debug("Exiting deleteAlarm(AlarmTask)");
| }
| }
|
| /**
| * This method creates a time-based alarm. It adds
| * the Alarm to the Alarms table, and schedules it with the Timer.
| */
| private void createAlarm(Message msg)
| {
| logger.debug("Entering createAlarm()");
| try {
| ObjectMessage omsg = (ObjectMessage) msg;
| HashMap hm = (HashMap)omsg.getObject();
| Timestamp ts = null;
| //This will be either Integer or Long
| Object tStamp;
|
| if ((hm.get(TIMESTAMP) == null) && (hm.get(TIMEINTERVAL) == null)) {
| logger.debug("NO Timestamp or TimeInterval specified for ALARM message");
| return;
| }
|
| if (hm.get(TIMEINTERVAL) != null) {
| //The following code is to get the long value from tStamp.
| //tStamp - Long object when we use "times"(multiply) in rule engine.
| //tStamp - Integer when we directly get it from TLObject.
| //tStamp - value in milliSeconds
| tStamp = (Object)hm.get(TIMEINTERVAL);
| logger.debug("Processing TIMEINTERVAL tStamp is : " + tStamp.toString());
| ts = new Timestamp(now().getTime() + ((new Long(tStamp.toString())).longValue()));
| }
| else {
| //For absolute time tStamp is java.util.Date
| tStamp = (Object) hm.get(TIMESTAMP);
| logger.debug("Processing TIMESTAMP tStamp is : " + tStamp.toString());
| ts = new Timestamp(((java.util.Date)tStamp).getTime());
| }
|
| String id = newID();
| Alarm alarm = getAlarmEJB();
| alarm.createAlarm(id, ts, hm);
|
| // Schedule a Timer Task as well...
| AlarmTask at = new AlarmTask(this, id, ts, hm);
| alarmTimer.schedule(at, ts);
| alarmtasks.put(id, at);
| logger.debug("Created AlarmTask");
| }
| catch (Exception e) {
| logger.error("Exception in createAlarm()", e);
| }
| finally {
| logger.debug("Exiting createAlarm()");
| }
| }
|
| /**
| * Loads alarms from the Alarms table and schedules them with
| * the Alarm Timer.
| */
| public void loadAlarms()
| {
| logger.debug("Entering loadAlarms()");
|
| if (alarmTimer != null)
| alarmTimer.cancel();
| alarmTimer = new Timer();
|
| try {
| Alarm alarm = getAlarmEJB();
| Iterator it = alarm.getAlarms().iterator();
| Vector tasks = new Vector();
|
| while (it.hasNext()) {
| Object[] row = (Object[])it.next();
| AlarmTask at = new AlarmTask(this, (String)row[0], (Timestamp)row[1], (HashMap)row[2]);
| tasks.add(at);
| logger.debug("Added alarm task for id: " + at.getId());
| }
|
| if (alarmtasks != null)
| alarmtasks.clear();
| else {
| // The alarmtasks HashMap is synchronized
| alarmtasks = Collections.synchronizedMap(new HashMap());
| }
| for (int i=0; i < tasks.size(); i++) {
| AlarmTask at = (AlarmTask)tasks.get(i);
| alarmTimer.schedule(at, at.getTimestamp());
| alarmtasks.put(at.getId(), at);
| }
| logger.debug("Loaded alarms...");
| }
| catch (Exception e) {
| logger.error("Exception in loadAlarms()", e);
| }
| finally {
| logger.debug("Exiting loadAlarms()");
| }
| }
|
| public void alarmExpired(AlarmTask at)
| {
| logger.debug("Entering alarmExpired()");
| try {
| HashMap hm = at.getHashMap();
| Object obj = (Object)hm.get(AlarmManager.CID);
| String cid = (obj != null ? obj.toString() : "");
| obj = (Object)hm.get(AlarmManager.USERID);
| String userId = (obj != null ? obj.toString() : "");
| hm.put(AlarmManager.ALARM_ID, at.getId());
| TLEvent event = new TLEvent(TLEvent.ALARM_EXPIRED, new Long(now().getTime()), userId, null , cid , hm);
| if (sendEvent(event)) {
| deleteAlarm(at);
| }
| else {
| // Couldn't send the ALARM_EXPIRED event
| // Try it again in EVENT_RETRY_PERIOD
| alarmTimer.schedule(at, EVENT_RETRY_PERIOD);
| }
| }
| catch (Exception e) {
| logger.error("Exception in alarmExpired()", e);
| }
| finally {
| logger.debug("Exiting alarmExpired()");
| }
| }
|
| private boolean sendEvent(TLEvent ev)
| {
| logger.debug("Entering sendEvent()");
| boolean success = false;
| Enumeration enum1 = servers.elements();
| if (enum1 != null) {
| while (enum1.hasMoreElements() && !success) {
| Server s = (Server)enum1.nextElement();
| if (s.valid) {
| try {
| ObjectMessage omsg = s.tsession.createObjectMessage(ev);
| s.eventPublisher.publish(omsg, DeliveryMode.PERSISTENT, MSG_PRIORITY, MSG_TIMETOLIVE);
| success = true;
| }
| catch (JMSException ex) {
| // Mark this connection bad so it can be reinitialized next time
| logger.error("Error sending event to " + s.provider, ex);
| s.stop();
| s.valid = false;
| // Go on and try to find another server to send to
| }
| }
| }
| }
| logger.debug("Exiting sendEvent() - ret=" + success);
| return success;
| }
|
| private Alarm getAlarmEJB() throws Exception
| {
| Alarm alarm = null;
| Enumeration enum1 = servers.elements();
| if (enum1 != null) {
| while ((alarm == null) && enum1.hasMoreElements()) {
| Server s = (Server)enum1.nextElement();
| if (s.valid)
| alarm = s.alarmEJB;
| }
| }
|
| if (alarm == null)
| throw new Exception("Unable to get an Alarm EJB.");
|
| return alarm;
| }
|
| /**
| * Returns a unique string for use as an ALARM ID.
| */
| private String newID()
| {
| long timetick = System.currentTimeMillis();
| Random rd = new Random(timetick);
| BigInteger bi = new BigInteger(64, rd);
| bi.shiftLeft(64);
| BigInteger bi1 = BigInteger.valueOf(timetick);
| bi = bi.add(bi1);
| return bi.toString(36);
| }
|
| private synchronized java.util.Date now()
| {
| now.setTime(System.currentTimeMillis());
| return now;
| }
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3992382#3992382
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3992382
19 years, 7 months
[JBoss Seam] - Re: Seam configuration questions
by norman.richards@jboss.com
For in-depth classloader discussions, you are probably better off in one of the JBoss AS forums.
1) Yes, each deployment gets 1 UCL that covers the entire archive, including sub-deployments
2) Every class in a deployment can see every other class in that same deployment (WAR files are a special case)
3) WAR files are special because the servlet spec says they should be special. If you have two WAR files in an EAR, they should not see eachothers classes. So, JBoss does not add WEB-INF/classes or WEB-INF/lib/* to the UCL by default. You can change this behavior by setting the UseJBossWebLoader option. When you do that, tomcat will use the deployment UCL for web app loading, making everything visible throughout your app.
4) Every archive has it's own UCL. A scoped application has a UCL that points to it's own repository instead of to the main repository.
5) In general, one app should be able to look up and use beans in another app on the same server. If there aren't common class definitions between the two apps, you have to go through serialization. This is costly, though JBoss people often make the mistake of over-emphasizing the cost. (by comparing the cost of serialization to the cost of a direct call without considering the amount of work being done in the call)
My general belief is that shared class definitions is a bad thing for applications and a good thing for services. I would always scope my applications in the absence of a compelling reason not to.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3992376#3992376
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3992376
19 years, 7 months
[JBoss Seam] - Project setup with Icefaces
by dustismo
I have finally gotten a test Seam app to work with mysql. Now I would like to try Icefaces. Problem is, I have no idea how to integrate Icefaces. I have added all the appropriate jars, and changed the web.xml to the one from the icefaces example. I also replaced the faces-config.xml. Surprise, surprise this didn't work..
Here is 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">
|
|
|
| <context-param>
|
| <param-name>javax.faces.CONFIG_FILES</param-name>
|
| <param-value>/WEB-INF/navigation.xml</param-value>
|
| </context-param>
|
|
|
| <!-- 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>
|
| <filter-name>Seam Exception Filter</filter-name>
|
| <filter-class>org.jboss.seam.servlet.SeamExceptionFilter</filter-class>
|
| </filter>
|
|
|
| <filter-mapping>
|
| <filter-name>Seam Exception Filter</filter-name>
|
| <url-pattern>*.seam</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>
|
|
|
| <context-param>
|
| <param-name>com.icesoft.faces.actionURLSuffix</param-name>
|
| <param-value>.seam</param-value>
|
| </context-param>
|
|
|
| <context-param>
|
| <param-name>com.icesoft.faces.synchronousUpdate</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>
|
|
|
| <!-- Faces Servlet Mapping -->
|
| <!--
|
| <servlet-mapping>
|
| <servlet-name>Faces Servlet</servlet-name>
|
| <url-pattern>*.seam</url-pattern>
|
| </servlet-mapping>
|
|
|
| -->
|
|
|
| <servlet>
|
| <servlet-name>Blocking Servlet</servlet-name>
|
| <servlet-class>com.icesoft.faces.webapp.xmlhttp.BlockingServlet</servlet-class>
|
| <load-on-startup> 1 </load-on-startup>
|
| </servlet>
|
|
|
| <servlet>
|
| <servlet-name>Persistent Faces Servlet</servlet-name>
|
| <servlet-class>com.icesoft.faces.webapp.xmlhttp.PersistentFacesServlet</servlet-class>
|
| <load-on-startup>1</load-on-startup>
|
| </servlet>
|
|
|
| <servlet-mapping>
|
| <servlet-name>Persistent Faces Servlet</servlet-name>
|
| <url-pattern>/xmlhttp/*</url-pattern>
|
| </servlet-mapping>
|
|
|
| <servlet-mapping>
|
| <servlet-name>Persistent Faces Servlet</servlet-name>
|
| <url-pattern>/xmlhttp/*</url-pattern>
|
| </servlet-mapping>
|
|
|
| <servlet-mapping>
|
| <servlet-name>Persistent Faces Servlet</servlet-name>
|
| <url-pattern>*.iface</url-pattern>
|
| </servlet-mapping>
|
|
|
| <!-- Blocking Servlet Mapping -->
|
| <servlet-mapping>
|
| <servlet-name>Blocking Servlet</servlet-name>
|
| <url-pattern>/block/*</url-pattern>
|
| </servlet-mapping>
|
|
|
| <!-- Faces Servlet Mapping -->
|
| <servlet-mapping>
|
| <servlet-name>Persistent Faces Servlet</servlet-name>
|
| <url-pattern>*.seam</url-pattern>
|
| </servlet-mapping>
|
|
|
| <!-- MyFaces -->
|
| <listener>
|
| <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
|
| </listener>
|
|
|
| <!-- JSF RI -->
|
| <!--
|
| <listener>
|
| <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
|
| </listener>
|
| -->
|
|
|
| </web-app>
|
Here is my faces-config.xml
|
| <?xml version='1.0' encoding='UTF-8'?>
|
| <?xml version="1.0" encoding="UTF-8"?>
| <!DOCTYPE faces-config
| PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
| "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
|
| <faces-config>
|
| <managed-bean>
| <managed-bean-name>highlight</managed-bean-name>
| <managed-bean-class>com.icesoft.faces.context.effects.Highlight</managed-bean-class>
| <managed-bean-scope>application</managed-bean-scope>
| </managed-bean>
|
| <application>
| <view-handler>com.icesoft.faces.facelets.D2DSeamFaceletViewHandler</view-handler>
| </application>
|
| <!-- Select one of the standard transaction models for the Seam application -->
|
| <lifecycle>
| <phase-listener>org.jboss.seam.jsf.SeamPhaseListener</phase-listener>
| </lifecycle>
|
| </faces-config>
|
|
I am using jboss 4.0.5GA and seam 1.1.0.CR2
The project was generated using seam-gen (ideally I think the project setup should ask whether you want to use Icefaces and configure it accordingly).
Here is the error message I get
| 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>
| <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
| </listener>
|
| at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:90)
| at javax.faces.webapp.FacesServlet.init(FacesServlet.java:88)
| ....
| ....
|
Any help?
Thanks much,
Dustin
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3992374#3992374
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3992374
19 years, 7 months
[EJB 3.0] - How to get EnitityManager in SLSB without injection??
by ablevine1
Does anyone know how to get an EntityManager refernce from withing a statelesss session bean without using injection?? I have tried the following but with no success:
| EntityManagerFactory emf = getEntityManagerFactory("MyPersistenceUnitName");
| EntityManager em = emf.createEntityManager();
|
but this just fails with the following exception:
| javax.persistence.PersistenceException: No Persistence provider for EntityManager named PurchaseNotification
| at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:41)
| at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:27)
| at com.squaretrade.queueing.QueueingEngine.execute(QueueingEngine.java:36)
| at sun.reflect.GeneratedMethodAccessor221.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
| at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
| at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
| ... 40 more
|
When I use injection it works
| @PersistenceContext(unitName = "MyPersistenceContext")
| EntityManager em;
|
But I need be able to get refernces to EntityManagers for various different perstence units on the fly from within my session bean so injection is not an option. any suggestions would be appreciated
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3992358#3992358
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3992358
19 years, 7 months
[JBossWS] - wstools and so
by mchamoun
i m having the following error when i try to generate jbossws artifacts
| Running JBossWS wstools for [IPayment]
| directory: C:\DATA\jboss-4.0.5.GA\bin
| command: cmd.exe /C wstools.bat -config C:\DOCUME~1\MIL~1\LOCALS~1\Temp\wstools-config48758.xml -dest C:\workspace1\TESTWS\TESTWS
| ========================================================================="
| .
| WSTools Environment
| .
| JBOSS_HOME: C:\DATA\jboss-4.0.5.GA\bin\\..
| .
| JAVA: C:\Program Files\Java\jdk1.5.0_09\bin\java
| .
| JAVA_OPTS:
| .
| ========================================================================="
| .
| Exception in thread "main" java.lang.NullPointerException
| at java.io.File.<init>(File.java:194)
| at org.jboss.ws.tools.helpers.ToolsHelper.handleWSDLToJavaGeneration(ToolsHelper.java:282)
| at org.jboss.ws.tools.WSTools.process(WSTools.java:138)
| at org.jboss.ws.tools.WSTools.generate(WSTools.java:120)
| at org.jboss.ws.tools.WSTools.main(WSTools.java:61)
|
and this is my wstools-config.xml
| <?xml version="1.0" encoding="UTF-8" ?>
| - <jbos:configuration xmlns:jbos="http://www.jboss.org/jbossws-tools">
| - <jbos:wsdl-java file="C:\DOCUME~1\MIL~1\LOCALS~1\Temp\tempdir48759.tmp\PaymentWS.wsdl" unwrap="true">
| <jbos:mapping file="jaxrpc-mapping.xml" />
| </jbos:wsdl-java>
| </jbos:configuration>
|
|
can someone please help me resolve this error
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3992354#3992354
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3992354
19 years, 7 months
[Messaging, JMS & JBossMQ] - Re: namenotfound exception in JMS Client
by nsv
sorry misunderstood,
i tried without java: but still it doe not work, i get the same error
AlarmMgrConnectionFactory not bound
please see the below code
Properties properties = new Properties();
| properties.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
| properties.put(Context.URL_PKG_PREFIXES, "org.jnp.interfaces");
| properties.put(Context.PROVIDER_URL, "localhost:3099");
| InitialContext ctx = new InitialContext(properties);
| Object obj = ctx.lookup("AlarmMgrConnectionFactory");
But in the server log file i see that AlarmMgrConnectionFactory jndiname is java:AlarmMgrConnectionFactory
below are the lines from the log file
2006-12-09 03:18:37,501 DEBUG [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] Binding object 'org.jboss.resource.adapter.jms.JmsConnectionFactoryImpl@c8f0a4' into JNDI at 'java:AlarmMgrConnectionFactory'
| 2006-12-09 03:18:37,501 INFO [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=ConnectionFactoryBinding,name=AlarmMgrConnectionFactory' to JNDI name 'java:AlarmMgrConnectionFactory'
| 2006-12-09 03:18:37,501 DEBUG [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] Started jboss.jca:service=ConnectionFactoryBinding,name=AlarmMgrConnectionFactory
| 2006-12-09 03:18:37,501 DEBUG [org.jboss.system.ServiceController] Starting dependent components for: jboss.jca:service=ConnectionFactoryBinding,name=AlarmMgrConnectionFactory dependent components: []
| 2006-12-09 03:18:37,501 DEBUG [org.jboss.system.ServiceController] starting service jboss.jca:service=ConnectionFactoryBinding,name=AlarmMgrConnectionFactory
| 2006-12-09 03:18:37,501 DEBUG [org.jboss.system.ServiceController] Ignoring start request for service: jboss.jca:service=ConnectionFactoryBinding,name=AlarmMgrConnectionFactory
| 2006-12-09 03:18:37,501 DEBUG [org.jboss.system.ServiceController] starting service jboss.jca:service=TxCM,name=EventConnectionFactory
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3992350#3992350
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3992350
19 years, 7 months
[JBoss Portal] - Popup window from portlet?
by ekusnitz
JBoss Portal Version 2.4.1
Did you get Portal from CVS? or download it? download
JBoss AS Version jboss-4.0.5.GA
Database Vendor and Version Oracle 10g
JDBC Connector and Version - N/A
OS Platform Windows XP SP2
JBoss Seam 1.1.CR2
We have an application where we would like to do a popup window from our portlet. We are opening the wndow via javascript like this:
| var url = "/em/pages/em/feedbackPopup.xhtml?controlSetId=" + id;
| var winSettings = "center:yes;resizable:yes;dialogHeight:300px";
|
| window.open(url, null, winSettings);
|
By using the relative address, we want to cirumvent the portlet and call our Seam page directly. However, when we do so, we get the following error:
| 16:39:19,380 ERROR [STDERR] Dec 8, 2006 4:39:19 PM com.sun.facelets.FaceletViewHandler handleRenderException
| SEVERE: Error Rendering View[/pages/em/feedbackPopup.xhtml]
| java.lang.ClassCastException: org.apache.catalina.connector.RequestFacade
| at com.sun.facelets.FaceletPortletViewHandler.createResponseWriter(FaceletPortletViewHandler.java:29)
| at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:527)
| 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.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)
|
So we are in the FaceletViewHandler, which makes sense because it's the one we are using in our /em application for the portlet. I guess it's looking for a RenderResponse when we have a simple HttpServletResonse. But it prevents us from doing what we need to do. Is there a way of doing a simple popup from a portlet?
Thanks in advance
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3992349#3992349
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3992349
19 years, 7 months