[EJB 3.0] - Architecture
by Renen
We have an existing application running EJB2 EJBs. However, we have an opportunity at the moment to reconsider certain aspects of the architecture. And, EJB3 beckons, as do several of the Java 1.5 constructs.
However, the world has moved a long way since we last looked at these architectural tradeoffs. And I am no longer feeling as confident of our approach as I once did.
Specifically, I would like to hear your thoughts on how we should approach architecting three of our key ?modules?. I think that these answers will steer the rest of our decisions.
DB: We have a stateless EJB that handles our access to our database (we don?t use Hibernate and fire off a lot of SQL). We rely heavily on the connection pooling provided by the AS. The DB EJB is called by our MDBs, other EJBs and all our JSP pages.
I think that this should remain a stateless EJB. Am I correct?
Page: We have another stateless EJB which manages the lifecycle of the JSP pages and provides a range of utility functions to the pages themselves (from date manipulation, to database access via the DB EJB referenced above). The EJB is created by the web tier, and could conceivably be accessed only by other objects in the web tier.
I think this should become a POJO managed by Tomcat. Do I need to worry about connection pooling or any other performance related issues?
Logging: A ?module? that provides logging functionality to all our components, both in the web tier, but also the MDBs.
As this module is used from both the web and EJB tier, I think that this should move into a JAR with similar modules (encryption etc) and be deployed as a library function. Is this correct?
A bunch of stuff has been written on the EJB, not EJB debate. But, my feeling is that it isn?t nearly as clear-cut as many of the writers make out.
The book, Mastering EJB 3 (http://www.theserverside.com/tt/books/wiley/masteringEJB3/downloads/Maste... - free registration required) has a useful chapter 13 which also speaks to these questions.
I am very interested in hearing your opinions!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4086329#4086329
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4086329
18 years, 10 months
[Installation, Configuration & DEPLOYMENT] - 4.2.0GA installation problems
by martin.marcher
Hello,
I'm on debian etch I have 768MB RAM for this machine and 2GB diskspace (512MB swap to be sure to have enough)
# free -m
| total used free shared buffers cached
| Mem: 768 682 85 0 0 618
| -/+ buffers/cache: 64 703
| Swap: 511 0 511
|
| # $JAVA_HOME/bin/java -version
| java version "1.5.0_12"
| Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_12-b04)
| Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_12-b04, mixed mode)
|
java and jboss are from sun and jboss.com (no debian packages involved here)...
I have no idea what I'm doing wrong with this jboss i went up to 768MB memory thus definitely needed to swap but nothing changes (kernel doesn't kill anything)
| # pwd
| /opt/jboss-4.2.0.GA/bin
|
| # ./run.sh -c minimal
| =========================================================================
|
| JBoss Bootstrap Environment
|
| JBOSS_HOME: /opt/jboss-4.2.0.GA
|
| JAVA: /opt/jdk1.5.0_12/bin/java
|
| JAVA_OPTS: -Dprogram.name=run.sh -server -Xms128m -Xmx512m -Ddebug -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djava.net.preferIPv4Stack=true
|
| CLASSPATH: /opt/jboss-4.2.0.GA/bin/run.jar:/opt/jdk1.5.0_12/lib/tools.jar
|
| =========================================================================
|
| 22:28:43,833 INFO [Server] Starting JBoss (MX MicroKernel)...
| 22:28:43,834 INFO [Server] Release ID: JBoss [Trinity] 4.2.0.GA (build: SVNTag=JBoss_4_2_0_GA date=200705111440)
| 22:28:43,835 INFO [Server] Home Dir: /opt/jboss-4.2.0.GA
| 22:28:43,835 INFO [Server] Home URL: file:/opt/jboss-4.2.0.GA/
| 22:28:43,836 INFO [Server] Patch URL: null
| 22:28:43,836 INFO [Server] Server Name: minimal
| 22:28:43,836 INFO [Server] Server Home Dir: /opt/jboss-4.2.0.GA/server/minimal
| 22:28:43,837 INFO [Server] Server Home URL: file:/opt/jboss-4.2.0.GA/server/minimal/
| 22:28:43,837 INFO [Server] Server Log Dir: /opt/jboss-4.2.0.GA/server/minimal/log
| 22:28:43,837 INFO [Server] Server Temp Dir: /opt/jboss-4.2.0.GA/server/minimal/tmp
| 22:28:43,838 INFO [Server] Root Deployment Filename: jboss-service.xml
| 22:28:44,296 INFO [ServerInfo] Java version: 1.5.0_12,Sun Microsystems Inc.
| 22:28:44,296 INFO [ServerInfo] Java VM: Java HotSpot(TM) 64-Bit Server VM 1.5.0_12-b04,Sun Microsystems Inc.
| 22:28:44,296 INFO [ServerInfo] OS-System: Linux 2.6.18-4-xen-amd64,amd64
| 22:28:44,876 INFO [Server] Core system initialized
| 22:28:46,867 INFO [Log4jService$URLWatchTimerTask] Configuring from URL: resource:jboss-log4j.xml
| 22:28:47,584 INFO [Server] JBoss (MX MicroKernel) [4.2.0.GA (build: SVNTag=JBoss_4_2_0_GA date=200705111440)] Started in 3s:744ms
|
ok so jboss works generally....
| # ./run.sh -c default
| =========================================================================
|
| JBoss Bootstrap Environment
|
| JBOSS_HOME: /opt/jboss-4.2.0.GA
|
| JAVA: /opt/jdk1.5.0_12/bin/java
|
| JAVA_OPTS: -Dprogram.name=run.sh -server -Xms128m -Xmx512m -Ddebug -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djava.net.preferIPv4Stack=true
|
| CLASSPATH: /opt/jboss-4.2.0.GA/bin/run.jar:/opt/jdk1.5.0_12/lib/tools.jar
|
| =========================================================================
|
| 22:29:57,178 INFO [Server] Starting JBoss (MX MicroKernel)...
| 22:29:57,179 INFO [Server] Release ID: JBoss [Trinity] 4.2.0.GA (build: SVNTag=JBoss_4_2_0_GA date=200705111440)
| 22:29:57,180 INFO [Server] Home Dir: /opt/jboss-4.2.0.GA
| 22:29:57,180 INFO [Server] Home URL: file:/opt/jboss-4.2.0.GA/
| 22:29:57,181 INFO [Server] Patch URL: null
| 22:29:57,181 INFO [Server] Server Name: default
| 22:29:57,181 INFO [Server] Server Home Dir: /opt/jboss-4.2.0.GA/server/default
| 22:29:57,182 INFO [Server] Server Home URL: file:/opt/jboss-4.2.0.GA/server/default/
| 22:29:57,182 INFO [Server] Server Log Dir: /opt/jboss-4.2.0.GA/server/default/log
| 22:29:57,182 INFO [Server] Server Temp Dir: /opt/jboss-4.2.0.GA/server/default/tmp
| 22:29:57,183 INFO [Server] Root Deployment Filename: jboss-service.xml
| 22:29:57,637 INFO [ServerInfo] Java version: 1.5.0_12,Sun Microsystems Inc.
| 22:29:57,638 INFO [ServerInfo] Java VM: Java HotSpot(TM) 64-Bit Server VM 1.5.0_12-b04,Sun Microsystems Inc.
| 22:29:57,638 INFO [ServerInfo] OS-System: Linux 2.6.18-4-xen-amd64,amd64
| 22:29:58,654 INFO [Server] Core system initialized
| 22:30:01,547 WARN [BasicMBeanRegistry] javax.management.MBeanRegistrationException: preRegister() failed: [ObjectName='jboss.remoting:service=NetworkRegistry', Class=org.jboss.remoting.network.NetworkRegistry (org.jboss.remoting.network.NetworkRegistry@65efb4be)]
| 22:30:01,581 ERROR [MainDeployer] Could not create deployment: file:/opt/jboss-4.2.0.GA/server/default/conf/jboss-service.xml
| org.jboss.deployment.DeploymentException: - nested throwable: (java.lang.reflect.InvocationTargetException)
| at org.jboss.system.ServiceConfigurator.install(ServiceConfigurator.java:196)
| at org.jboss.system.ServiceController.install(ServiceController.java:226)
| 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 org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| at $Proxy4.install(Unknown Source)
| at org.jboss.deployment.SARDeployer.create(SARDeployer.java:249)
| at org.jboss.deployment.MainDeployer.create(MainDeployer.java:969)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:818)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
| 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 org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| at $Proxy5.deploy(Unknown Source)
| at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
| at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
| at org.jboss.Main.boot(Main.java:200)
| at org.jboss.Main$1.run(Main.java:508)
| at java.lang.Thread.run(Thread.java:595)
| Caused by: java.lang.reflect.InvocationTargetException
| at org.jboss.mx.server.MBeanServerImpl.registerMBean(MBeanServerImpl.java:1451)
| at org.jboss.mx.server.MBeanServerImpl.registerMBean(MBeanServerImpl.java:1350)
| at org.jboss.mx.server.MBeanServerImpl.createMBean(MBeanServerImpl.java:345)
| at org.jboss.system.ServiceCreator.install(ServiceCreator.java:157)
| at org.jboss.system.ServiceConfigurator.internalInstall(ServiceConfigurator.java:449)
| at org.jboss.system.ServiceConfigurator.install(ServiceConfigurator.java:171)
| ... 36 more
| Caused by: javax.management.MBeanException
| at org.jboss.mx.interceptor.ReflectedDispatcher.handleInvocationExceptions(ReflectedDispatcher.java:180)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:163)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.server.MBeanServerImpl$3.run(MBeanServerImpl.java:1422)
| at java.security.AccessController.doPrivileged(Native Method)
| at org.jboss.mx.server.MBeanServerImpl.registerMBean(MBeanServerImpl.java:1417)
| ... 41 more
| Caused by: javax.management.MBeanRegistrationException: preRegister() failed: [ObjectName='jboss.remoting:service=NetworkRegistry', Class=org.jboss.remoting.network.NetworkRegistry (org.jboss.remoting.network.NetworkRegistry@65efb4be)]
| at org.jboss.mx.server.registry.BasicMBeanRegistry.invokePreRegister(BasicMBeanRegistry.java:713)
| at org.jboss.mx.server.registry.BasicMBeanRegistry.registerMBean(BasicMBeanRegistry.java:211)
| at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| ... 51 more
| Caused by: java.lang.RuntimeException: Exception creating identity: jboss-b: jboss-b
| at org.jboss.remoting.ident.Identity.get(Identity.java:211)
| at org.jboss.remoting.network.NetworkRegistry.preRegister(NetworkRegistry.java:268)
| at org.jboss.mx.server.AbstractMBeanInvoker.invokePreRegister(AbstractMBeanInvoker.java:966)
| at org.jboss.mx.modelmbean.ModelMBeanInvoker.invokePreRegister(ModelMBeanInvoker.java:489)
| at org.jboss.mx.server.AbstractMBeanInvoker.preRegister(AbstractMBeanInvoker.java:654)
| at org.jboss.mx.server.registry.BasicMBeanRegistry.invokePreRegister(BasicMBeanRegistry.java:697)
| ... 56 more
| Failed to boot JBoss:
| org.jboss.deployment.DeploymentException: - nested throwable: (java.lang.reflect.InvocationTargetException)
| at org.jboss.system.ServiceConfigurator.install(ServiceConfigurator.java:196)
| at org.jboss.system.ServiceController.install(ServiceController.java:226)
| 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 org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| at $Proxy4.install(Unknown Source)
| at org.jboss.deployment.SARDeployer.create(SARDeployer.java:249)
| at org.jboss.deployment.MainDeployer.create(MainDeployer.java:969)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:818)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
| 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 org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| at $Proxy5.deploy(Unknown Source)
| at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
| at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
| at org.jboss.Main.boot(Main.java:200)
| at org.jboss.Main$1.run(Main.java:508)
| at java.lang.Thread.run(Thread.java:595)
| Caused by: java.lang.reflect.InvocationTargetException
| at org.jboss.mx.server.MBeanServerImpl.registerMBean(MBeanServerImpl.java:1451)
| at org.jboss.mx.server.MBeanServerImpl.registerMBean(MBeanServerImpl.java:1350)
| at org.jboss.mx.server.MBeanServerImpl.createMBean(MBeanServerImpl.java:345)
| at org.jboss.system.ServiceCreator.install(ServiceCreator.java:157)
| at org.jboss.system.ServiceConfigurator.internalInstall(ServiceConfigurator.java:449)
| at org.jboss.system.ServiceConfigurator.install(ServiceConfigurator.java:171)
| ... 36 more
| Caused by: javax.management.MBeanException
| at org.jboss.mx.interceptor.ReflectedDispatcher.handleInvocationExceptions(ReflectedDispatcher.java:180)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:163)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.server.MBeanServerImpl$3.run(MBeanServerImpl.java:1422)
| at java.security.AccessController.doPrivileged(Native Method)
| at org.jboss.mx.server.MBeanServerImpl.registerMBean(MBeanServerImpl.java:1417)
| ... 41 more
| Caused by: javax.management.MBeanRegistrationException: preRegister() failed: [ObjectName='jboss.remoting:service=NetworkRegistry', Class=org.jboss.remoting.network.NetworkRegistry (org.jboss.remoting.network.NetworkRegistry@65efb4be)]
| at org.jboss.mx.server.registry.BasicMBeanRegistry.invokePreRegister(BasicMBeanRegistry.java:713)
| at org.jboss.mx.server.registry.BasicMBeanRegistry.registerMBean(BasicMBeanRegistry.java:211)
| at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| ... 51 more
| Caused by: java.lang.RuntimeException: Exception creating identity: jboss-b: jboss-b
| at org.jboss.remoting.ident.Identity.get(Identity.java:211)
| at org.jboss.remoting.network.NetworkRegistry.preRegister(NetworkRegistry.java:268)
| at org.jboss.mx.server.AbstractMBeanInvoker.invokePreRegister(AbstractMBeanInvoker.java:966)
| at org.jboss.mx.modelmbean.ModelMBeanInvoker.invokePreRegister(ModelMBeanInvoker.java:489)
| at org.jboss.mx.server.AbstractMBeanInvoker.preRegister(AbstractMBeanInvoker.java:654)
| at org.jboss.mx.server.registry.BasicMBeanRegistry.invokePreRegister(BasicMBeanRegistry.java:697)
| ... 56 more
| 22:30:01,590 INFO [Server] Runtime shutdown hook called, forceHalt: true
| 22:30:01,590 INFO [Server] JBoss SHUTDOWN: Undeploying all packages
| 22:30:01,596 INFO [Server] Shutdown complete
| Shutdown complete
| Halting VM
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4086327#4086327
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4086327
18 years, 10 months