[JBoss Seam] - Re: Seam component instantiation problem
by klsateesh
Hi,
I am also having an issue with the Instantiation of the Seam Component..
I am trying the HelloWorld App in examples/remoting..
In the JBoss Server log i see the component..
|
| 13:43:42,828 INFO [Scanner] scanning: /D:/Projects/DPA/Jboss4.0.4/server/default/tmp/deploy/tmp43419MySeamTest.ear-cont
| ents/MySeamTest-ejb.jar
| 13:43:42,828 INFO [Component] Component: helloAction, scope: STATELESS, type: STATELESS_SESSION_BEAN, class: org.jboss.
| seam.example.remoting.HelloAction, JNDI: MySeamTest-war/HelloAction/local
| 13:43:42,984 INFO [Initialization] done initializing Seam
|
|
Note: i have created an EAR App (MySeamtest) in NetBeans and hence the name MySeamTest.ear..
And when i run the App it is accepting the User Name and the throwing the following Exception..
| 13:43:58,429 ERROR [ExecutionHandler] Error during remote request
| org.jboss.seam.InstantiationException: Could not instantiate Seam component: helloAction
| at org.jboss.seam.Component.newInstance(Component.java:735)
| at org.jboss.seam.Component.newInstance(Component.java:1308)
| at org.jboss.seam.Component.getInstance(Component.java:1263)
| at org.jboss.seam.Component.getInstance(Component.java:1246)
| at org.jboss.seam.remoting.Call.execute(Call.java:101)
| at org.jboss.seam.remoting.ExecutionHandler.handle(ExecutionHandler.java:92)
| at org.jboss.seam.remoting.SeamRemotingServlet.doPost(SeamRemotingServlet.java:56)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.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)
| Caused by: javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interfaces.LocalOnlyContextFactory
| [Root exception is java.lang.ClassNotFoundException: org.jnp.interfaces.LocalOnlyContextFactory]
| at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:657)
| 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:28)
| at org.jboss.seam.util.Naming.getInitialContext(Naming.java:37)
| at org.jboss.seam.Component.instantiate(Component.java:774)
| at org.jboss.seam.Component.newInstance(Component.java:731)
| ... 26 more
| Caused by: java.lang.ClassNotFoundException: org.jnp.interfaces.LocalOnlyContextFactory
| at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1352)
| at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1198)
| at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
| at java.lang.Class.forName0(Native Method)
| at java.lang.Class.forName(Class.java:242)
| at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:42)
| at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:654)
| ... 33 more
|
And in the Debug window i see this output
| Mon Jul 31 2006 13:51:35 GMT-0400 (Eastern Daylight Time): Request packet:
| <envelope><header><context></context></header><body><call component="helloAction" method="sayHello" id="1">
| <params><param><str>sdsdf</str></param></params><refs></refs></call></body></envelope>
|
|
| Mon Jul 31 2006 13:51:35 GMT-0400 (Eastern Daylight Time): Response packet:
|
I have added the following context parameter to web.xml
| <context-param>
| <param-name>org.jboss.seam.core.init.jndiPattern</param-name>
| <param-value>MySeamTest-war/#{ejbName}/local </param-value>
| </context-param>
|
Thanks
Sateesh
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3961966#3961966
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3961966
18 years, 4 months
[JBoss Seam] - Interesting problem with seam and DataModel and hibernate
by c_eric_ray
Here's the session bean snippet...
| @Out(scope=ScopeType.SESSION)
| private DataModel openPackages = new ListDataModel();
|
| private String opQuery = "from PackageEntity p, OfficeEntity o where p.office.id = o.id and p.code = 'OPN' and o.id = 1";
|
| @Create
| @Factory("openPackages")
| public void init() {
| openPackages.setWrappedData(em.createQuery(opQuery).getResultList());
| openPackages.addDataModelListener(this);
| openPackages.setRowIndex(0);
| }
|
the jsf snippet
| <h:dataTable value="#{openPackages}" var="pkgEntity" rendered="#{openPackages.rowCount > 0}"
| rows="#{rowSize}" first="#{openIndex}" rowClasses="evenRow,oddRow" cellspacing="0"
| onmouseover="highlightRow(event);" onmouseout="unhighlightRow(event);">
| <h:column>
| <f:facet name="header">
| <h:outputText value="#{pkgHeaders.id}" />
| </f:facet>
| <h:commandLink value="#{pkgEntity.id}" action="#{remittance.selectedRemittance}" />
| </h:column>
| <h:column>
|
| .... more columns ...
| </h:dataTable>
|
the exception i receive...
| java.lang.NumberFormatException: For input string: "id"
| at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
| at java.lang.Integer.parseInt(Integer.java:447)
| at java.lang.Integer.parseInt(Integer.java:497)
| at com.sun.facelets.el.LegacyELContext$LegacyELResolver.getValue(LegacyELContext.java:138)
| at com.sun.el.parser.AstValue.getValue(AstValue.java:96)
| at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:183)
| at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:71)
| at com.sun.facelets.el.LegacyValueBinding.getValue(LegacyValueBinding.java:56)
| at javax.faces.component.UICommand.getValue(UICommand.java:170)
| at org.apache.myfaces.renderkit.html.HtmlLinkRendererBase.encodeBegin(HtmlLinkRendererBase.java:87)
| at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:307)
| at org.apache.myfaces.renderkit.RendererUtils.renderChild(RendererUtils.java:441)
| at org.apache.myfaces.renderkit.RendererUtils.renderChildren(RendererUtils.java:427)
| at org.apache.myfaces.renderkit.RendererUtils.renderChild(RendererUtils.java:448)
| at org.apache.myfaces.renderkit.html.HtmlTableRendererBase.renderColumnBody(HtmlTableRendererBase.java:195)
| at org.apache.myfaces.renderkit.html.HtmlTableRendererBase.encodeColumnChild(HtmlTableRendererBase.java:168)
| at org.apache.myfaces.renderkit.html.HtmlTableRendererBase.encodeInnerHtml(HtmlTableRendererBase.java:154)
| at org.apache.myfaces.renderkit.html.HtmlTableRendererBase.encodeChildren(HtmlTableRendererBase.java:94)
| at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:319)
| at com.sun.facelets.FaceletViewHandler.encodeRecursive(FaceletViewHandler.java:557)
| at com.sun.facelets.FaceletViewHandler.encodeRecursive(FaceletViewHandler.java:562)
| at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:457)
| at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:352)
| 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)
|
I believe I know what's wrong but I'm not sure why or how to fix it. So, if you guys will bear with me and read along I'll explain as best I can.
I think the problem lies in the query which does a join and the resultant List actually consists of both entity (PackageEntity and OfficeEntity) objects retreive from the database (using hibernate). The reason I say this is because I had everything working just fine with the simple query like so
from PacakgeEntity p where p.code = 'OPN'
This simple query returned a list of PackageEntity objects and all was good. The new query returns a list alright, but it's not a PackageEntity list. It's an Object list. Each element in the object list then contains a list of PackageEnity and OfficeEntity objects that were created from the join (so I think).
So, it's seems that I have some sort of referencing problem and I don't really now how to resolve it. Please ask if you need more information. This is hard to explain.
Thanks.
Eric Ray
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3961964#3961964
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3961964
18 years, 4 months
[JBoss jBPM] - Bugs in org.jbpm.graph.node.Decision?
by ujay68
I was wondering why the following decision node doesn't work with v3.1.2:
| <decision name="d">
| <transition to="t1">
| <condition>#{myVar == 1}</condition>
| </transition>
| <transition to="t2">
| <condition)#{myVar == 2}</condition>
| </transition>
| <transition to='otherwise'/>
| </decision>
|
When neither condition is true, the t1 transition is taken, not the 'otherwise' transition. When the second condition is true, transition t1 is taken.
I believe there are a couple of flaws in Decision.java:
1. A break probably is missing after line 121
2. An assignment to transitionName is probably missing at line 126
3. The calls to getDefaultLeavingTransition() at lines 126 and 140 are probably wrong, because the decision node type is document to take the last transition as the default transition, not the first one.
Or am I missing something?
Regards,
Jay
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3961962#3961962
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3961962
18 years, 4 months
[Persistence, JBoss/CMP, Hibernate, Database] - Connection pool filling up, or is it?
by merkkila
JBoss 4.0.4GA - 3 app servers clustered behind IIS 6 w/ mod_jk and session replication with TreeCache, Hibernate 3.1.3 (session per request using threadlocal to store session/servlet filter for opening and commiting of transactions).
Oracle 9.2.0.4 / 10.2.0.1.0 JDBC driver
After some random amount of time (1-3 days) it seems at least one, sometimes more, of the app servers lose connection to the database.
2006-07-31 05:35:18,971 ERROR org.hibernate.util.JDBCExceptionReporter No ManagedConnections available within configured blocking timeout ( 3000 ms )
When I inspect the jmx-console I see that my connection pool has reached its max. (min 2/max 75).
I have read everything I can find about the dreaded "No ManagedConnections" error. I have been monitoring the pool through the jmx-console and it seems to be creating/releasing connections as it should so I don't think I am leaking any anywhere. I have turned on the logging and I never get any messages suggesting otherwise.
Is it possible we are doing so much work that we actually use all the connections to the DB? What happens when you reach the max in your pool? Will it recover once load decreases?
ds-file
| <datasources>
| <xa-datasource>
| <jndi-name>prod3</jndi-name>
| <track-connection-by-tx/>
| <isSameRM-override-value>false</isSameRM-override-value>
| <min-pool-size>2</min-pool-size>
| <max-pool-size>75</max-pool-size>
| <blocking-timeout-millis>3000</blocking-timeout-millis>
| <idle-timeout-minutes>1</idle-timeout-minutes>
| <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
| <xa-datasource-property name="URL">jdbc:oracle:thin:@192.168.50.15:1521:ssdb</xa-datasource-property>
| <xa-datasource-property name="User">yeah</xa-datasource-property>
| <xa-datasource-property name="Password">right</xa-datasource-property>
|
| <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
|
| <no-tx-separate-pools/>
| <track-statements>true</track-statements>
|
| <metadata>
| <type-mapping>Oracle9i</type-mapping>
| </metadata>
| </xa-datasource>
|
| <mbean code="org.jboss.resource.adapter.jdbc.vendor.OracleXAExceptionFormatter" name="jboss.jca:service=prod3OracleXAExceptionFormatter">
| <depends optional-attribute-name="TransactionManagerService">jboss:service=TransactionManager</depends>
| </mbean>
|
| </datasources>
|
Any help would be great. Thanks.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3961958#3961958
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3961958
18 years, 4 months
[JBoss Seam] - Is a custom method interceptor in a POJO possible?
by andrew.rw.robinson
I have an issue in which a 3rd party control is attempting to access a bean property of a conversation state bean during the decode phase. This property returns null (which the 3rd party control hates) when there is no conversation. So I thought that I would add a custom method interceptor on the get property method to check if the conversation is active and if not, immediately invoke the navigation handler (unlike the @Conversational which doesn't change the navigation for non-action methods).
After developing it, it almost looks like Seam 1.0.1 doesn't support custom method-level interceptors on POJOs. Is this true?
Here is my code:
Bean class:
@Name("editReportBean")
| @Scope(ScopeType.CONVERSATION)
| public class EditReportBean
| {
| ...
| @ConversationRequired(ifNotBegunOutcome="return.report.list")
| public TreeModel getAvailTreeModel()
| {
| return this.availTreeModel;
| }
Interceptor:
@Target({TYPE, METHOD})
| @Retention(RUNTIME)
| @Interceptors(ConversationRequiredInterceptor.class)
| public @interface ConversationRequired
| {
| /**
| * The JSF outcome if the component is invoked outside
| * of the scope of its conversation
| */
| String ifNotBegunOutcome();
| }
The interceptor implementation:
@Around({BijectionInterceptor.class,
| ValidationInterceptor.class,
| ConversationInterceptor.class})
| @Within({RemoveInterceptor.class})
| public class ConversationRequiredInterceptor
| {
| @AroundInvoke
| public Object ensureActiveConversation(InvocationContext invocation)
| throws Exception
| {
| Method method = invocation.getMethod();
|
| if (!Manager.instance().isLongRunningConversation())
| {
| String outcome = method.getAnnotation(ConversationRequired.class).ifNotBegunOutcome();
| FacesContext context = FacesContext.getCurrentInstance();
| context.getApplication().getNavigationHandler().handleNavigation(context,
| null, outcome);
| throw new AbortProcessingException();
| }
|
| return invocation.proceed();
| }
| }
The "ensureActiveConversation" method of the interceptor implementation class is never invoked.
Is this possible? What else can I do to stop this (I will probably put a work around in, but would like to know if I can get custom interceptors to work on POJO methods).
Thanks,
ANdrew
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3961957#3961957
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3961957
18 years, 4 months