[Installation, Configuration & DEPLOYMENT] - Exception using Oracle as the default db for jboss 4.2.2
by dxxvi
This is my oracle-ds.xml<?xml version="1.0" encoding="UTF-8"?>
| <datasources>
| <local-tx-datasource>
| <jndi-name>DefaultDS</jndi-name>
| <connection-url>jdbc:oracle:thin:@localhost:1521:XE</connection-url>
| <driver-class>oracle.jdbc.OracleDriver</driver-class>
| <user-name>jboss</user-name>
| <password>hannah</password>
| <valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name>
| <metadata>
| <type-mapping>Oracle9i</type-mapping>
| </metadata>
| </local-tx-datasource>
| </datasources>
This is the exception06:50:07,848 INFO [ServerInfo] Java version: 1.6.0_06,Sun Microsystems Inc.
| 06:50:07,849 INFO [ServerInfo] Java VM: Java HotSpot(TM) Server VM 10.0-b22,Sun Microsystems Inc.
| 06:50:07,849 INFO [ServerInfo] OS-System: Linux 2.6.24-16-generic,i386
| ...
| 06:50:23,147 ERROR [MainDeployer] Could not create deployment: file:/home/ly/jboss-4.2.2.GA/server/default/deploy/oracle-ds.xml
| org.jboss.deployment.DeploymentException: Trying to install an already registered mbean: jboss.jca:service=LocalTxCM,name=DefaultDS
| at org.jboss.system.ServiceCreator.install(ServiceCreator.java:103)
| at org.jboss.system.ServiceConfigurator.internalInstall(ServiceConfigurator.java:451)
| at org.jboss.system.ServiceConfigurator.install(ServiceConfigurator.java:171)
| at org.jboss.system.ServiceController.install(ServiceController.java:226)
| at sun.reflect.GeneratedMethodAccessor23.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:597)
| 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 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:597)
| 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 $Proxy42.create(Unknown Source)
| at org.jboss.deployment.XSLSubDeployer.create(XSLSubDeployer.java:192)
| 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 sun.reflect.GeneratedMethodAccessor21.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:597)
| 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 $Proxy9.deploy(Unknown Source)
| at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
| at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
| at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
| at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336)
| at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
| at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
| at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:597)
| 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.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
| at $Proxy0.start(Unknown Source)
| at org.jboss.system.ServiceController.start(ServiceController.java:417)
| at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:597)
| 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.start(Unknown Source)
| at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
| at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
| 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:597)
| 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:619)
| 06:50:23,179 INFO [TomcatDeployer] deploy, ctxPath=/jmx-console, warUrl=.../deploy/jmx-console.war/
| 06:50:23,300 ERROR [URLDeploymentScanner] Incomplete Deployment listing:
|
| --- Incompletely deployed packages ---
| org.jboss.deployment.DeploymentInfo@37902a08 { url=file:/home/ly/jboss-4.2.2.GA/server/default/deploy/oracle-ds.xml }
| deployer: org.jboss.deployment.XSLSubDeployer@d8e902
| status: Deployment FAILED reason: Trying to install an already registered mbean: jboss.jca:service=LocalTxCM,name=DefaultDS
| state: FAILED
| watch: file:/home/ly/jboss-4.2.2.GA/server/default/deploy/oracle-ds.xml
| altDD: null
| lastDeployed: 1211539823138
| lastModified: 1211539823000
| mbeans:
|
Where did I do wrong?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4152934#4152934
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4152934
17 years, 11 months
[EJB 3.0] - need suggestion in EJB based application design
by mnrz
Hi Experts,
I need your suggestions and idea regarding the scenario we have designed for our EJB-based Banking system. I would appreciate if you give me advice and/or share your experience on this.
In our Banking System, we've got a Central Bank Manager in which we have provided all the bank services such as transferring money, returning balance, paying bills etc. and other subsystems say, Internet Bank or Telephone Bank will be served through this Central Bank Manager. The old Manager was developed in a very poor designation and now we are going to develop it using EJB.
The scenario we are currently consider is to developing each banking services as an session object. Actually, we have two kind of services, Loginless services that needs no authentication and even authorization and Loginfull services which requires that the customer first log in and then uses any available service that desires.
I assume the former services as Stateless session bean while the later ones as stateful session beans.
My Idea is that we can provide a Login SFSB in which we have a login() business method that have been tagged with @Init and a logout() method tagged with @Remove. Also, this SFSB has a getService(ServiceType) method in which we can lookup the actual service that the customer needs.
as an example:
|
| //A servlet from Internet Bank that serves login process
|
| public void doGet(...){
| //acquire username and password
| String username = ...
| String password = ...
|
| // lookup Login SFSB remote interface
| BankSession bankSession = ctx.lookup(...);
|
| Boolean ok = bankSession.login(username,password);
| if(ok){
| httpSession.setAttribute("bankSession", bankSession);
| }else{
| //redirect to an error page
| throw new Exception("invalid username or password");
| }
| }
|
now if user is authenticated then we store a bankSession in his/her session. but inside the BankSession we have a getService() method which is actually a service locator that looks up any desired service.
| @Statefull
| public class BankSession implements BankSessionRemote{
| // to assign a session id
| private String sessionId;
|
| @Init
| public boolean login(....){
| //code to logging in
| }
| public <T extends BankService> T getService(Class<T> klass){
| try{
| Context c = new InitialContext();
| Object sessionBean = c.lookup(klass.getName());
| ((BankService)sessionBean).setSessionId(sessionId);
| return (T) sessionBean;
| }catch(NamingException x){
| return null;
| }
| }
|
| @Remove
| public void logout(){
| sessionId = null;
| //rest of codes...
| }
| }
|
now, consider in another servlet which is responsible for transferring money we have:
| public class TransferServlet....{
| public void doGet(...){
| BankSession bankSession = httpSession.getAttribute("bankSession");
| Transfer transfer = bankSession.getService(Transfer.class);
| transfer.execute(...);
| }
| }
|
if point is each time the logout() is called or the EJB timed out exception is occurred or this session bean is disposed in any way the customer is no longer able to get any other service that requires authentication. so in this way, we can make sure that everything is working safely.
And one more thing is that because we set the session id through the getService() method, neither of those services will work if they are acquired individually through the RMI rather than our BankSession SFSB.
But the thing is that I don't know whether or not we can store the session bean as an attribute in HttpSession or generally, if we store it in any structure and pass that session bean to various classes and servlets, is it still keep its own relation with the remote server?
And secondly, Does the locator we provide in getService() method work fine?
I am anxious to know your valuable idea on this and again I appreciate any suggestion on this matter.
Thank you very much in advance
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4152923#4152923
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4152923
17 years, 11 months