[JBoss Seam] - Action + Facade + DAO Architecture And Seam
by david.alves
Hi!
I'm building an application usign seam but with a more traditional architecture having an Action layer that uses a facade layer that in turn uses a DAO layer.
The reason for this is that I have a non-web interface that must also use the EJB tier and I would like to optimize code reuse.
Usualy the action calls the facade that calls one or more daos.
The entitymanager is injected normally into the daos.
It all went well until I needed conversations. Now a conversational Action has an extended type PersistenceContext associated with it and I need to use this one in the DAOs to be able to make commit or rollback over the entire conversation when it ends.
All the examples I've seen seem to incorporate all the JPA queries in the actions themselves.
Is it possible to do things my way and still use conversations???
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4024959#4024959
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4024959
19Â years, 1Â month
[EJB 3.0] - JNDI and Client Application
by gazzarda
Hello,
( I can't seem to find an answer to following question. Please bare with me. )
I am trying to run a client application at the command line to connect to a deployed stateless bean.
I have complied a SimpleSession ( a remote interface ) and SimpleSessionBean ( a stateless bean that implements SimpleSession ).
I have complied both the interface and the bean and created a jar file with the following command:
"jar cf SimpleSessionApp.ejb3 beans\*.java"
I then placed the jar file in the deploy directory.
I have created a client application with the following code:
package client;
import beans.SimpleSession;
import javax.naming.InitialContext;
public class SimpleSessionClient {
public static void main( String args[] ) throws Exception {
InitialContext ctx = new InitialContext();
SimpleSession simpleSession = ( SimpleSession )ctx.lookup( "beans/SimpleSession/remote" );
for( int i = 0; i < args.length; i++ ) {
String returnedString = simpleSession.sendMessage( args[ i ] );
System.out.println( "sent string: " + args[ i ] + ", received string: " + returnedString );
}
}
}
~
I then compiled the code and tried running it at the command line with the following command:
"java -Djava.naming.factory.initial=org.jnp.interfaces.
NamingContextFactory -Djava.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces -Djava.naming.provider.url
=localhost client.SimpleSessionClient Now is the time for all good men"
I get the following error:
Exception in thread "main" javax.naming.NameNotFoundException: beans not bound
at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
at org.jnp.server.NamingServer.lookup(NamingServer.java:267)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
at sun.rmi.transport.Transport$1.run(Transport.java:153)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)
at java.lang.Thread.run(Thread.java:595)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown Source)
at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
at sun.rmi.server.UnicastRef.invoke(Unknown Source)
at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:625)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
at javax.naming.InitialContext.lookup(Unknown Source)
at client.SimpleSessionClient.main(SimpleSessionClient.java:9)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4024956#4024956
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4024956
19Â years, 1Â month
[JBoss Seam] - NPE when opening pages.xml with jBPM editor
by svadu
Hi All,
I downloaded JBoss Eclipse IDE that includes jbpm designer, however when I try to open pages.xml with it I am getting a NPE:
java.lang.NullPointerException
| at org.jbpm.ui.pageflow.editor.PageFlowContentProvider.addProcessDiagramDimension(Unknown Source)
| at org.jbpm.ui.pageflow.editor.PageFlowContentProvider.addGraphicalInfo(Unknown Source)
| at org.jbpm.ui.pageflow.editor.PageFlowContentProvider.addGraphicalInfo(Unknown Source)
| at org.jbpm.ui.pageflow.editor.PageFlowContentProvider.addGraphicalInfo(Unknown Source)
| at org.jbpm.ui.pageflow.editor.PageFlowGraphicalEditorPage.initInput(Unknown Source)
| at org.jbpm.ui.pageflow.editor.PageFlowGraphicalEditorPage.init(Unknown Source)
| at org.eclipse.ui.part.MultiPageEditorPart.addPage(MultiPageEditorPart.java:179)
| at org.jbpm.ui.pageflow.editor.PageFlowEditor.addGraphPage(Unknown Source)
| at org.jbpm.ui.pageflow.editor.PageFlowEditor.createPages(Unknown Source)
Any idea what can be wrong?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4024950#4024950
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4024950
19Â years, 1Â month