Using EJB remote session beans llike webservice.

My requirement is to fetch a big size ASCII stream file from a remote location. For this can I use Statless EJB Session beans?
For this EJB application & Web application will be on my application server side & EJB client should reside on the remote end side from where I want to fetch the file. - Please confirm my this logic as I am new in Java & EJB, I am having a basic query like this. (I don't want to proceed with EJB web service like (@Stateless, @WebService), I want to purly use EJB Statless Remote session beans - Is this possible?
If yes, can I have one sample example URL pls?
Thanks in advance for your help.

My requirement is to fetch a big size ASCII stream file from a remote location. For this can I use Statless EJB Session beans?
For this EJB application & Web application will be on my application server side & EJB client should reside on the remote end side from where I want to fetch the file. - Please confirm my this logic as I am new in Java & EJB, I am having a basic query like this. (I don't want to proceed with EJB web service like (@Stateless, @WebService), I want to purly use EJB Statless Remote session beans - Is this possible?
If yes, can I have one sample example URL pls?
Thanks in advance for your help.

Similar Messages

  • Problem Calling Remote Session Bean Method

    Need help. I am trying to call a method in a remote stateless session bean in an EJB in my web application from a stateless session bean in a different EJB in the web application. I am getting a run-time error that says,
    "java.lang.NoClassDefFoundError: dtpitb.common.sb.reports.CommonReportsHome"
    ref = ctx.lookup( jndiName );
    // Cast to Local Home Interface using RMI-IIOP
    commonReportsHome = (CommonReportsHome)
    PortableRemoteObject.narrow(ref, CommonReportsHome.class);
    If while in a session bean of an EJB, I want to call a public method in the session bean of a totally different EJB, is there something in particular I am missing. I can make the call from the web application code. I can make a remote call from this session bean to itself in the exact same fashion. I just can't call a session bean in another EJB. All thoughts are welcome.
    Thanks,
    Pete

    Thanks for replying. That could very well be the case I suppose. I'm using JBuilder and WebLogic, and JBuilder pretty much does all of the deployment descriptor code for me. However, maybe this is something I need to incorporate manually.
    One EJB is in the same project as the web application code. The other EJB (common_ejb) is in another project. The calling session bean is in the project with the web app, and the remote session bean method that I'm targeting is in the common EJB session bean. Both EJBs are included in the web app's WEB-INF\lib dir and in the war file.
    So theoretically, this isn't an unconventional practice I assume?
    Thanks,
    Pete

  • How to use EJB Remote with Netbeans7.0 ?

    I try to create Session Bean in Netbeans 7.0 but when I select Remote then I have to select Java Application in Netbeans. It different from Netbeans 6.8 ,6.9 which in Netbeans6.8, 6.9 not have dropdown for select Java Application when we choose Remote. So I don't know how to use EJB Remote in Netbeans7.0 then I click finish. After that, I create Project is Enterprise Application Client. but in Main.java at this line
    BLSessionRemote obj = (BLSessionRemote)ctx.lookup("TestBean");
    It can't find BLSessionRemote in Session Beans. How to use EJB Remote with Netbeans7.0 ?

    Why don't you ask this question in the Netbeans mailing lists, where it belongs. Come here when you have problems with code you wrote yourself.

  • Registering EJB/Stateless Session Bean Web Service in Registry

    Hi verybody!
    I would like to know how I can register a Web Service in a registry. The web service is implemented as a session bean.
    The problem is not the actual code to register the service, but how and where can I hook this code into the application so that it is started when the application server is started.
    I've read the Sun J2EE tutorial which registered the service in the moment when the context for the servlet for an ordinary web client was created. This is not what I want. I would like to register the service when starting the EJB container, without the need to give it a kick from some external interface.
    Any help or ideas will be greatly welcome
    Regards
    PI

    1. But I thought you were using a 'stateful session bean'?
    2. For stateless session beans, there is no direct link between a remote reference and an instance of the bean. It is safe to hang on to the remote reference as long as you would like, of course it may go stale if the server dies. You will also find that the create() method does not actually contact the server, so doing it each usage costs very little. So, either way you should be fine.
    3. As for memory leaks, make sure that you are closing all statements, result sets, etc. promptly. These are commonly the problem. Also, use hprof or some other profile tool to determine what types of data you are allocating and (with better tools) what types of data you may be holding on to references to.
    Chuck

  • Invalid username/password to call a remote session bean

    I am having a problem accessing a remote session bean,
    javax.naming.NamingException: Lookup error: javax.naming.AuthenticationException: Invalid username/password for default (admin); nested exception is:
         javax.naming.AuthenticationException: Invalid username/password for default (admin) [Root exception is javax.naming.AuthenticationException: Invalid username/password for default (admin)]
         at com.evermind.server.rmi.RMIContext.lookup(RMIContext.java:168)
         at javax.naming.InitialContext.lookup(InitialContext.java:347)
    Ejb is delpoyed into an OC4J instance on an application server,
    Tried all username, password, still invalid,
    I am using url as the following:
    env.put(Context.PROVIDER_URL, "ormi://hostname:12401/");
    Does the OC4J instance config affect the url, or url is only related with ip and port?
    Any idea? Thanks a lot.

    When you install OC4J 10.1.3 and run the command "java -jar %J2EE_HOME%\j2ee\home\oc4j.jar", the system will ask for password for the oc4jadmin user.
    I do not recall 10.1.2 version having this feature.
    If you were able to create new user in administrator group, make sure that orion-application.xml contains the following entries.
    <namespace-access>
              <read-access>
                   <namespace-resource root="">
                        <security-role-mapping name="&lt;jndi-user-role&gt;">
                             <group name="Administrator" />
                        </security-role-mapping>
                   </namespace-resource>
              </read-access>
              <write-access>
                   <namespace-resource root="">
                        <security-role-mapping name="&lt;jndi-user-role&gt;">
                             <group name="Administrator" />
                        </security-role-mapping>
                   </namespace-resource>
              </write-access>
         </namespace-access>
    This will allow RMI access to remote users.

  • EJB: Stateless Session Bean create() Question.

    Lets say I have a stateless session bean that fetches data from my database. The point of the bean is to just do large SQL searches and funnel data back to the client. The prolem I have is that I am somehow fighting memory leaks. Despite having checked the code a number of times, the memory usage on my appserver continues to climb no matter what I do. I have theorized that the problem might be in the way Im using ma DataFetchBean (DFB).
    When I start the client, he obtains a user session. This is a stateful session bean that he uses for almost all communication with the server. Then I call "getDataFetchBean" in the user session which calls DataFetchBeanHome.create(). Then the client holds onto the returned reference, using it for the live of his connection. As he disconnects, he calls remove on the bean.
    Question is this:
    1) Is it better for me to call create() prior to each call to the stateless session bean ?
    2) Do you have any theories on why im loosing memory with this setup?
    TIA
    -- Rob

    1. But I thought you were using a 'stateful session bean'?
    2. For stateless session beans, there is no direct link between a remote reference and an instance of the bean. It is safe to hang on to the remote reference as long as you would like, of course it may go stale if the server dies. You will also find that the create() method does not actually contact the server, so doing it each usage costs very little. So, either way you should be fine.
    3. As for memory leaks, make sure that you are closing all statements, result sets, etc. promptly. These are commonly the problem. Also, use hprof or some other profile tool to determine what types of data you are allocating and (with better tools) what types of data you may be holding on to references to.
    Chuck

  • Looking up a remote session bean javax.naming.NotContextException

    Hi,
    I am having trouble when looking up for a remote session bean from my ejb application. I am running jboss 4.0.4 with ejb3.0. I am trying to access a remote computer running jboss 4.0.4 but with 2.1 option. Following is my code
    Properties props = new Properties();     props.setProperty(Context.INITIAL_CONTEXT_FACTORY,"org.jboss.security.jndi.JndiLoginInitialContextFactory");
    props.setProperty(Context.SECURITY_PRINCIPAL, "admin");
    props.setProperty(Context.SECURITY_CREDENTIALS, "admin");
    props.setProperty(Context.PROVIDER_URL, "jnp://192.168.10.130:1099/");
    Context ctx = new InitialContext(props);     
    Object object = ctx.lookup( "ejb/com/blah/Manager/remote" );
              ManagerRemoteHome home = (ManagerRemoteHome)PortableRemoteObject.narrow ( object, ManagerRemoteHome.class);
              ManagerRemote manager = home.create();
    I get an exception at the following line
    ManagerRemoteHome home = (ManagerRemoteHome)PortableRemoteObject.narrow ( object, ManagerRemoteHome.class);
    2006-11-02 15:02:49,194 ERROR [STDERR] javax.naming.NotContextException
    2006-11-02 15:02:49,194 ERROR [STDERR]      at org.jnp.server.NamingServer.lookup(NamingServer.java:285)
    2006-11-02 15:02:49,194 ERROR [STDERR]      at org.jnp.server.NamingServer.lookup(NamingServer.java:270)
    2006-11-02 15:02:49,194 ERROR [STDERR]      at org.jnp.server.NamingServer.lookup(NamingServer.java:270)
    2006-11-02 15:02:49,194 ERROR [STDERR]      at org.jnp.server.NamingServer.lookup(NamingServer.java:270)
    2006-11-02 15:02:49,194 ERROR [STDERR]      at org.jnp.server.NamingServer.lookup(NamingServer.java:270)
    2006-11-02 15:02:49,194 ERROR [STDERR]      at org.jnp.server.NamingServer.lookup(NamingServer.java:270)
    2006-11-02 15:02:49,194 ERROR [STDERR]      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    Instead of deploying remotely on a different machine I deployed in on my instance of jboss and everything works ok.
    Message was edited by:
    fkzeljo

    Thanks for your reply,
    I tried deploying it under local instance of jboss. It worked. However when I add the following line
    props.setProperty(Context.PROVIDER_URL, host);
    even if host is set to
    String host = "jnp://localhost:1099";
    I started getting the following exception
    2006-11-03 10:17:18,319 ERROR [STDERR] java.lang.ClassCastException
    2006-11-03 10:17:18,319 ERROR [STDERR]      at com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:229)
    2006-11-03 10:17:18,319 ERROR [STDERR]      at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:137)
    As soon as I uncomment that line everything works fine.
    I have seen this type of exception before when I tried invoking the ejb on a different computer as well. I am not sure how to see what is the wrapper class for the object since the call to object.getClass().getName() prints something like this $Proxy184
    This is my code again:
    Properties props = new Properties();
    props.setProperty(Context.INITIAL_CONTEXT_FACTORY,"org.jboss.security.jndi.JndiLoginInitialContextFactory");
              props.setProperty(Context.SECURITY_PRINCIPAL, "admin");
              props.setProperty(Context.SECURITY_CREDENTIALS, "admin");
              props.put(javax.naming.Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
              String host = "jnp://localhost:1099";
              props.setProperty(Context.PROVIDER_URL, host);
    ctx = new InitialContext( props );
         Object object = ctx.lookup( "ejb/com/blah/Manager" );
              ManagerRemoteHome home = (ManagerRemoteHome)PortableRemoteObject.narrow ( object, ManagerRemoteHome.class);
              ManagerRemote manager = home.create();
    Thanks

  • Weblogic EJB 3 proxy & EJB 3 session bean interface

    Does the weblogic EJB 3 session bean proxies implement the bean interface ?
    I tried accessing the session bean from within a EJB 3 interceptor - InvocationContext.getTarget()
    But it looks like this returns a proxy (created by weblogic internally) that does not implement the bean interface.
    I'm unable to integrate Hibernate method validator as a result since the validator API expects the target to either be the actual bean implementation or at least a proxy
    that implements the bean interfaces. Can somebody please confirm ?
    I'm on weblogic 10.3
    thanks!

    You should be able to see the code we generate by running the weblogic.appc utility on your application, specifying the "-keepgenerated" option to keep the Java source files.
    -steve-

  • Minimal requirements for remote client app to call a EJB 3 session bean

    I'm just starting to get into EJBs, trying to learn the EJB 3 APIs. I kind of understand the setup on the server side to create a session bean. What I don't understand is what I would have to deploy for each of the remote client app (Swing-based GUI or something like that) installations. Of course, the client app code would have to be deployed to each client desktop, but what stuff related to the session bean? Just the session bean interface class?
    For ease of discussion, let's say my bean is CalculatorBean, having two interfaces, CalculatorRemoteIface and CalculatorLocalIface. Let's also say my client app, CalculatorUI, is a simple Swing-based GUI that grabs a reference to a CalculatorBean.
    Other than just the Swing-based classes and the JRE, what JARs/classes will I want to deploy to each desktop?
    (Please assume the latest Sun Java System App Server 9 and Java EE 5, if you are familiar with them.)

    Personally- I would deploy your backend
    in EJB 3.0, but then expose it as a web service. It
    is MUCH easier for your clients to connect to a web
    service (and mantain that code), then to have them
    connect via RMI/JNDI.Oh, I would say it's quite the opposite. RMI/JNDI is MUCH easier from a client point of view than web services. To make web services work easy from the client side you have to generate code and the tools that generate code from a web services wsdl file doesn't do a great job today. But that was not the question. But take some time reading this article about webservices...it's quite funny and spot on: http://wanderingbarque.com/nonintersecting/2006/11/15/the-s-stands-for-simple
    Now to your question, yes you will need the remote interface on the client side.
    /klejs

  • 2 local ejb and one remote session bean in same server - java client

    idea was -
    to create a new stateless session bean that will talk to the two entity beans. although the session bean will expose its method through a remote interface, the communication betweenn the session bean and the entity beans will be through a local interface. the assumptions is that all three ejbs are running in the same JVM.
    so -
    all three ejbs complied properly.
    but -
    when i tried to test with one 'sample test client' then this is the error i get.
    please please -
    can you look into the below error and let me know what possibly i'm doing wrong. i've been trying for last 4 days and can't figure out.
    thanks a lot.
    D:\jdev9052\jdk\bin\javaw.exe -ojvm -classpath D:\jdev9052\jdev\mywork\H&K\EJBApp\classes;D:\jdev9052\j2ee\home\lib\activation.jar;D:\jdev9052\j2ee\home\lib\ejb.jar;D:\jdev9052\j2ee\home\lib\jaas.jar;D:\jdev9052\j2ee\home\lib\jaxp.jar;D:\jdev9052\j2ee\home\lib\jcert.jar;D:\jdev9052\j2ee\home\lib\jdbc.jar;D:\jdev9052\j2ee\home\lib\jms.jar;D:\jdev9052\j2ee\home\lib\jndi.jar;D:\jdev9052\j2ee\home\lib\jnet.jar;D:\jdev9052\j2ee\home\lib\jsse.jar;D:\jdev9052\j2ee\home\lib\jta.jar;D:\jdev9052\j2ee\home\lib\mail.jar;D:\jdev9052\j2ee\home\lib\servlet.jar;D:\jdev9052\j2ee\home\oc4j.jar;D:\jdev9052\opmn\lib\optic.jar;D:\jdev9052\jdev\system9.0.5.2.1618\oc4j-config\.client;D:\jdev9052\lib\xmlparserv2.jar;D:\jdev9052\lib\xmlcomp.jar TeamStaffSessionEJBClient
    context initialized
    javax.naming.NamingException: Lookup error: java.net.ConnectException: Connection refused: connect; nested exception is:
         java.net.ConnectException: Connection refused: connect [Root exception is java.net.ConnectException: Connection refused: connect]
         at com.evermind.server.rmi.RMIContext.lookup(RMIContext.java:153)
         at javax.naming.InitialContext.lookup(InitialContext.java:347)
         at TeamStaffSessionEJBClient.main(TeamStaffSessionEJBClient.java:17)
    Caused by: java.net.ConnectException: Connection refused: connect
         at java.net.PlainSocketImpl.socketConnect(Native Method)
         at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
         at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
         at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
         at java.net.Socket.connect(Socket.java:452)
         at java.net.Socket.connect(Socket.java:402)
         at java.net.Socket.<init>(Socket.java:309)
         at java.net.Socket.<init>(Socket.java:153)
         at com.evermind.server.rmi.RMIConnection.connect(RMIConnection.java:2216)
         at com.evermind.server.rmi.RMIConnection.lookup(RMIConnection.java:1692)
         at com.evermind.server.rmi.RMIServer.lookup(RMIServer.java:678)
         at com.evermind.server.rmi.RMIContext.lookup(RMIContext.java:134)
         ... 2 more
    Process exited with exit code 0.

    After you drop an ejb into the designer, you'll see a <ejb>Client1 instance created for the ejb in the backing bean (i.e. Page1.java). The client instance is a wrapper for the ejb. It contains all the remote methods available on your ejb. In your web app, you can invoke any methods on the client instance as if you're calling methods on a regular java object. The wrapper class knows how to invoke the corresponding methods on the ejb for you.
    -dongmei

  • Example of using session bean with webservices

    Hello,
    I am working with netbeans 5.5 (with JAX-WS 2.0 library) and using Tomcat.
    I have created webservices and everything is working well so far. However, each webservice is making a connection to my database.
    I would like to use a session bean so that I make the connection only once (at the begining of the client session for example) and store it into my session bean.
    I am a newbie in those things, I search on the Web and on this forum some code examples. The only thing I have found is this article http://weblogs.java.net/blog/ramapulavarthi/archive/2006/06/maintaining_ses.html
    When I tried this, the session doesn't seem to work at all : I get the same result (counter=1) twice.
    Does anybody have a complete example of how to use a session with webservices please?
    Thanks a lot!

    Sorry, I was not very clear in my last message.
    I need all my webservices to share the same bean during one user session.
    Then, if a page calls 2 different web services, only 1 database connection is made instead of 2. And if the user opens other pages which call other webservices, they will use the connection kept into the session bean.
    Anyway, I tried to do like it is said in your website but I can not build my project. I have an error : java.lang.LinkageError: JAXB 2.0 API is being loaded from the bootstrap classloader, but this RI (from jar:file:/C:/.../build/web/WEB-INF/lib/jaxb-impl.jar!/com/sun/xml/bind/v2/model/impl/ModelBuilder.class) needs 2.1 API. Use the endorsed directory mechanism to place jaxb-api.jar in the bootstrap classloader. I do not understand because I have downloaded the jax-ws 2.1.1 api and no other libraries are imported in my project. :-(
    I wonder if it is not related to netbeans...

  • How to get access via RMI from a session bean to a remote session bean?

    I have 2 J2EE applications in two different Sun Application Servers (8.0 PE). I would like to get access from one Session Bean "SB1" into Application A to Session Bean "BrickFacade" within Application B.
    My Java Code from "SB1":
             Context ic = new InitialContext();
             Object o = ic.lookup("java:comp/env/ejb/BrickFacade");
             BrickFacadeHome brickFacadeHome2 = (BrickFacadeHome) PortableRemoteObject.narrow(o, BrickFacadeHome.class);
             brickFacade = brickFacadeHome2.create();
             Collection col = brickFacade.doSomething();
             ...I configured the remote App.server in sun-ejb-jar.xml. I found the syntax within documentation (http://docs.sun.com/source/817-6087/dgjndi.html#wp24622) but I'm not sure if I this is the right usage.
         <ejb-ref>
            <ejb-ref-name>ejb/BrickFacade</ejb-ref-name>
            <jndi-name>corbaname:iiop://161.90.176.213:3700#webclient/BrickFacade</jndi-name>
          </ejb-ref>The context lookup throws the exception:
    "IOP00110603: (BAD_PARAM) Bad host address in -ORBInitDef"
    and
    Invalid URL or IOR: corbaloc:iiop://161.90.176.213:3700
    javax.naming.ConfigurationException: Invalid URL or IOR: corbaloc:iiop://161.90.176.213:3700 [Root exception is org.omg.CORBA.BAD_PARAM:   vmcid: SUN  minor code: 603  completed: No]
    Could anyone help me? Many thanks!
    Stacktrace:
    "IOP00110603: (BAD_PARAM) Bad host address in -ORBInitDef"
    org.omg.CORBA.BAD_PARAM: vmcid: SUN minor code: 603 completed: No
         at com.sun.corba.ee.impl.logging.NamingSystemException.insBadAddress(NamingSystemException.java:148)
         at com.sun.corba.ee.impl.logging.NamingSystemException.insBadAddress(NamingSystemException.java:166)
         at com.sun.corba.ee.impl.naming.namingutil.CorbalocURL.badAddress(CorbalocURL.java:104)
         at com.sun.corba.ee.impl.naming.namingutil.CorbalocURL.handleColon(CorbalocURL.java:140)
         at com.sun.corba.ee.impl.naming.namingutil.CorbalocURL.handleIIOPColon(CorbalocURL.java:115)
         at com.sun.corba.ee.impl.naming.namingutil.CorbalocURL.<init>(CorbalocURL.java:67)
         at com.sun.corba.ee.impl.naming.namingutil.INSURLHandler.parseURL(INSURLHandler.java:41)
         at com.sun.corba.ee.impl.resolver.INSURLOperationImpl.operate(INSURLOperationImpl.java:103)
         at com.sun.corba.ee.impl.orb.ORBImpl.string_to_object(ORBImpl.java:774)
         at com.sun.jndi.cosnaming.CNCtx.setOrbAndRootContext(CNCtx.java:338)
         at com.sun.jndi.cosnaming.CNCtx.initUsingCorbanameUrl(CNCtx.java:321)
         at com.sun.jndi.cosnaming.CNCtx.initUsingUrl(CNCtx.java:247)
         at com.sun.jndi.cosnaming.CNCtx.createUsingURL(CNCtx.java:85)
         at com.sun.jndi.url.iiop.iiopURLContextFactory.getUsingURLIgnoreRest(iiopURLContextFactory.java:56)
         at com.sun.jndi.url.iiop.iiopURLContext.getRootURLContext(iiopURLContext.java:44)
         at com.sun.jndi.toolkit.url.GenericURLContext.lookup(GenericURLContext.java:182)
         at javax.naming.InitialContext.lookup(InitialContext.java:347)
         at com.sun.enterprise.naming.NamingManagerImpl.lookup(NamingManagerImpl.java:702)
         at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:108)
         at javax.naming.InitialContext.lookup(InitialContext.java:347)
         at de.emilberlinerstudios.va.ejb.testrh.sb.TestRemoteEjbBean.getBrickFacade(TestRemoteEjbBean.java:108)
         at de.emilberlinerstudios.va.ejb.testrh.sb.TestRemoteEjbBean.startTest(TestRemoteEjbBean.java:79)
         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:324)
         at com.sun.enterprise.security.SecurityUtil$2.run(SecurityUtil.java:146)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sun.enterprise.security.application.EJBSecurityManager.doAsPrivileged(EJBSecurityManager.java:930)
         at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:151)
         at com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInvocationHandler.java:128)
         at $Proxy7.startTest(Unknown Source)
         at de.emilberlinerstudios.va.ejb.testrh.sb._TestRemoteEjb_Stub.startTest(Unknown Source)
         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:324)
         at com.sun.forte4j.j2ee.ejbtest.webtest.InvocableMethod$MethodIM.invoke(InvocableMethod.java:231)
         at com.sun.forte4j.j2ee.ejbtest.webtest.EjbInvoker.getInvocationResults(EjbInvoker.java:96)
         at com.sun.forte4j.j2ee.ejbtest.webtest.DispatchHelper.getForward(DispatchHelper.java:189)
         at org.apache.jsp.dispatch_jsp._jspService(dispatch_jsp.java:75)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:102)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:861)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:282)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:263)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:210)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:861)
         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:324)
         at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:246)
         at java.security.AccessController.doPrivileged(Native Method)
         at javax.security.auth.Subject.doAsPrivileged(Subject.java:500)
         at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:268)
         at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:162)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:236)
         at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55)
         at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:145)
         at java.security.AccessController.doPrivileged(Native Method)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:141)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:109)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:522)
         at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:214)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:168)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:109)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:522)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:144)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:109)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:133)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
         at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:539)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
         at com.sun.enterprise.webservice.EjbWebServiceValve.invoke(EjbWebServiceValve.java:134)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
         at com.sun.enterprise.security.web.SingleSignOn.invoke(SingleSignOn.java:272)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
         at com.sun.enterprise.web.VirtualServerValve.invoke(VirtualServerValve.java:209)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:522)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:114)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:109)
         at com.sun.enterprise.web.VirtualServerMappingValve.invoke(VirtualServerMappingValve.java:166)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:522)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:936)
         at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:165)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:683)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:604)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:542)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:647)
         at java.lang.Thread.run(Thread.java:534)
    |#]
    [#|2006-10-02T13:52:55.390+0200|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.stream.out|_ThreadID=11;|2006-10-02 13:52:55 [8080-Processor4] INFO .va.ejb.testrh.sb.TestRemoteEjbBean - RemoteException when getting BrickFacade. Message:Invalid URL or IOR: corbaloc:iiop://161.90.176.213:3700
    javax.naming.ConfigurationException: Invalid URL or IOR: corbaloc:iiop://161.90.176.213:3700 [Root exception is org.omg.CORBA.BAD_PARAM:   vmcid: SUN  minor code: 603  completed: No]
         at com.sun.jndi.cosnaming.CNCtx.setOrbAndRootContext(CNCtx.java:367)
         at com.sun.jndi.cosnaming.CNCtx.initUsingCorbanameUrl(CNCtx.java:321)
         at com.sun.jndi.cosnaming.CNCtx.initUsingUrl(CNCtx.java:247)
         at com.sun.jndi.cosnaming.CNCtx.createUsingURL(CNCtx.java:85)
         at com.sun.jndi.url.iiop.iiopURLContextFactory.getUsingURLIgnoreRest(iiopURLContextFactory.java:56)
         at com.sun.jndi.url.iiop.iiopURLContext.getRootURLContext(iiopURLContext.java:44)
         at com.sun.jndi.toolkit.url.GenericURLContext.lookup(GenericURLContext.java:182)
         at javax.naming.InitialContext.lookup(InitialContext.java:347)
         at com.sun.enterprise.naming.NamingManagerImpl.lookup(NamingManagerImpl.java:702)
         at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:108)
         at javax.naming.InitialContext.lookup(InitialContext.java:347)
         at de.emilberlinerstudios.va.ejb.testrh.sb.TestRemoteEjbBean.getBrickFacade(TestRemoteEjbBean.java:108)
         at de.emilberlinerstudios.va.ejb.testrh.sb.TestRemoteEjbBean.startTest(TestRemoteEjbBean.java:79)
         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:324)
         at com.sun.enterprise.security.SecurityUtil$2.run(SecurityUtil.java:146)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sun.enterprise.security.application.EJBSecurityManager.doAsPrivileged(EJBSecurityManager.java:930)
         at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:151)
         at com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInvocationHandler.java:128)
         at $Proxy7.startTest(Unknown Source)
         at de.emilberlinerstudios.va.ejb.testrh.sb._TestRemoteEjb_Stub.startTest(Unknown Source)
         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:324)
         at com.sun.forte4j.j2ee.ejbtest.webtest.InvocableMethod$MethodIM.invoke(InvocableMethod.java:231)
         at com.sun.forte4j.j2ee.ejbtest.webtest.EjbInvoker.getInvocationResults(EjbInvoker.java:96)
         at com.sun.forte4j.j2ee.ejbtest.webtest.DispatchHelper.getForward(DispatchHelper.java:189)
         at org.apache.jsp.dispatch_jsp._jspService(dispatch_jsp.java:75)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:102)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:861)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:282)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:263)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:210)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:861)
         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:324)
         at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:246)
         at java.security.AccessController.doPrivileged(Native Method)
         at javax.security.auth.Subject.doAsPrivileged(Subject.java:500)
         at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:268)
         at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:162)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:236)
         at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55)
         at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:145)
         at java.security.AccessController.doPrivileged(Native Method)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:141)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:109)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:522)
         at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:214)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:168)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:109)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:522)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:144)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:109)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:133)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
         at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:539)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
         at com.sun.enterprise.webservice.EjbWebServiceValve.invoke(EjbWebServiceValve.java:134)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
         at com.sun.enterprise.security.web.SingleSignOn.invoke(SingleSignOn.java:272)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
         at com.sun.enterprise.web.VirtualServerValve.invoke(VirtualServerValve.java:209)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:522)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:114)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:109)
         at com.sun.enterprise.web.VirtualServerMappingValve.invoke(VirtualServerMappingValve.java:166)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:522)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:936)
         at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:165)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:683)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:604)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:542)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:647)
         at java.lang.Thread.run(Thread.java:534)
    Caused by: org.omg.CORBA.BAD_PARAM: vmcid: SUN minor code: 603 completed: No
         at com.sun.corba.ee.impl.logging.NamingSystemException.insBadAddress(NamingSystemException.java:148)
         at com.sun.corba.ee.impl.logging.NamingSystemException.insBadAddress(NamingSystemException.java:166)
         at com.sun.corba.ee.impl.naming.namingutil.CorbalocURL.badAddress(CorbalocURL.java:104)
         at com.sun.corba.ee.impl.naming.namingutil.CorbalocURL.handleColon(CorbalocURL.java:140)
         at com.sun.corba.ee.impl.naming.namingutil.CorbalocURL.handleIIOPColon(CorbalocURL.java:115)
         at com.sun.corba.ee.impl.naming.namingutil.CorbalocURL.<init>(CorbalocURL.java:67)
         at com.sun.corba.ee.impl.naming.namingutil.INSURLHandler.parseURL(INSURLHandler.java:41)
         at com.sun.corba.ee.impl.resolver.INSURLOperationImpl.operate(INSURLOperationImpl.java:103)
         at com.sun.corba.ee.impl.orb.ORBImpl.string_to_object(ORBImpl.java:774)
         at com.sun.jndi.cosnaming.CNCtx.setOrbAndRootContext(CNCtx.j|#]

    Problem solved:
    configuration in jndi-name was wrong:
    <jndi-name>corbaname:iiop:161.90.176.213:3700#ejb/BrickFacade</jndi-name>

  • Help needed in EJB - to call AS from EJB a Session Bean

    Hi All ,
    I have been strictly told not to use Web Services as all the applications are on the same server
    actually I have to make an EJB invocation to an Application Service from the CAF layer from a Session Bean of another EJB Project(Not a CAF Service).
    the CAF layer has 5 parts metadata , permissions , dictionary , ear and ejbmodule.
    I added the ejbModule to the Build Path of the calling EJB Session Bean. And so I was able to access the operations of the Application Service which in turn accesses a BAPI(The Appl Service operation returns a String).
    But while executing I got the exception java.lang.RuntimeException: java.lang.NoClassDefFoundError
    My method :
    Normally from a Dynamic Web Project acting as a client to an EJB Session bean, I was able to get access to EJB Local Interface by using
      private ConverterLocal converterBean = null;
      public void jspInit() {
        try {
         InitialContext ic = new InitialContext();
         converterBean = (ConverterLocal)
         ic.lookup("java:comp/env/Converter");
        } catch (Exception ex) {
             System.out.println("Couldn't create converter bean."+
           ex.getMessage());
    BigDecimal dollarAmount =  converterBean.euroToDollar(value);
    So I created a JNDI field in ejb-j2ee-engine.xml
    enterprise-beans>
            <enterprise-bean>
         <ejb-name>com.sap*******.bapi_company_getlist.BAPI_COMPANY_GETLIST</ejb-name>
                   <jndi-name>COMPANY</jndi-name>
                </enterprise-bean>
    </enterprise-beans>
    And from my Session Bean , I tried to access it using the code in already existing Bean which was working fine
    BAPI_COMPANY_GETLISTBeanImpl bean = new BAPI_COMPANY_GETLISTBeanImpl();
              try {
                   InitialContext ctx = new InitialContext();
                   bean = (BAPI_COMPANY_GETLISTBeanImpl)ctx.lookup("COMPANY");
              } catch (NamingException e) {
                   System.out.println("Converter Bean can't be created");
                   String send = bean.returnDetails();
    And I tried to print the String , but I got the above error
    I have a doubt :
    1) How do I specify the JNDI name ie in the ejb-j2ee-engine.xml file , what should I add as the name of the ejb
    is this sufficient , or are there more steps ??

    Hi Ekaterina,
    I have the document to access my Bean from another Bean.
    I could access my Bean from a standalone Java class with this code
    Properties props = new Properties();
              props.put(Context.INITIAL_CONTEXT_FACTORY,"com.sap.engine.services.jndi.InitialContextFactoryImpl");
              props.put(Context.PROVIDER_URL,"hostname:port");
              try{
                   Context ctx = new InitialContext(props);
                   Object o = ctx.lookup("sap.com/TestEAR/REMOTE/TestBean/com.@#$.TestRemote");
                   TestRemote testRem = (TestRemote)javax.rmi.PortableRemoteObject.narrow(o, TestRemote.class);
                   String msg = testRem.getMessage();
                   System.out.println(msg);
    And in this document there is a way shown to access a bean from another Bean.
       http://help.sap.com/saphelp_nw04/helpdata/en/13/c8633e0084e946e10000000a114084/frameset.htm
    If your client is another enterprise bean, declare the EJB reference in the ejb-jar.xml.
    -For more information, see Declaring EJB References.
    But the problem is that in EJB 3.0 ,  I can't see the ejb-jar.xml file .
    So how should I have a Bean as a client to another Bean, I am not that familiar with Annotations.

  • How to cast back and use a retrieved Session Bean reference in a servlet?

    Please help!
    1. I invoke a Session Bean from a servlet :
    travelagent = home.create();
    2. I store the travelagent reference in the HTTP Session :
    session.setAttribute( "travelagent" , travelagent );------------------------------------------------------------------------------------------------------------------
    Now, in another servlet, I have to retrieve the reference to the EJB from the HTTPSession.
    I then have to use this reference to call a business method in the EJB Session Bean.
    I have tried two ways to retrieve the reference and cast it before calling the business method. I get errors in both forms of casting.
    The Values you will see below in the code:
    EJB Remote Interface : TravelAgent (TravelAgent.java)
    Business Method : listItineraries( )
    Servlet which calls the above method : ListItinerary.java
    Line 46 of ListItinerary.java : ArrayList itineraries = traveler.listItineraries();------------------------------------------------------------------------------------------------------------------
    The two ways along with the error I get on the servlet page in the browser are :
    (A)
    TravelAgent traveler = (TravelAgent)session.getAttribute("travelagent");The error I get is :
    java.rmi.NoSuchObjectException: CORBA OBJECT_NOT_EXIST 9998 Maybe; nested exception is:
         org.omg.CORBA.OBJECT_NOT_EXIST: vmcid: 0x2000 minor code: 1806 completed: Maybe
    com.sun.corba.ee.impl.javax.rmi.CORBA.Util.mapSystemException(Util.java:208)
         com.sun.corba.ee.impl.javax.rmi.CORBA.Util.wrapException(Util.java:591)
         javax.rmi.CORBA.Util.wrapException(Util.java:277)
         source.traveler.ejb._TravelAgent_Stub.listItineraries(Unknown Source)
         source.traveler.servlet.ListItinerary.processRequest(ListItinerary.java:46)
    (B)
    TravelAgent traveler  =
    (TravelAgent)PortableRemoteObject.narrow(session.getAttribute("travelagent"), TravelAgent.class);The error I get is :
    java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
         java.rmi.RemoteException
         com.sun.corba.ee.impl.javax.rmi.CORBA.Util.wrapException(Util.java:597)
         javax.rmi.CORBA.Util.wrapException(Util.java:277)
         source.traveler.ejb._TravelAgent_Stub.listItineraries(Unknown Source)
         source.traveler.servlet.ListItinerary.processRequest(ListItinerary.java:46)
    Could someone advice on how to retrieve and cast the EJBObject's reference from the servlet so that I may use it to call the business method?
    Thanks!

    Thanks guys! It worked.
    1.. I should have used the handle. Got to coding without going deep in the concepts.
    2.. I dont know if I could have used the EJB Reference directly (instead of the handle).
    3.. The error was due to me not mapping the servlets with the EJBs that they could use. I continued to get the same error even after using the handle. Once I put the mapping to the EJBs correctly, everything fell in place.
    Thanks a lot!
    Henry

  • Newbie: How do i use a stateless session bean in a backing bean?

    I have a stateless session bean with a function 'getVoterList()'; how do i instantiate the bean and use it in from my managed bean?
    I dont want to use seam; coz the stateless serrion bean/EJB is written by another developer and we cant updat eit now to use seam..
    any tutorials? walk thrus or sample code?
    thanks
    illi

    I used a different method...
    I used servicegen with only a.jar to create the ear.
    I touch-ed my own application.xml to make it newer than the one already in the
    newly created ear.
    I used the ant <ear> task to add b.jar, c.jar, and application.xml to the ear.
    Worked like a charm.
    Mike
    Bruce Stephens <[email protected]> wrote:
    Hello,
    See if Neal's answer here helps solve your problem using servicegen's
    service element "IncludeEJBs" attribute:
    http://newsgroups.bea.com/cgi-bin/dnewsweb?cmd=article&group=weblogic.developer.interest.webservices&item=2932&utag=
    HTHs,
    Bruce
    kk wrote:
    This is my situation.
    I have an .ear file and in that i have several other .jar files whichare
    inter-dependant, lets say
    A.jar
    B.jar
    C.jar files
    and i want to expose only A.jar as
    webservice, how can i do that ?
    Does WLS8.1 provided any way how to do that?
    I Appreciate any suggestions and advices.
    Thanks
    kk

Maybe you are looking for

  • Templates with Flash don't work

    Hello, I have several pages with templates, but with the new Flash player, the swf that are included in the templates don't work, they do'nt appear in the webpage. Any help please!!

  • File to Idoc - Outbound Error

    Hi,    I am doing File to IDOC scenario. I got error in "Message has error status at outbound status" .. When I opend that messeage then i got this ... <SAP:IDOCTYP>ZIDOCIN</SAP:IDOCTYP>   <SAP:CIMTYP />   <SAP:MESTYP>ZMTIDOCIN</SAP:MESTYP>   <SAP:ME

  • Oracle Spatial & Fusion MiddleWare MapViewer at Oracle OpenWorld

    If you happen to be attended OOW next week you will see a very large presence for our products. hands on labs, sessions, demos ... Look for us at Business Intelligence,Oracle Utilities, DigitalGlobe, Navteq, KPI Partners, and GE. Hope to meet some of

  • Ovi store download error

    i get an error in red everytime i want to download from ovi store an application for my N8... how can i fix this??? thank you

  • Why can't I use TimeMachine with Apple TV?

    I'm sure this has been asked many times before, so forgive me, however, given that i'm happy to not use all of the HD capacity on my A-TV for other media, is there some way to make this work as a TimeMachine destination? I has the right hardware, cor