SUN TEAM Pl Help - Using EJB in JSC

When I posted the following, as of now there are over 33 viewers who still haven't replied yet. Could you guys help me out? I'm your spokensman around here in Auckland, planning to make JSC as a part and parcel of our Java curriculum.
The NetBeans 5.5 tutorial is out of sync with the IDE. However, with the IDE I created a simple sessionbean with one business method that returns a hardcoded value of type String. This was housed in a EJBModule called EJBModule1. I added this to Creator-2 and dragged the only method called m1() into the SessionBean of Creator-2. I included a button and a staticText and the code given below. Building the project was successful. When it was run, on clicking the button, the following error was displayed:
com.sun.data.provider.DataProviderException: java.lang.reflect.InvocationTargetException
The code:
public String button1_action() {
try {
String name = (String) getSessionBean1().getMySessionRemoteM15().getResultObject();
staticText1.setText(name);
} catch (Exception e) {error(e.toString());}
return null;
}

Thanx 4 responding Antonio, here comes what u hopefully required.
Mary
[#|2006-12-09T09:32:08.500+1300|INFO|sun-appserver-pe8.2|javax.enterprise.system.tools.admin|_ThreadID=14;|ADM1041:Sent the event to instance:[ModuleDeployEvent -- undeploy web/WebApplication2]|#]
[#|2006-12-09T09:32:09.109+1300|INFO|sun-appserver-pe8.2|javax.enterprise.system.tools.admin|_ThreadID=14;|ADM1042:Status of dynamic reconfiguration event processing:[success]|#]
[#|2006-12-09T09:32:09.125+1300|INFO|sun-appserver-pe8.2|javax.enterprise.system.tools.admin|_ThreadID=13;|ADM1041:Sent the event to instance:[ApplicationDeployEvent -- reference-removed WebApplication2]|#]
[#|2006-12-09T09:32:09.156+1300|INFO|sun-appserver-pe8.2|javax.enterprise.system.tools.admin|_ThreadID=13;|ADM1042:Status of dynamic reconfiguration event processing:[success]|#]
[#|2006-12-09T09:32:09.593+1300|INFO|sun-appserver-pe8.2|javax.enterprise.system.tools.deployment|_ThreadID=17;|DPL5109: EJBC - START of EJBC for [WebApplication2]|#]
[#|2006-12-09T09:32:09.593+1300|INFO|sun-appserver-pe8.2|javax.enterprise.system.tools.deployment|_ThreadID=17;|Processing beans ...|#]
[#|2006-12-09T09:32:09.593+1300|INFO|sun-appserver-pe8.2|javax.enterprise.system.tools.deployment|_ThreadID=17;|DPL5110: EJBC - END of EJBC for [WebApplication2]|#]
[#|2006-12-09T09:32:09.687+1300|INFO|sun-appserver-pe8.2|javax.enterprise.system.tools.deployment|_ThreadID=17;|Total Deployment Time: 469 msec, Total EJB Compiler Module Time: 16 msec, Portion spent EJB Compiling: 3%
Breakdown of EJBC Module Time: Total Time for EJBC: 16 msec, CMP Generation: 0 msec (0%), Java Compilation: 0 msec (0%), RMI Compilation: 0 msec (0%), JAX-RPC Generation: 0 msec (0%),
|#]
[#|2006-12-09T09:32:09.734+1300|INFO|sun-appserver-pe8.2|javax.enterprise.system.tools.deployment|_ThreadID=17;|deployed with moduleid = WebApplication2|#]
[#|2006-12-09T09:32:09.906+1300|INFO|sun-appserver-pe8.2|javax.enterprise.system.tools.admin|_ThreadID=14;|ADM1041:Sent the event to instance:[ApplicationDeployEvent -- reference-added WebApplication2]|#]
[#|2006-12-09T09:32:09.953+1300|INFO|sun-appserver-pe8.2|javax.enterprise.system.tools.admin|_ThreadID=14;|ADM1042:Status of dynamic reconfiguration event processing:[success]|#]
[#|2006-12-09T09:32:09.968+1300|INFO|sun-appserver-pe8.2|javax.enterprise.system.tools.admin|_ThreadID=13;|ADM1041:Sent the event to instance:[ModuleDeployEvent -- deploy web/WebApplication2]|#]
[#|2006-12-09T09:32:09.984+1300|INFO|sun-appserver-pe8.2|javax.enterprise.system.container.web|_ThreadID=13;|WEB0100: Loading web module [WebApplication2] in virtual server [server] at [WebApplication2]|#]
[#|2006-12-09T09:32:10.812+1300|WARNING|sun-appserver-pe8.2|org.apache.commons.beanutils.MethodUtils|_ThreadID=13;|Cannot use JVM pre-1.4 access bug workaround die to restrictive security manager.|#]
[#|2006-12-09T09:32:11.093+1300|WARNING|sun-appserver-pe8.2|org.apache.commons.digester.Digester|_ThreadID=13;|[ComponentRule]{faces-config/component} Merge(com.sun.rave.web.ui.Time)|#]
[#|2006-12-09T09:32:11.265+1300|WARNING|sun-appserver-pe8.2|org.apache.commons.digester.Digester|_ThreadID=13;|[ConverterRule]{faces-config/converter} Merge(null,java.math.BigDecimal)|#]
[#|2006-12-09T09:32:11.265+1300|WARNING|sun-appserver-pe8.2|org.apache.commons.digester.Digester|_ThreadID=13;|[ConverterRule]{faces-config/converter} Merge(null,java.math.BigInteger)|#]
[#|2006-12-09T09:32:12.312+1300|INFO|sun-appserver-pe8.2|javax.enterprise.system.tools.admin|_ThreadID=13;|ADM1042:Status of dynamic reconfiguration event processing:[success]|#]
[#|2006-12-09T09:32:34.468+1300|WARNING|sun-appserver-pe8.2|javax.enterprise.resource.corba.ee.S1AS-ORB.rpc.transport|_ThreadID=18;|"IOP00410201: (COMM_FAILURE) Connection failure: socketType: IIOP_CLEAR_TEXT; hostname: localhost; port: 3700"
org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 201 completed: No
     at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2257)
     at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2278)
     at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:208)
     at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:221)
     at com.sun.corba.ee.impl.transport.SocketOrChannelContactInfoImpl.createConnection(SocketOrChannelContactInfoImpl.java:104)
     at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.beginRequest(CorbaClientRequestDispatcherImpl.java:152)
     at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.request(CorbaClientDelegateImpl.java:146)
     at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.is_a(CorbaClientDelegateImpl.java:286)
     at org.omg.CORBA.portable.ObjectImpl._is_a(ObjectImpl.java:112)
     at org.omg.CosNaming.NamingContextExtHelper.narrow(NamingContextExtHelper.java:73)
     at com.sun.corba.ee.impl.resolver.INSURLOperationImpl.resolveCorbaname(INSURLOperationImpl.java:174)
     at com.sun.corba.ee.impl.resolver.INSURLOperationImpl.resolveINSURL(INSURLOperationImpl.java:127)
     at com.sun.corba.ee.impl.resolver.INSURLOperationImpl.operate(INSURLOperationImpl.java:117)
     at com.sun.corba.ee.impl.orb.ORBImpl.string_to_object(ORBImpl.java:883)
     at com.sun.enterprise.naming.NamingManagerImpl.lookup(NamingManagerImpl.java:723)
     at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:132)
     at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:286)
     at javax.naming.InitialContext.lookup(InitialContext.java:351)
     at ejb.mysessionremote.MySessionRemoteClient.create(MySessionRemoteClient.java:30)
     at ejb.mysessionremote.MySessionRemoteClient.m1(MySessionRemoteClient.java:45)
     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 com.sun.data.provider.impl.MethodResultTableDataProvider.invokeDataMethod(MethodResultTableDataProvider.java:236)
     at com.sun.data.provider.impl.MethodResultTableDataProvider.invokeDataMethod(MethodResultTableDataProvider.java:215)
     at com.sun.data.provider.impl.MethodResultTableDataProvider.testInvokeDataMethod(MethodResultTableDataProvider.java:267)
     at com.sun.data.provider.impl.MethodResultTableDataProvider.getResultObject(MethodResultTableDataProvider.java:123)
     at webapplication2.Page1.button1_action(Page1.java:239)
     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 com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:126)
     at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:72)
     at com.sun.rave.web.ui.appbase.faces.ActionListenerImpl.processAction(ActionListenerImpl.java:57)
     at javax.faces.component.UICommand.broadcast(UICommand.java:312)
     at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:267)
     at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:381)
     at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:75)
     at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:221)
     at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:90)
     at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
     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.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)
     at java.security.AccessController.doPrivileged(Native Method)
     at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
     at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)
     at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:257)
     at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55)
     at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:161)
     at java.security.AccessController.doPrivileged(Native Method)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
     at com.sun.rave.web.ui.util.UploadFilter.doFilter(UploadFilter.java:194)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:210)
     at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55)
     at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:161)
     at java.security.AccessController.doPrivileged(Native Method)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:263)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
     at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:225)
     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:173)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:132)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
     at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:933)
     at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:189)
     at com.sun.enterprise.web.connector.grizzly.ProcessorTask.doProcess(ProcessorTask.java:604)
     at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:475)
     at com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(ReadTask.java:371)
     at com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:264)
     at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:281)
     at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:83)
Caused by: java.lang.RuntimeException: java.net.ConnectException: Connection refused: connect
     at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:336)
     at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:191)
     ... 77 more
Caused by: java.net.ConnectException: Connection refused: connect
     at sun.nio.ch.Net.connect(Native Method)
     at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:464)
     at java.nio.channels.SocketChannel.open(SocketChannel.java:146)
     at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:320)
     ... 78 more
|#]
[#|2006-12-09T09:32:35.562+1300|WARNING|sun-appserver-pe8.2|javax.enterprise.resource.corba.ee.S1AS-ORB.rpc.transport|_ThreadID=18;|"IOP00410201: (COMM_FAILURE) Connection failure: socketType: IIOP_CLEAR_TEXT; hostname: localhost; port: 3700"
org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 201 completed: No
     at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2257)
     at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2278)
     at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:208)
     at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:221)
     at com.sun.corba.ee.impl.transport.SocketOrChannelContactInfoImpl.createConnection(SocketOrChannelContactInfoImpl.java:104)
     at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.beginRequest(CorbaClientRequestDispatcherImpl.java:152)
     at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.request(CorbaClientDelegateImpl.java:146)
     at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.is_a(CorbaClientDelegateImpl.java:286)
     at org.omg.CORBA.portable.ObjectImpl._is_a(ObjectImpl.java:112)
     at org.omg.CosNaming.NamingContextExtHelper.narrow(NamingContextExtHelper.java:73)
     at com.sun.corba.ee.impl.resolver.INSURLOperationImpl.resolveCorbaname(INSURLOperationImpl.java:174)
     at com.sun.corba.ee.impl.resolver.INSURLOperationImpl.resolveINSURL(INSURLOperationImpl.java:127)
     at com.sun.corba.ee.impl.resolver.INSURLOperationImpl.operate(INSURLOperationImpl.java:117)
     at com.sun.corba.ee.impl.orb.ORBImpl.string_to_object(ORBImpl.java:883)
     at com.sun.enterprise.naming.NamingManagerImpl.lookup(NamingManagerImpl.java:723)
     at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:132)
     at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:286)
     at javax.naming.InitialContext.lookup(InitialContext.java:351)
     at ejb.mysessionremote.MySessionRemoteClient.create(MySessionRemoteClient.java:30)
     at ejb.mysessionremote.MySessionRemoteClient.m1(MySessionRemoteClient.java:45)
     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 com.sun.data.provider.impl.MethodResultTableDataProvider.invokeDataMethod(MethodResultTableDataProvider.java:236)
     at com.sun.data.provider.impl.MethodResultTableDataProvider.invokeDataMethod(MethodResultTableDataProvider.java:215)
     at com.sun.data.provider.impl.MethodResultTableDataProvider.testInvokeDataMethod(MethodResultTableDataProvider.java:267)
     at com.sun.data.provider.impl.MethodResultTableDataProvider.getResultObject(MethodResultTableDataProvider.java:123)
     at webapplication2.Page1.button1_action(Page1.java:239)
     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 com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:126)
     at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:72)
     at com.sun.rave.web.ui.appbase.faces.ActionListenerImpl.processAction(ActionListenerImpl.java:57)
     at javax.faces.component.UICommand.broadcast(UICommand.java:312)
     at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:267)
     at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:381)
     at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:75)
     at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:221)
     at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:90)
     at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
     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.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)
     at java.security.AccessController.doPrivileged(Native Method)
     at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
     at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)
     at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:257)
     at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55)
     at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:161)
     at java.security.AccessController.doPrivileged(Native Method)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
     at com.sun.rave.web.ui.util.UploadFilter.doFilter(UploadFilter.java:194)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:210)
     at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55)
     at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:161)
     at java.security.AccessController.doPrivileged(Native Method)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:263)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
     at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:225)
     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:173)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:132)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
     at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:933)
     at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:189)
     at com.sun.enterprise.web.connector.grizzly.ProcessorTask.doProcess(ProcessorTask.java:604)
     at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:475)
     at com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(ReadTask.java:371)
     at com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:264)
     at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:281)
     at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:83)
Caused by: java.lang.RuntimeException: java.net.ConnectException: Connection refused: connect
     at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:336)
     at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:191)
     ... 77 more
Caused by: java.net.ConnectException: Connection refused: connect
     at sun.nio.ch.Net.connect(Native Method)
     at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:464)
     at java.nio.channels.SocketChannel.open(SocketChannel.java:146)
     at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:320)
     ... 78 more
|#]

Similar Messages

  • Sun Team: Please help me regarding the login action previously i posted

    Hi sun team i have posted one thread recently. Please verify my code and guide me whether it is correct or not. And if any changes needed Please help me out regarding this.
    http://forum.java.sun.com/thread.jspa?threadID=5118906&tstart=0
    Thank You in Advance

    We do have a sample app that demos this scenario.
    Please check out:
    http://developers.sun.com/prodtech/javatools/jscreator/reference/code/sampleapps/index.jsp
    Databases: Two Page Create, Retrieve, Update, and Delete (CRUD) Database Operations with Table Display
    Two Page CRUD with Table Display is an application that demonstrates how to perform create, read, update, and delete operations on a cached rowset data provider. The data provider is bound to a JavaServer Faces table component. Rather than having functionality confined to one page, this application has two additional pages, one for creating a trip and another for updating a trip.
    http://developers.sun.com/prodtech/javatools/jscreator/reference/code/sampleapps/2/TwoPageCrudTable.zip
    http://developers.sun.com/prodtech/javatools/jscreator/reference/code/sampleapps/2/2update1/TwoPageCrudTable.zip
    Hope this helps,
    Sakthi

  • Help: Using EJB in Creator-2

    The NetBeans 5.5 tutorial is out of sync with the IDE. However, with the IDE I created a simple sessionbean with one business method that returns a hardcoded value of type String. This was housed in a EJBModule called EJBModule1. I added this to Creator-2 and dragged the only method called m1() into the SessionBean of Creator-2. I included a button and a staticText and the code given below. Building the project was successful. When it was run, on clicking the button, the following error was displayed:
    com.sun.data.provider.DataProviderException: java.lang.reflect.InvocationTargetException
    The code:
    public String button1_action() {
    try {           
    String name = (String) getSessionBean1().getMySessionRemoteM15().getResultObject();
    staticText1.setText(name);
    } catch (Exception e) {error(e.toString());}
    return null;
    }

    marysam,
    I am trying to reproduce this, but I am curious as to how you deployed your EJB module, keeping in mid that NB 5.5 and JSC 2u1 use two different versions of the PE app server (9 versus 8.2). I intend to point NB at JSCs' app server, create and deploy the EJB module to PE 8.2 from NB 5.5, then consume the EJB per your description.
    Regards,
    -Brad Mayer

  • Hey guyys .if some 1 from firefox team can help it wud be great......I was using firefox 3.6.3 on Mac OS 10.5.8 and Today I installed firefox 3.0(besides application folder) but not in same application folder like firefox 3.6.3 ...so now i had 2 firefox v

    hey guyys .if some 1 from firefox team can help it wud be great......I was using firefox 3.6.3 on Mac OS 10.5.8 and Today I installed firefox 3.0(besides application folder) but not in same application folder like firefox 3.6.3 ...so now i had 2 firefox version 3.6.3 and 3.0....I had 3.6.3 already open ..i closed it to... open 3.0 ....when i opened 3.0 it asked me to import settings i said no....it opened well.....then i close 3.0 and tried to open 3.6.3 version ...now it was a problem everything got lost sessions, bookmarks, add ons, etc....it went back to default ....when i had 2 profiles in 3.6.3.....can any pls help me on dis 1...is there a way to restore my sessions, bookmarks and add ons ??? I have uninstalled 3.0 version now....??? pls pls pls ....help
    == This happened ==
    Just once or twice
    == today

    It turns out that the problem had to do with network accounts, even though it was not clear at first.  Redirecting the program to the local machine's cache with a network home redirector script fixed the issue.  Thanks anyway.

  • I need a clarification : Can I use EJBs instead of helper classes for better performance and less network traffic?

    My application was designed based on MVC Architecture. But I made some changes to HMV base on my requirements. Servlet invoke helper classes, helper class uses EJBs to communicate with the database. Jsps also uses EJBs to backtrack the results.
    I have two EJBs(Stateless), one Servlet, nearly 70 helperclasses, and nearly 800 jsps. Servlet acts as Controler and all database transactions done through EJBs only. Helper classes are having business logic. Based on the request relevant helper classed is invoked by the Servlet, and all database transactions are done through EJBs. Session scope is 'Page' only.
    Now I am planning to use EJBs(for business logic) instead on Helper Classes. But before going to do that I need some clarification regarding Network traffic and for better usage of Container resources.
    Please suggest me which method (is Helper classes or Using EJBs) is perferable
    1) to get better performance and.
    2) for less network traffic
    3) for better container resource utilization
    I thought if I use EJBs, then the network traffic will increase. Because every time it make a remote call to EJBs.
    Please give detailed explanation.
    thank you,
    sudheer

    <i>Please suggest me which method (is Helper classes or Using EJBs) is perferable :
    1) to get better performance</i>
    EJB's have quite a lot of overhead associated with them to support transactions and remoteability. A non-EJB helper class will almost always outperform an EJB. Often considerably. If you plan on making your 70 helper classes EJB's you should expect to see a dramatic decrease in maximum throughput.
    <i>2) for less network traffic</i>
    There should be no difference. Both architectures will probably make the exact same JDBC calls from the RDBMS's perspective. And since the EJB's and JSP's are co-located there won't be any other additional overhead there either. (You are co-locating your JSP's and EJB's, aren't you?)
    <i>3) for better container resource utilization</i>
    Again, the EJB version will consume a lot more container resources.

  • Need help in storing XML data in SQL server using EJB

    Hi all...
    i have one XML file and i need to store the data of XML in one of the table of SQL server ..i want to do this using EJB..
    like this
    Example :
    Data i XML :
    ========
    <Employee>
    <Details>
    <empid> 101 </empid>
    <name> Ajitha </name>
    </Details>
    </Employee>
    Table i have Created in SQL SERVER:
    ==============================
    Empid || name
    Final output should be :
    =================
    Empid || name
    101 || Ajitha

    HI,
    Please check your settings as per following.
    Goto T code> DC20>Define data carrier type "server, front end"---> Then check the setting as per below
    Type             Description                    Path                       Online
    PC      give descriptio             maintain path         Tick
    Then Select this entry and click on " Define servers and files or folders"--->Then check the setting as per below
    Data Carrier       Type       Description
    DEFAULT           PC           default
    Then Select this entry and click on "Identify front computer"--> Then check the setting as per below
    Data Carrrier      Type        Net. address        Description
    Default          PC     DEFAULT            Default for local PC
    I have explained above so that u can co relate your settings with above..
    I hope this will help you.
    Thanks
    Yogesh

  • Ergent Help Using JBoss, EJBs ...

    Hey to all ....
    Please help me, i just started EJBs and i am having difficulties with the given project.
    So ..
    I am using EJB, Jboss too deploy everything
    I have created my entities and some sessions.
    Entities have created my database correctly.
    Now i want to access the data from Jsp.
    I Could use some help on that.
    I am trying to create the JSP to call the sessions files that i have but i must be doing something wrong.
    I have jared both entities and sessions and uploaded them in ejb container.
    I am placing my jsp into the jsp container.
    i am placing all classes into the web-inf container as well in the jsp container.
    HOW will i get the data using the JSp ?
    Please some help here.
    Perhaps not the best post, but i have no idea what else too post

    done it .... :)

  • Need help using XWS-Security with EJB service endpoint

    I am trying to use XWS-Security along the lines of the JWSDP 1.6 examples, but with an EJB endpoint deployed in an ejb-jar file rather than a typical service endpoint deployed in a WAR.
    Any information on how to do this would be appreciated. I believe I'm close to getting an example working- the details on the problem I've encountered are below.
    I use WSCompile to generate stubs and ties for my WS, and XDoclet to generate the ejb-jar.xml. I deploy the ejb-jar on JBoss 4.0.2.
    The problem I'm having is that the security features are handled in the Stubs and Ties generated by WSCompile, and my server-side refuses to use the WSCompile generated Tie. Previously the web service had used the WSCompile argument 'import="true"', which generated no tie, and the web service worked (this was before I tried to add security features). Whatever mechanism had been used to direct messages to my EJB then is still being used now (JNDI, I believe, facilitated by the ejb-jar.xml and webservices.xml files), and bypassing the Tie class that I now generate using 'server="true"'.
    There must be some way I can reconfigure my webservice so that the WSCompile generated Tie is used, but I can't find any help on the topic.
    Can anyone tell me how to make sure my webservice will use the Tie class on the server side? Is it even possible when using EJBs instead of servlets?

    Burn your CD using iTunes. Then rip the music off of the CD using any "ripping" program. Just make sure the program you use has the "save as .wav" option available. Im not familiar with MusicMatch but I'm sure you would be able to use it.

  • Hi support team, I'm using iphone4, After i upgraded my ios7 i'm facing issues.Need ur help

    Hi support team, I'm using iphone4, After i upgraded my ios7.0.2 i'm facing issues.
    - Unable to view the incoming calls.
    - mobile hanging

    This is not the "support team".  These are user to user forums.  You are not addresssing Apple's "support team" by posting here.
    Which of the troubhleshooting steps listed in the iOS 7 user guide have you tried?  Have you tried a reset?

  • Help - using custom login module with embedded jdev oc4j to access ejb 3

    Hi All (Frank ??),
    I'm just wondering if anyone has successfully been able to leverage a custom login module in combination
    with a client that connects to a local EJB 3 stateless session bean through Jdeveloper 10.1.3.2's embedded oc4j.
    I have spent 2+ days trying to get this to work - and i think I resound now to the fact im going to
    have to deploy to oc4j standalone instead.
    I got close.. but finally was trumped with the following error from the client trying to access the ejb:-
    javax.naming.NoPermissionException: Not allowed to look up XXXXXX, check the namespace-access tag
    setting in orion-application.xml for details.
    Using the various guides available, I had no problem getting the custom login module working
    with a local servlet running from JDev's embedded oc4j.. however with ejb - no such luck.
    I have a roles table (possible values Member, Admin) - that maps to sr_Member and sr_Admin
    respectively in various config files.
    I'm using EJB 3 annotations for protecting methods .. for example
    @RolesAllowed("sr_Member")
    Steps that I had to do so far :-
    In <jdevhome>\jdev\system\oracle.jwee.10.1.3.40.66\embedded-oc4j\config\system-jazn-data.xml1) Add custom login module
        <application>
          <name>current-workspace-app</name>
          <login-modules>
            <login-module>
              <class>kr.security.KnowRushLoginModule</class>
              <control-flag>required</control-flag>
              <options>
                <option>
                  <name>dataSource</name>
                  <value>jdbc/DB_XE_KNOWRUSHDS</value>
                </option>
                <option>
                  <name>user.table</name>
                  <value>users</value>
                </option>
                <option>
                  <name>user.pk.column</name>
                  <value>id</value>
                </option>
                <option>
                  <name>user.name.column</name>
                  <value>email_address</value>
                </option>
                <option>
                  <name>user.password.column</name>
                  <value>password</value>
                </option>
                <option>
                  <name>role.table</name>
                  <value>roles</value>
                </option>
                <option>
                  <name>role.to.user.fk.column</name>
                  <value>user_id</value>
                </option>
                <option>
                  <name>role.name.column</name>
                  <value>name</value>
                </option>
              </options>
            </login-module>
          </login-modules>
        </application>2) Grant login rmi permission to roles associated with custom login module (also in system-jazn-data.xml)
      <grant>
        <grantee>
          <principals>
            <principal>
              <realm-name>jazn.com</realm-name>
              <type>role</type>
              <class>kr.security.principals.KRRolePrincipal</class>
              <name>Admin</name>
            </principal>
          </principals>
        </grantee>
        <permissions>
          <permission>
            <class>com.evermind.server.rmi.RMIPermission</class>
            <name>login</name>
          </permission>
        </permissions>
      </grant>
      <grant>
        <grantee>
          <principals>
            <principal>
              <realm-name>jazn.com</realm-name>
              <type>role</type>
              <class>kr.security.principals.KRRolePrincipal</class>
              <name>Member</name>
            </principal>
          </principals>
        </grantee>
        <permissions>
          <permission>
            <class>com.evermind.server.rmi.RMIPermission</class>
            <name>login</name>
          </permission>
        </permissions>
      </grant>3) I've tried creating various oracle and j2ee deployment descriptors (even though ejb-jar.xml and orion-ejb-jar.xml get created automatically when running the session bean in jdev).
    My ejb-jar.xml contains :-
    <?xml version="1.0" encoding="utf-8"?>
    <ejb-jar xmlns ....
      <assembly-descriptor>
        <security-role>
          <role-name>sr_Admin</role-name>
        </security-role>
        <security-role>
          <role-name>sr_Member</role-name>
        </security-role>
      </assembly-descriptor>
    </ejb-jar>Note- i'm not specifying the enterprise-beans stuff, as JDev seems to populate this automatically.
    My orion-ejb-jar.xml contains ...
    <?xml version="1.0" encoding="utf-8"?>
    <orion-ejb-jar ...
      <assembly-descriptor>
        <security-role-mapping name="sr_Admin">
          <group name="Admin"></group>
        </security-role-mapping>
        <security-role-mapping name="sr_Member">
          <group name="Member"></group>
        </security-role-mapping>
        <default-method-access>
          <security-role-mapping name="sr_Member" impliesAll="true">
          </security-role-mapping>
        </default-method-access>
      </assembly-descriptor>My orion-application.xml contains ...
    <?xml version="1.0" encoding="utf-8"?>
    <orion-application xmlns ...
      <security-role-mapping name="sr_Admin">
        <group name="Admin"></group>
      </security-role-mapping>
      <security-role-mapping name="sr_Member">
        <group name="Member"></group>
      </security-role-mapping>
      <jazn provider="XML">
        <property name="role.mapping.dynamic" value="true"></property>
        <property name="custom.loginmodule.provider" value="true"></property>
      </jazn>
      <namespace-access>
        <read-access>
          <namespace-resource root="">
            <security-role-mapping name="sr_Admin">
              <group name="Admin"/>
              <group name="Member"/>
            </security-role-mapping>
          </namespace-resource>
        </read-access>
        <write-access>
          <namespace-resource root="">
            <security-role-mapping name="sr_Admin">
              <group name="Admin"/>
              <group name="Member"/>
            </security-role-mapping>
          </namespace-resource>
        </write-access>
      </namespace-access>
    </orion-application>My essentially auto-generated EJB 3 client does the following :-
          Hashtable env = new Hashtable();
          env.put(Context.SECURITY_PRINCIPAL, "matt.shannon");
          env.put(Context.SECURITY_CREDENTIALS, "welcome1");
          final Context context = new InitialContext(env);
          KRFacade kRFacade = (KRFacade)context.lookup("KRFacade");
    ...And throws the error
    20/04/2007 00:55:37 oracle.j2ee.rmi.RMIMessages
    EXCEPTION_ORIGINATES_FROM_THE_REMOTE_SERVER
    WARNING: Exception returned by remote server: {0}
    javax.naming.NoPermissionException: Not allowed to look
    up KRFacade, check the namespace-access tag setting in
    orion-application.xml for details
         at
    com.evermind.server.rmi.RMIClientConnection.handleLookupRe
    sponse(RMIClientConnection.java:819)
         at
    com.evermind.server.rmi.RMIClientConnection.handleOrmiComm
    andResponse(RMIClientConnection.java:283)
    ....I can see from the console that the user was successfully authenticated :-
    20/04/2007 00:55:37 kr.security.KnowRushLoginModule validate
    WARNING: [KnowRushLoginModule] User matt.shannon authenticated
    And that user is granted both the Admin, and Member roles.
    The test servlet using basic authentication correctly detects the user and roles perfectly...
      public void doGet(HttpServletRequest request,
                        HttpServletResponse response)
        throws ServletException, IOException
        LOGGER.log(Level.INFO,LOGPREFIX +"doGet called");
        response.setContentType(CONTENT_TYPE);
        PrintWriter out = response.getWriter();
        out.println("<html>");
        out.println("<head><title>ExampleServlet</title></head>");
        out.println("<body>");
        out.println("<p>The servlet has received a GET. This is the reply.</p>");
        out.println("<br> getRemoteUser = " + request.getRemoteUser());
        out.println("<br> getUserPrincipal = " + request.getUserPrincipal());
        out.println("<br> isUserInRole('sr_Admin') = "+request.isUserInRole("sr_Admin"));
        out.println("<br> isUserInRole('sr_Memeber') = "+request.isUserInRole("sr_Member"));Anyone got any ideas what could be going wrong?
    cheers
    Matt.
    Message was edited by:
    mshannon

    Thanks for the response. I checked out your blog and tried your suggestions. I'm sure it works well in standalone OC4J, but i was still unable to get it to function correctly from JDeveloper embedded.
    Did you ever get the code working directly from JDeveloper?
    Your custom code essentially seems to be the equivalent of a grant within system-jazn-data.xml.
    For example, the following grant to a custom jaas role (JAAS_ADMIN) that gets added by my custom login module gives them rmi login access :-
         <grant>
              <grantee>
                   <principals>
                        <principal>
                             <realm-name>jazn.com</realm-name>
                             <type>role</type>
                             <class>kr.security.principals.KRRolePrincipal</class>
                             <name>JAAS_Admin</name>
                        </principal>
                   </principals>
              </grantee>
              <permissions>
                   <permission>
                        <class>com.evermind.server.rmi.RMIPermission</class>
                        <name>login</name>
                   </permission>
              </permissions>
         </grant>If I add the following to orion-application.xml
      <!-- Granting login permission to users accessing this EJB. -->
      <namespace-access>
        <read-access>
          <namespace-resource root="">
            <security-role-mapping>
              <group name="JAAS_Admin"></group>
            </security-role-mapping>
          </namespace-resource>
        </read-access>Running a standalone client against the embedded jdev oc4j server gives the namespace-access error.
    I tried out your code by essentially creating a static reference to a singleton class that does the role lookup/provisioning with rmi login grant :-
    From custom login module :-
      private static KRSecurityHelper singleton = new KRSecurityHelper();
      protected Principal[] m_Principals;
        Vector v = new Vector();
          v.add(singleton.getCustomRmiConnectRole());
          // set principals in LoginModule
          m_Principals=(Principal[]) v.toArray(new Principal[v.size()]);
    Singleton class :-
    package kr.security;
    import com.evermind.server.rmi.RMIPermission;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import oracle.security.jazn.JAZNConfig;
    import oracle.security.jazn.policy.Grantee;
    import oracle.security.jazn.realm.Realm;
    import oracle.security.jazn.realm.RealmManager;
    import oracle.security.jazn.realm.RealmRole;
    import oracle.security.jazn.realm.RoleManager;
    import oracle.security.jazn.policy.JAZNPolicy;
    import oracle.security.jazn.JAZNException;
    public class KRSecurityHelper
      private static final Logger LOGGER = Logger.getLogger("kr.security");
      private static final String LOGPREFIX = "[KRSecurityHelper] ";
      public static String CUSTOM_RMI_CONNECT_ROLE = "remote_connect";
      private RealmRole m_Role = null;
      public KRSecurityHelper()
        LOGGER.log(Level.FINEST,LOGPREFIX +"calling JAZNConfig.getJAZNConfig");
        JAZNConfig jc = JAZNConfig.getJAZNConfig();
        LOGGER.log(Level.FINEST,LOGPREFIX +"calling jc.getRealmManager");
        RealmManager realmMgr = jc.getRealmManager();
        try
          // Get the default realm .. e.g. jazn.com
          LOGGER.log(Level.FINEST,LOGPREFIX +"calling jc.getGetDefaultRealm");
          Realm r = realmMgr.getRealm(jc.getDefaultRealm());
          LOGGER.log(Level.INFO,LOGPREFIX +"default realm: "+r.getName());
          // Access the role manager for the remote connection role
          LOGGER.log(Level.FINEST,
            LOGPREFIX +"calling default_realm.getRoleManager");
          RoleManager roleMgr = r.getRoleManager();
          LOGGER.log(Level.INFO,LOGPREFIX +"looking up custom role '"
            CUSTOM_RMI_CONNECT_ROLE "'");
          RealmRole rmiConnectRole = roleMgr.getRole(CUSTOM_RMI_CONNECT_ROLE);
          if (rmiConnectRole == null)
            LOGGER.log(Level.INFO,LOGPREFIX +"role does not exist, create it...");
            rmiConnectRole = roleMgr.createRole(CUSTOM_RMI_CONNECT_ROLE);
            LOGGER.log(Level.FINEST,LOGPREFIX +"constructing new grantee");
            Grantee gtee = new Grantee(rmiConnectRole);
            LOGGER.log(Level.FINEST,LOGPREFIX +"constructing login rmi permission");
            RMIPermission login = new RMIPermission("login");
            LOGGER.log(Level.FINEST,
              LOGPREFIX +"constructing subject.propagation rmi permission");
            RMIPermission subjectprop = new RMIPermission("subject.propagation");
            // make policy changes
            LOGGER.log(Level.FINEST,LOGPREFIX +"calling jc.getPolicy");
            JAZNPolicy policy = jc.getPolicy();
            if (policy != null)
              LOGGER.log(Level.INFO, LOGPREFIX
                + "add to policy grant for RMI 'login' permission to "
                + CUSTOM_RMI_CONNECT_ROLE);
              policy.grant(gtee, login);
              LOGGER.log(Level.INFO, LOGPREFIX
                + "add to policy grant for RMI 'subject.propagation' permission to "
                + CUSTOM_RMI_CONNECT_ROLE);
              policy.grant(gtee, subjectprop);
              // m_Role = rmiConnectRole;
              m_Role = roleMgr.getRole(CUSTOM_RMI_CONNECT_ROLE);
              LOGGER.log(Level.INFO, LOGPREFIX
                + m_Role.getName() + ":" + m_Role.getFullName() + ":" + m_Role.getFullName());
            else
              LOGGER.log(Level.WARNING,LOGPREFIX +"Cannot find jazn policy!");
          else
            LOGGER.log(Level.INFO,LOGPREFIX +"custom role already exists");
            m_Role = rmiConnectRole;
        catch (JAZNException e)
          LOGGER.log(Level.WARNING,
            LOGPREFIX +"Cannot configure JAZN for remote connections");
      public RealmRole getCustomRmiConnectRole()
        return m_Role;
    }Using the code approach and switching application.xml across so that namespace access is for the group remote_connect, I get the following error from my bean :-
    INFO: Login permission not granted for current-workspace-app (test.user)
    Thus, the login permission that I'm adding through the custom remote_connect role does not seem to work. Even if it did, i'm pretty sure I would still get that namespace error.
    This has been such a frustrating process. All the custom login module samples using embedded JDeveloper show simple j2ee servlet protection based on settings in web.xml.
    There are no samples showing jdeveloper embedded oc4j using ejb with custom login modules.
    Hopefully the oc4j jdev gurus like Frank can write a paper that demonstrates this.
    Matt.

  • Help needed - why we use ejb-ref element in ejb-jar.xml

    hi all
    can anyone tell me what is the purpose of this element in the ejb deploy descriptor? thanks

    Suppose u have bean A, which needs to look up another bean B. Normally you wud need to use the jndi lookup using the initial context to access the bean B's home interface. If you use ejb-ref element you dont need to know the JNDI name of bean B. You can use ejb-ref-name instead. So you can say this is a short cut method of looking up and getting a reference to a bean's home object.

  • Help using JMS in a network/general architecture

    Hi everybody :
    We are working on the development of a distributed application. The architecture of the system is something like this:
    - A dispatcherthat receives requests (in a string shape) via http post. This unit has to encapsulate this request in a object and fordward such a petition to the correct service according a parameter of the request string.
    - A little number of services (4 or 5) that wait for requests delivered by the dispatcher. When a petition arrives, is attended to, and a response is sent to the client, using the http post that the client has used to send us the initial request. The computation complexity could be severe (access to DB, on-demand compilations, multimedia handling...).
    The distribution arises when we wanted to place each service on different machines due a heavy amount of requests.
    On a first approach, we are considering to use a servlet to manage the requests and JMS as middleware messaging service, as we want to provide an efficient communication layer between the modules of our application.
    Here come my doubts:
    - Would be the system more efficient if the service-providers are some kind of Enterprise Java Beans? And servlets?
    - I have readed the JMS and de JNDI tutorial. I have performed many tests in local mode, and i want now to do the same in a network mode... could somebody orient me? How do could i bind a connection factory with a specific resource across the network? In coding time or in deploying time?
    Help will be very very appreciated!!!!!
    Thank you very much for reading this message
    Greetings from Maria, Spain (europe)

    Hello Maria,
    You mention several things regarding architecture. I'll try to iterate them for you. As always this is just one persons idea/opionion.
    Receive Request from HTTP Posts. (Dispatcher)
    -- Sounds like an XML String morphed into an object via servlet. You could standardize on SOAP if it's not too much overhead.
    Services - High computation...
    Let jms receive and queue these requests. A service delegate can spawn threads to deal with the complex computations. I say Queue so you can cap the active thread count and pause the delegators thread creation due to any memory / cpu constraints...
    As far as JMS is concerned I'm unaware of your transactional requirements. In enterprise systems I have written, everything must be transacted and audited. JMS has a nice model for this. You could move to a pub/sub architecture as well.
    Scalability - (Distribution arises) - Each machine can maintain it's own queue and the servlets can distribute to them. Or you can pub/sub them via a dispatcher, it's own machine if desired - and let each machine act as a listener. A nice model as the amount of services grows.
    - Now that I've only reiterated what you've tried..
    Would be the system more efficient if the service-providers are some kind of Enterprise Java Beans? And servlets?
    -In my opionion for the high volume HTTP requests, servlets can lift the load.
    -You system has a high level of requests and load on your CPU. I'll also assume that transactions and auditing are required. As I'm sure you well know EJB is not the fastest animal in the forest. I would not use Message Driven Beans as you will have a hard time tunning performance within an EJB Container.
    - Now after I've said all that any fallout and persistance requrements from each service can leverage EJB's. Just remember that EJB's lend themselves well to web/commerce apps. I have no idea of your applications context so I'm taking a stab. There are wonderful tools in the EJB architecture, however, just because you've chosen Java doesn't mean you have to use EJB's. If speed in an issue for these services ( persisted or session level ) perhaps a mix is what your desire. ( I find session beans to be much better accessors than there sluggish entity brothers. )
    JNDI - Create a Service Locator that abstract the lookups for your services. Depending on how far you want to go. Our Service Locator can look up a multitude of contexts. Be it Weblogic/Websphere or a file system. There is no magic to it you just have to plug and play the contexts.
    "I have readed the JMS and de JNDI tutorial. I have performed many tests in local mode, and i want now to do the same in a network mode... could somebody orient me? How do could i bind a connection factory with a specific resource across the network? In coding time or in deploying time?"
    --I would take the performance hit on late binding and use caching to try and gain some back.  Below is a small example...
    -- All in all, It would help you to become more familiar with the EJB spec if your planning on that path. You soon come to notice it's features ( and particular quirks ).
    Good Luck,
    Hope this helps
    private String serverInstance;
    private String serverPort;
    /** Creates new ServiceLocator */
    protected ServiceLocator(String host, String port) {
    this.serverInstance = host;
    this.serverPort = port;
    public String getServerPort() {
    return this.serverPort;
    public String getServerInstance() {
    return this.serverInstance;
    private javax.naming.Context getInitialContext() throws javax.naming.NamingException {
    javax.naming.Context ctx = null;
    java.util.Properties prop = new java.util.Properties();
    prop.put("java.naming.factory.initial", "com.sun.jndi.rmi.registry.RegistryContextFactory");
    prop.put("java.naming.provider.url", "rmi://"+serverInstance+":"+serverPort+"");
    prop.put("java.naming.factory.url.pkgs", "org.objectweb.jonas.naming");
    ctx = new javax.naming.InitialContext(prop);
    return ctx;
    public Object getContainerService(String jndiName) throws javax.naming.NamingException {
    javax.naming.Context ctx = getInitialContext();
    java.lang.Object obj = ctx.lookup(jndiName);
    return obj;
    public static ServiceLocator getInstance(String host, String port) {       
    return new ServiceLocator(host, port);

  • Problem in invoking LiveCycle using EJB

    Hi All,
    I am trying to invoke LC using EJB protocol. I referred the code example from the link http://help.adobe.com/en_US/livecycle/9.0/programLC/help/index.htm?content=001001.html#154 8359
    But I am facing the problem in the same code. Here is the stack trace for the same:
    Error Occurred: Exception thrown is NOT a
    DSCException : UnExpected From DSC
    com.adobe.idp.um.api.UMException  
    | [com.adobe.livecycle.usermanager.client.AuthenticationManagerServiceClient] errorCode:16385 errorCodeHEX:0x4001 message:Exception thrown is NOT a DSCException : UnExpected From DSC chainedException:java.lang.IllegalStateExceptionchainedExceptionMessage:null chainedException trace:java.lang.IllegalStateException
    at com.adobe.idp.dsc.clientsdk.ServiceClientFactory$1.handleThrowable( 
    ServiceClientFactory.java:69)at com.adobe.idp.dsc.clientsdk.ServiceClient.invoke( 
    ServiceClient.java:220)at com.adobe.livecycle.usermanager.client.AuthenticationManagerServiceClient.authenticate( 
    AuthenticationManagerServiceClient.java:109)at in.gov.ebiz.eforms.invocation.AuthenticateUsersTest.main( 
    AuthenticateUsersTest.java:47)Caused by: java.lang.NoClassDefFoundError:  
    javax/ejb/EJBException
    at com.adobe.idp.dsc.clientsdk.ServiceClientFactory.evaluateMessageDispatcher( 
    ServiceClientFactory.java:587)at com.adobe.idp.dsc.clientsdk.ServiceClient.invoke( 
    ServiceClient.java:215)... 2 more
    Caused by:  
    java.lang.ClassNotFoundException: javax.ejb.EJBException
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged( 
    Native Method)at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    ... 4 more
    at com.adobe.livecycle.usermanager.client.ManagerServiceClient.throwNonUMExceptionAsUMExcept ion( 
    ManagerServiceClient.java:53)at com.adobe.livecycle.usermanager.client.ManagerServiceClient.handleException( 
    ManagerServiceClient.java:95)at com.adobe.livecycle.usermanager.client.AuthenticationManagerServiceClient.authenticate( 
    AuthenticationManagerServiceClient.java:113)at in.gov.ebiz.eforms.invocation.AuthenticateUsersTest.main( 
    AuthenticateUsersTest.java:47)
    Please advice me. Am I missing some jar? or Do I need to configure some settings at the server end?
    Regards,
    Ambika

    The .xml and code looks ok. Using java:comp/env is the right approach. How does getInitialContext() instantiate the InitialContext()? Make sure it's using the no-arg "new InitialContext" Also try running the $APS_HOME/bin/verifier on your .ear. Please also post the full stack trace. Thanks.
    --ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Need help using HashMap in a Message Driven App

    Hi ppl,
    Im new to the forum and to Java as well. I do have some basic Java knowledge though. Anyway Im a 4th Year student and I got an assignment to build a message server that uses map messages. I fiddled around with the NewsApp example provided at NetBeans ( http://www.netbeans.org/kb/55/ejb30.html)and tried modifying it to set up to use a HashMap but no success :(
    Here are some snippets,
    NewsEntity.java
    package ejb;
    import java.io.Serializable;
    import javax.persistence.Entity;
    import javax.persistence.GeneratedValue;
    import javax.persistence.GenerationType;
    import javax.persistence.Id;
    * Entity class NewsEntity
    * @author Kiran
    @Entity
    public class NewsEntity implements Serializable {
        private String title;
        private String body;
        private HashMap hm = new HashMap();
        @Id
        @GeneratedValue(strategy = GenerationType.AUTO)
        private Long id;
        /** Creates a new instance of NewsEntity */
        public NewsEntity() {
        public Long getId() {
            return this.id;
        public void setId(Long id) {
            this.id = id;
        @Override
        public int hashCode() {
            int hash = 0;
            hash += (this.getId() != null ? this.getId().hashCode() : 0);
            return hash;
        @Override
        public boolean equals(Object object) {
            // TODO: Warning - this method won't work in the case the id fields are not set
            if (!(object instanceof NewsEntity)) {
                return false;
            NewsEntity other = (NewsEntity)object;
            if (this.getId() != other.getId() && (this.getId() == null || !this.getId().equals(other.getId()))) return false;
            return true;
         * Returns a string representation of the object.  This implementation constructs
         * that representation based on the id fields.
         * @return a string representation of the object.
        @Override
        public String toString() {
            return "ejb.NewsEntity[id=" + getId() + "]";
        public String getTitle() {
            return title;
        public void setTitle(String title) {
            this.title = title;
        public String getBody() {
            return body;
        public void setBody(String body) {
            this.body = body;
    public HashMap getHm() {
            return hm;
        public void setHm(HashMap hm) {
            this.hm = hm;
    PostMessage.java
    public class PostMessage extends HttpServlet {
        @Resource(mappedName="jms/NewMessageFactory")
        private  ConnectionFactory connectionFactory;
        @Resource(mappedName="jms/NewMessage")
        private  Queue queue;
        /** Processes requests for both HTTP <code>GET</code> and <code>POST</code> methods.
         * @param request servlet request
         * @param response servlet response
        protected void processRequest(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
            response.setContentType("text/html;charset=UTF-8");
            String title=request.getParameter("title");
            String body=request.getParameter("body");
            HashMap hm = new HashMap();
            hm.put("title", request.getParameter("title"));
            hm.put("body", request.getParameter("body"));
            if ((title!=null) && (body!=null)) {
                try {
                    Connection connection = connectionFactory.createConnection();
                    Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
                    MessageProducer messageProducer = session.createProducer(queue);
                    ObjectMessage message = session.createObjectMessage();
                    // here we create NewsEntity, that will be sent in JMS message
                    NewsEntity e = new NewsEntity();
                    e.setTitle(title);
                    e.setBody(body);
                    e.setHm(hm);
                    message.setObject(e);               
                    messageProducer.send(message);
                    messageProducer.close();
                    connection.close();
                    // response.sendRedirect("ListNews");
                } catch (JMSException ex) {
                    ex.printStackTrace();
            }(Some other code goes here to display the HTML form. not important)
    ListNews.Java
    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
            response.setContentType("text/html;charset=UTF-8");
            PrintWriter out = response.getWriter();
            HashMap hm = new HashMap();
            out.println("<html>");
            out.println("<head>");
            out.println("<title>Show Messages</title>");
            out.println("</head>");
            out.println("<body bgcolor='#FFCCFF'>");
            out.println("<h1>Showing all Messages</h1>");
            List news = newsEntityFacade.findAll();
            for (Iterator it = news.iterator(); it.hasNext();) {
                 NewsEntity elem = (NewsEntity) it.next();
                hm = elem.getHm();
                out.println(" <table width='35%' border='0' cellpadding='1' cellspacing='1' bgcolor='#000000'> ");
                out.println("   <tr bordercolor='#000000' bgcolor='#CC99FF'> ");
                out.println("     <td width='19%' bgcolor='#CC99FF'><font color='#000000'><strong>Name</strong></font></td>");
                out.println("     <td width='81%' bgcolor='#CC99FF'><font color='#000000'>" + elem.getTitle() + "</font></td>");
                out.println("   </tr>");
                out.println("   <tr bordercolor='#000000' bgcolor='#CC99FF'> ");
                out.println("     <td><font color='#000000'><strong>Message</strong></font></td>");
                out.println("     <td><font color='#000000'>" + elem.getBody() + "</font></td>");
                out.println("   </tr>");
                out.println(" </table>");
                out.println("-----" + hm.get("title")); //I just want to try to get 1 item to see if it works
                out.println("   <br />");
            }Well thats the important parts of the code. it works fine when I send simple messages but when I try out the HashMap the servlet is displayed but no messages are sent to the queue. It would be great if anyone could help.
    I know this isnt that clear but Im really tired and frustrated right now if you need more info please ask and I can supply it. Thanks

    Hi, so I've added a weblogic-ejb.jar.xml file with a reference to the JNDI name of the work manager:
    <?xml version="1.0" encoding="UTF-8"?>
    <wls:weblogic-ejb-jar xmlns:wls="http://xmlns.oracle.com/weblogic/weblogic-ejb-jar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd http://xmlns.oracle.com/weblogic/weblogic-ejb-jar http://xmlns.oracle.com/weblogic/weblogic-ejb-jar/1.0/weblogic-ejb-jar.xsd">
        <wls:weblogic-enterprise-bean>
            <wls:ejb-name>DependencyWorker</wls:ejb-name>
            <wls:resource-description>
                <wls:res-ref-name>MyWorkManager</wls:res-ref-name>
                <wls:jndi-name>wm/MyWorkManager</wls:jndi-name>
            </wls:resource-description>
        </wls:weblogic-enterprise-bean>
    </wls:weblogic-ejb-jar>But I still get exactly the same error when I try to start my server. The example you referred to kind of cryptically suggests that adding a plan.xml suddenly fixed everything, but what am I missing here that actually hooks the work manager up to JNDI? am I getting these problems because I'm using annotations, or are people not supposed to access work managers in this way?
    Thanks,
    Edited by: 806682 on 05-Nov-2010 08:57

  • SUN TEAM URGENT:  auto creation of data source, connection pool, ...etc

    to the sun team,
    i have been using NB+VWP to deploy an application created in JSCU2 to a Sun App Server 9.
    for some reason, whenever am viewing a DB connection in the servers window and drag-drop a table on the page, the system is automatically creating a new data source, a new conneciton pool, and new jdbc resource. also, it is removing the necessary references in web.xml and sun-web.xml.
    is there any way to get around this? otherwise, i am forced to modify the jdbc settings in the server as well as the config file each i drag-drop a DB table/view.
    thanks so much
    - Peter

    Unfortunately, this is a bug and should be fixed in the next release.
    I'll look for the issue id.
    In the meantime, this workaround may help:
    http://wiki.netbeans.org/wiki/view/VWPUserFAQsavewebxml
    John Baker
    http://blogs.sun.com/dashboy

Maybe you are looking for

  • Regarding Condition record in CRM using field MATKL (Material Group)

    Hi All Currently we are working in SAP CRM 5.2 and it has been connected with backend ECC 6.0. This scenario is about Pricing which has been maintained in ECC and inturn flows to CRM with few filters in place. There are few customized Condition Table

  • System is constantly freezing. What is wrong?

    I've been having some serious problems with my computer in the last couple of weeks. System completely freezes. First time it happened, I was listening to music on iTunes while away from the desk. It was the only running app. Music simply stopped. I

  • Converting Word 2010 to .pdf

    I can't get my Word 2010 document to convert to pdf. I have Adobe Acrobat Pro 9

  • Security - Can I limit the number of computers which can access a PDF?

    I'd like to set the following specific securities over my PDF document: 1. Password access 2. Editing (copy/paste) disabled. I already know how to do these two in Acrobat. 3. Limit the number of computers which can open the document. (i.e. I want to

  • Script to change colors

    I'd like a Java Script that will allow the user to change character colors in a document using a drop-down menu to select the new color, or a form the user can type the new color into. Has anyone seen anything like this?