[JBoss Seam] - ejb + seam from swing gui
by Kruno
We've made an application with jsf +seam +ejb and it works great, I am so pleased, but I think it would be nice if I could be able to use the same ejb beans (application logic) from client such as swing or anything else.
I did try an it partially works, injections work, entity manager controlled by seam also work.
Our application uses long running conversations and transactions are controlled by seam also flushmode is manual.
So I need to start conversation manually and set flushMode.Manual.
I tried it like this but it does not work
This is method from ejb which should start conversation
| @Begin(flushMode=FlushModeType.MANUAL)
| public String pocetak() {
|
| return "OK";
| }
|
This is part of client swing application
| ref = jndiContext.lookup("java:kadrovska/ObradaTestBean/remote");
| ObradaTest obrada = (ObradaTest) ref;
|
| obrada.pocetak();
| ......
|
I get this error:
| Exception in thread "main" javax.ejb.EJBException: java.lang.IllegalStateException: Do not start long-running conversations in direct calls to EJBs
| at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:63)
| at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)
| at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:95)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:83)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
| at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.ejb3.stateful.StatefulContainer.dynamicInvoke(StatefulContainer.java:335)
| at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:106)
| at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
| at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:769)
| at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:573)
| at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:373)
| at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:166)
| at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:163)
| at org.jboss.remoting.Client.invoke(Client.java:1634)
| at org.jboss.remoting.Client.invoke(Client.java:548)
| .......
|
Please help.
Thanks in advance Kruno.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4115913#4115913
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4115913
17 years
[JBoss Portal] - deployment issue
by marimuthub
Hi,
We are developing portal application in jboss-portal server 2.6.2.GA. We are having a filter class before login.jsp. Our application authentication done by other application. So we are performing only authorization activities inside filter class using identity management API and we have made login.jsp as a dummy and it redirects to j_security_check for redirecting to Welcome Page.
We are building our portal application as a war file. we deploying the war file under <jboss-server-home>/server/default/deploy directory.
1. Whether our deployment is ok?
2. We are setting logged in user data in HttpSession in our filter class. but we are unable to retrieve those session values in tabs.jsp and header.jsp. These files are packaged in our portal application and appropriate configurations made jboss-service.xml.
To solve the above issues We are trying to deploy our application war inside jboss-portal.sar. but deployment fails.
Please help us to resolve the issues relating to deployment.
Regards
Marimuthu
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4115908#4115908
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4115908
17 years
[JBoss Tools (users)] - problem configuring testing with Seam project
by laksu
Hi,
We have a project that we had been developing since a year or so with Seam on Netbeans. With the introduction of Seam 2.0.0 we had so many problems migrating it. I am fed up with all and decided to convert to Eclipse based environment as it seems to me JBoss people prefer Eclipse and its ecosystem rather than Netbeans.
And it turns out to be not as easy task as it sounds: I have JBoss Tools installed on top of Eclipse and created a new Seam project. I have nothing to do with Seam-gen generated stuff so I used this new project (4 projects actually, ear project) as a clean base.
I have copied my xhtml, java files, components.xml, web.xml, faces-config.xml, navigation etc. into it. Note that, I am using Hibernate instead of JPA. I finally got it working back.
However when it comes to testing I cannot seem to properly initialize my Hibernate session factory. It feels like Seam does not get initialized or does not use the components.xml. I don't see anything related with hibernate starting up etc in the Embedded container's log. My test is fairly basic It just checks if the Session object "@In"jected by Seam is not null but it fails.
I am sort of used to hacking the ant file back in the Netbeans but as I said, all this Eclipse+JBoss Tools is new to me. So I would like to learn how to use Hibernate based persistence rather than JPA and still get the testNG/Embedded JBoss based testing configured accordingly.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4115901#4115901
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4115901
17 years