Accessing XI Repository Beans

Hi,
I'm going to query some of the Session stateless beans from XI like sap.com/com.sap.xi.directory/DirQueryServiceBean.
This gives an object of com.sap.aii.ib.sbeans.query.QueryServiceHome_Stub. I can only cast this object to a QueryServiceHome object, which has a create method. The create method on QueryServiceHome return a  remote object.
Context ctx = new InitialContext(env);
// Look up an object
Object obj = ctx.lookup(name);
// Print it
out.println(name + " is bound to: " + obj + " type " + obj.getClass());
QueryServiceHome home= (QueryServiceHome) obj;
out.println("-home found-");
QueryServiceHome_Stub stub = (QueryServiceHome_Stub)home.create();
I get -home found- printed, but the I get at ClassCastException.
Does any body have an answert to how I can get access to the bean and query it for information.

Hi Daniel,
In general, when you want to use some application, at least you must have the classes that you access in your client's classpath. That is how it works. Otherwise, can you explain me how you have access to the QueryServiceHome interface but not to the QueryService interface?
In particular in your case you must find the application "com.sap.xi.directory" and include its jars in your client's classpath. Then proceed as already described.
Best regards,
Vladimir

Similar Messages

  • Error while trying to access a Repository Item thru ACC

    Hi,
    I was trying to access a Repository Item from ACC , I am getting this following error :
    Error reading list or array index from the database. This means the database table holding this property does not have sequential integers starting with 0 in its multi-column. This should only happen if the database table was modified directly (outside of Dynamo).
    java.lang.Exception
      at atg.adapter.gsa.ListTable.loadHelper(ListTable.java:190)
      at atg.adapter.gsa.ListTable.loadProperties(ListTable.java:97)
      at atg.adapter.gsa.GSAItemDescriptor.loadProperties(GSAItemDescriptor.java:5874)
      at atg.adapter.gsa.GSAItemDescriptor.loadProperty(GSAItemDescriptor.java:5986)
      at atg.adapter.gsa.GSAItem.getPersistentPropertyValue(GSAItem.java:1339)
      at atg.adapter.gsa.GSAItem.getPropertyValue(GSAItem.java:1232)
      at atg.adapter.gsa.GSAItem.getPropertyValue(GSAItem.java:1510)
      at atg.repository.RepositoryItemImpl.getPropertyValue(RepositoryItemImpl.java:151)
      at atg.repository.nucleus.RepositoryItemPropertyMapper.getPropertyValue(RepositoryItemPropertyMapper.java:151)
      at atg.beans.DynamicBeans.getPropertyValue(DynamicBeans.java:333)
      at atg.beans.DynamicBeanState.initializeFrom(DynamicBeanState.java:152)
      at atg.beans.DynamicBeanState.<init>(DynamicBeanState.java:122)
      at atg.ui.repository.model.RepositoryItemState.<init>(RepositoryItemState.java:428)
      at atg.ui.repository.model.RepositoryAgentImpl.createRepositoryItemState(RepositoryAgentImpl.java:2934)
      at atg.ui.repository.model.RepositoryAgentImpl.getRepositoryItem(RepositoryAgentImpl.java:3901)
      at atg.ui.repository.model.RepositoryAgentImpl.getRepositoryItem(RepositoryAgentImpl.java:1225)
      at atg.ui.repository.model.RepositoryAgentImpl.getCompressedRepositoryItem(RepositoryAgentImpl.java:1251)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at atg.security.proxy.UserSessionProxy$SessionSkeletonHandler.invoke(UserSessionProxy.java:273)
      at atg.rmi.context.ContextualSkeletonImpl.invoke(ContextualSkeletonImpl.java:127)
      at sun.reflect.GeneratedMethodAccessor401.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:303)
      at sun.rmi.transport.Transport$1.run(Transport.java:159)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
      at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
      at java.lang.Thread.run(Thread.java:662)

    Got corrected with changing data-type for a property in the definition file.

  • How to set the user who can access to repository

    Hi,
    I know we can create user and group in the tools->security.And if this users is belong to Administrators Group, it can access to RPD and do some modify..
    Can we create group or user who can access RPD in some situation(like mentioned in HELP, A can access to repository on Mondays and Wednesdays, B can access to repository on Saturdays and Sundays) and how to set the privilege..
    Thanks
    anne

    Hi Anne,
    The example specified in Help is about restricting query execution on weekdays/weekends for a particular webgroup. Inorder to configure such access ,
    Double click on the web group name -> Query Limits tab ->Click on Restrict button provided against the physical connection pool ->Select Allow/Disallow by selecting a particular time period.
    Rgds,
    Dpka

  • Accessing Managed Session Bean in Servlet Filter

    I wrote a Servlet Filter to handle user authentication. Now I'm trying to access my Managed Session Bean in the filter in order to save the current user. Unfortunately the Session Bean is created after the Filter executes for the first time.
    I'm trying to access the Session Bean in this way:
    (SessionBean) FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get("sessionBean");
    In this case getExternalContext() is equals null.
    Is there any way to create the Session bean before the filter executes or any other ideas how to handle this?
    I already searched around the internet but couldnt figure out something.
    Thanks guys,
    Paul

    Ok, fixed it like this. Works perfect. JSF finds and uses the handmade Session Bean as well.
    if(request.getSession().getAttribute(BeanNames.SESSION_SCOPE_BEAN) == null) {
         SessionBean sessionBean = new SessionBean();
         request.getSession().setAttribute(BeanNames.SESSION_SCOPE_BEAN, sessionBean);
    }Thanks,
    Paul

  • ADF BC how to access session backing bean value in servlet

    Hi everyone,
    How do I access session backing bean value in a servlet?

    Frank, thanks for your reply.
    I'm not sure how I can incorporate this example into my situation. Let me explain more detail about my problem.
    "servlet" in my post here actually means a custom servlet I wrote for rendering an image that is stored in db as ordimage. In this servlet, I get hold of my appmodule by using Configuation.createRootApplicationModule(). By doing so (If I'm not wrong) a new database session/connection is created. What I'm going to achieve is set application context for this new session/connection in db with the data stored in a session backing bean in the view layer.
    I can pass the required data to the servlet thru url parameter, but I don't want to do it this way for the reason that the data may contains sensitive information.
    I hope I have explained myself well.
    Message was edited by:
    bsmt

  • Access of JSF Beans from Servlet Filter

    Is there any way how can I access session JSF beans from servlet filter?
    I need to check certain value of JSF bean stored in session scope in my filter.
    Thanks
    ferdo

    Frank,
    I am not sure about phase listener, this is the whole situation:
    as I am not using Container Managed Security with my JSF, after I do sucessfull login into application, I need to store some information into the session scope (user etc) and in the servlet filter I need to find out if the user is connected.
    I was trying to put such info into Servlet Session directly in my bean via External Context and reading the info in Filter.
    This is working fine when my application is running locally (jdev oc4j) but once deployed into Application server, when user login first time, user information is somehow removed from the session, and cannot figure out why.
    So I was thinking to try another approach, to find out from servlet filter if JSF bean value is set or not.
    Any other suggestions? Do not want to swicth to Container Manages Security now.
    ferdo
    null

  • Web-Service Proxy and Web-Service Client access in a Bean (EJB 3.0)

    Hello Community,
    i want to access the SAP Knowledge-Management via the Webservice "RepositoryFrameworkWS", which resides on our Portal-System, from my Java-Application, which runs on a NW CE 7.11 Ehp1 Java Server.
    I choosed to create a WS-Client as a deployable client. So i created an Bean Project, imported the WSDL and created a WS-Proxy in that project. Additionaly i added some beans to that Bean-Project which use the WS-Proxy to access the KM.
    So far so good.
    But the WSDL also creates a Service-Endpoint, which already has an url for the WS-Target and Authentication-Information (in my case it seems that no Authentication is active) in its body.
    Because my client shell run on different systems in the future i searched for a way to easiliy deploy my application and adapt target-information elsewhere. I found in the documentation, that after deploying the deployable WS-Proxy/Client this can be done in the NW-Administrator under SOA-Management->Application and Scenario Communication->Single Service Administration.
    To my surprise i found my deployed WS there. And the entry for the there listed Port was configurable. But unfortunatly this customization is ignored by the application. For example i changed authentication to a HTTP-Authentication with a specific user and also changed to Target-URL. But with no success.
    What's wrong here?
    i accessed the WS in my bean in the following way:
        public Class xyz
         @WebServiceRef (name="RepositoryFrameworkWS")
         RepositoryFrameworkWS service;
          RepositoryFrameworkWSViDocument vi = service.getPort(RepositoryFrameworkWSViDocument.class);
         vi.findResources(rid,....)
    regards
    Matthias Hayk
    Edited by: Matthias Hayk on Sep 15, 2009 10:13 AM

    Hi Matthias
    In Single Service Administration there are two views: Webservices and WS Clients configurations. First of all you should enable BASIC HTTP authentication in WS configuration. Then go to WS Client configuration and enter user/password in HTTP BASIC authentication settings.
    Hope this help.
    BR, Siarhei

  • Problem accessing a session bean running on a different port

    Hi,
    I am using weblogic7.0 as the application server. I craeted two EJB's and
    deployed them in two ports, port 7001 and 7378. I can access the beans when I
    deploy them in the same port. But, I am having problem when EJB1 'server1' accesses
    EJB2 'server2' deployed in port 7378. Below is the code I am using to lookup the
    bean.
    Properties prop = new Properties();
    prop.put(Context.INITIAL_CONTEXT_FACTORY,
    "weblogic.jndi.WLInitialContextFactory");
    prop.put(Context.PROVIDER_URL, "t3://localhost:7378");
    Context ctx = new InitialContext(prop);
    Object objref = ctx.lookup("java:comp/env/server2");
    System.out.println("Inside the Object method "+objref);
    iHome = (server2.InsertHome) objref;
    System.out.println("Inside the iHome method "+iHome);
    mInsert=iHome.create();
    I am getting the following exception when I run the client. Can any one plaes
    help me with the problem I am facing.
    Thanks,
    Ramya.
    java.rmi.RemoteException: EJB Exception: ; nested exception is:
    java.lang.NullPointerException
    Start server side stack trace:
    java.rmi.RemoteException: EJB Exception: ; nested exception is:
    java.lang.NullPointerException
    java.lang.NullPointerException
    at server1.ConnectBean.insertName(ConnectBean.java:133)
    at server1.ConnectBean_wtb7ta_EOImpl.insertName(ConnectBean_wtb7ta_EOIm
    pl.java:45)
    at server1.ConnectBean_wtb7ta_EOImpl_WLSkel.invoke(Unknown Source)
    at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:362)
    at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServer
    Ref.java:114)
    at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:313)
    at weblogic.security.service.SecurityServiceManager.runAs(SecurityServi
    ceManager.java:785)
    at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.ja
    va:308)
    at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteReques
    t.java:30)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:153)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:134)
    End server side stack trace
    ; nested exception is:
    java.lang.NullPointerException:
    Start server side stack trace:
    java.lang.NullPointerException
    at server1.ConnectBean.insertName(ConnectBean.java:133)
    at server1.ConnectBean_wtb7ta_EOImpl.insertName(ConnectBean_wtb7ta_EOIm
    pl.java:45)
    at server1.ConnectBean_wtb7ta_EOImpl_WLSkel.invoke(Unknown Source)
    at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:362)
    at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServer
    Ref.java:114)
    at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:313)
    at weblogic.security.service.SecurityServiceManager.runAs(SecurityServi
    ceManager.java:785)
    at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.ja
    va:308)
    at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteReques
    t.java:30)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:153)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:134)
    End server side stack trace
    at weblogic.rmi.internal.BasicOutboundRequest.sendReceive(BasicOutbound
    Request.java:109)
    at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemote
    Ref.java:262)
    at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemote
    Ref.java:229)
    at server1.ConnectBean_wtb7ta_EOImpl_WLStub.insertName(Unknown Source)
    at server1.Client.example(Client.java:156)
    at server1.Client.main(Client.java:168)
    Caused by: java.lang.NullPointerException:
    Start server side stack trace:
    java.lang.NullPointerException
    at server1.ConnectBean.insertName(ConnectBean.java:133)
    at server1.ConnectBean_wtb7ta_EOImpl.insertName(ConnectBean_wtb7ta_EOIm
    pl.java:45)
    at server1.ConnectBean_wtb7ta_EOImpl_WLSkel.invoke(Unknown Source)
    at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:362)
    at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServer
    Ref.java:114)
    at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:313)
    at weblogic.security.service.SecurityServiceManager.runAs(SecurityServi
    ceManager.java:785)
    at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.ja
    va:308)
    at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteReques
    t.java:30)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:153)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:134)
    End server side stack trace

    So it looks like mInsert is null causing the NPE. I think you'll have
    to debug this one.
    -- Rob
    Ramya wrote:
    Hi Rob,
    Thanks for your relpy. Below is the method which calls methods from the EJB2.
    public void insertName(String name) throws Exception {
    Connection con = null;
    String name2="raj";
    int num=30;
    PreparedStatement ps = null;
    CallableStatement cs=null;
    String fName=null;
    try {
    System.out.println("In the insertName() before calling this.lookup()");
    this.lookUp();
    System.out.println("In the insertName() after calling this.lookup()");
    con=mInsert.getConnection();
    System.out.println("Inside the InsertName() in connectbean the value
    of connect is"+con);
    ps = con.prepareStatement("Insert into My_info values (?,?,?) ");
    ps.setString(1, name);
    ps.setString(2, "RamyaRAJ");
    ps.setInt(3,30);
    if (!(ps.executeUpdate() > 0)) {
    String error = "insertName: MyInfoBean (" + fName + ") not updated";
    throw new NoSuchEntityException (error);
    else{
    System.out.println("After calling execute upadte");
    } catch(Exception e) {
    System.out.println("There is an SQL insert exception in insertName()
    method");
    e.printStackTrace();
    throw new EJBException (e);
    } finally {
    mInsert.cleanup(con, ps);//LINE NO 133
    Line 133 (mInsert.cleanup(con, ps);) is the call to close up the SQL connection
    that is from EJB2. mInsert is the member variable of the Remote class from EJB2.
    Thanks,
    Ramya.
    Rob Woollen <[email protected]> wrote:
    That looks like a NullPointerException in your code. You'd have to show
    us line 133 of ConnectBean if you need help debugging it.
    -- Rob
    Ramya wrote:
    Hi,
    I am using weblogic7.0 as the application server. I craeted twoEJB's and
    deployed them in two ports, port 7001 and 7378. I can access the beanswhen I
    deploy them in the same port. But, I am having problem when EJB1 'server1'accesses
    EJB2 'server2' deployed in port 7378. Below is the code I am usingto lookup the
    bean.
    Properties prop = new Properties();
    prop.put(Context.INITIAL_CONTEXT_FACTORY,
    "weblogic.jndi.WLInitialContextFactory");
    prop.put(Context.PROVIDER_URL, "t3://localhost:7378");
    Context ctx = new InitialContext(prop);
    Object objref = ctx.lookup("java:comp/env/server2");
    System.out.println("Inside the Object method "+objref);
    iHome = (server2.InsertHome) objref;
    System.out.println("Inside the iHome method "+iHome);
    mInsert=iHome.create();
    I am getting the following exception when I run the client. Can anyone plaes
    help me with the problem I am facing.
    Thanks,
    Ramya.
    java.rmi.RemoteException: EJB Exception: ; nested exception is:
    java.lang.NullPointerException
    Start server side stack trace:
    java.rmi.RemoteException: EJB Exception: ; nested exception is:
    java.lang.NullPointerException
    java.lang.NullPointerException
    at server1.ConnectBean.insertName(ConnectBean.java:133)
    at server1.ConnectBean_wtb7ta_EOImpl.insertName(ConnectBean_wtb7ta_EOIm
    pl.java:45)
    at server1.ConnectBean_wtb7ta_EOImpl_WLSkel.invoke(UnknownSource)
    at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:362)
    at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServer
    Ref.java:114)
    at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:313)
    at weblogic.security.service.SecurityServiceManager.runAs(SecurityServi
    ceManager.java:785)
    at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.ja
    va:308)
    at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteReques
    t.java:30)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:153)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:134)
    End server side stack trace
    ; nested exception is:
    java.lang.NullPointerException:
    Start server side stack trace:
    java.lang.NullPointerException
    at server1.ConnectBean.insertName(ConnectBean.java:133)
    at server1.ConnectBean_wtb7ta_EOImpl.insertName(ConnectBean_wtb7ta_EOIm
    pl.java:45)
    at server1.ConnectBean_wtb7ta_EOImpl_WLSkel.invoke(UnknownSource)
    at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:362)
    at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServer
    Ref.java:114)
    at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:313)
    at weblogic.security.service.SecurityServiceManager.runAs(SecurityServi
    ceManager.java:785)
    at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.ja
    va:308)
    at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteReques
    t.java:30)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:153)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:134)
    End server side stack trace
    at weblogic.rmi.internal.BasicOutboundRequest.sendReceive(BasicOutbound
    Request.java:109)
    at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemote
    Ref.java:262)
    at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemote
    Ref.java:229)
    at server1.ConnectBean_wtb7ta_EOImpl_WLStub.insertName(UnknownSource)
    at server1.Client.example(Client.java:156)
    at server1.Client.main(Client.java:168)
    Caused by: java.lang.NullPointerException:
    Start server side stack trace:
    java.lang.NullPointerException
    at server1.ConnectBean.insertName(ConnectBean.java:133)
    at server1.ConnectBean_wtb7ta_EOImpl.insertName(ConnectBean_wtb7ta_EOIm
    pl.java:45)
    at server1.ConnectBean_wtb7ta_EOImpl_WLSkel.invoke(UnknownSource)
    at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:362)
    at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServer
    Ref.java:114)
    at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:313)
    at weblogic.security.service.SecurityServiceManager.runAs(SecurityServi
    ceManager.java:785)
    at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.ja
    va:308)
    at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteReques
    t.java:30)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:153)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:134)
    End server side stack trace

  • Client Program accessing J2EE entity Bean

    I have trouble find my Course J2EE bean from a client. (The client
    runs on the same computer but a different VM from the bean.)
    In Glassfish (Sun Application Server Nine), I set up a simple
    Container-Managed Entity Bean. I tried to access it from an external
    client as described in the glassfish EJB
    FAQ https://glassfish.dev.java.net/javaee5/ejb/EJB-FAQ.html
    Here is the client program:
    package RS;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import javax.xml.parsers.*;
    import org.apache.xml.serialize.*;
    import org.w3c.dom.*;
    import org.xml.sax.*;
    import RS.CourseHome;
    import RS.CoursePK;
    import javax.naming.InitialContext;
    import javax.naming.Context;
    import javax.naming.NamingException;
    import java.rmi.RemoteException;
    import javax.rmi.*;
    import java.util.Properties;
    import Debug.*;
    public class Client {
    public static void main (String arg[]) throws IOException {
    try {
    InitialContext jndiContext = new InitialContext ();
    Debug.P("jndic ongtext" + jndiContext);
    Object o = jndiContext.lookup("RS.CourseHome");
    Debug.P("looked up object "+o + "|"+o.getClass().getName());
    RS.CourseHome home =
        (RS.CourseHome)PortableRemoteObject.narrow(o,RS.CourseHome.class);
    Debug.P("got home "+home);
    Course C = home.create(1);
    C.setName("blah");
    CoursePK PK = new CoursePK();
    PK.number=1;
    C = home.findByPrimaryKey(PK);
    Debug.P(C.getName());
    catch (java.rmi.RemoteException re) {Debug.P("Remote Exception" + re.getMessage());}
    catch (javax.naming.NamingException ne){Debug.P("Naming Exception"+ne.getMessage());}
    catch (javax.ejb.CreateException ce){Debug.P("Create Exception"+ce.getMessage());}
    catch (javax.ejb.FinderException fe){Debug.P("Finder Exception"+fe.getMessage());}
    }Here is the error message:
    Exception in thread "main" java.lang.ClassCastException
    at com.sun.corba.ee.impl.javax.rmi.PortableRemoteObject.narrow
                       (PortableRemoteObject.java:294)
      at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:137)
      at RS.Client.main(Client.java:26)The debugging indicates that I got the Initial Context
    and got the object but the PortableObject.narrow failed:
    jndic ongtextjavax.naming.InitialContext@1d85f79
    looked up object IOR: (huge number deleted)
    com.sun.corba.ee.impl.corba.CORBAObjectImplEarlier, I tried the version below, but based on the suggestion by Mr. Ebbert
    in the forum started "Error When running the Client Program" by sree_devi,
    I checked
    the following. I went to "Jndi Tree Browsing" from the Administrative Console
    and I found a "RS.CourseHome" entry under "ejb" I found RS.CourseHome there
    but did not see the "Course" tghat I expected to see
    Thus, I tried the version above:
    package RS;
       --- imports deleted for conciseness
    import Debug.*;
    public class Client {
    public static void main (String arg[]) throws IOException {
    try {
    InitialContext jndiContext = new InitialContext ();
    Object o = jndiContext.lookup("Course");
    CourseHome home =
        (CourseHome)PortableRemoteObject.narrow(o,CourseHome.class);
    Course C = home.create(1);
    C.setName("blah");
    CoursePK PK = new CoursePK();
    PK.number=1;
    C = home.findByPrimaryKey(PK);
    Debug.P(C.getName());
    catch (java.rmi.RemoteException re) {Debug.P("Remote Exception" + re.getMessage());}
    catch (javax.naming.NamingException ne){Debug.P("Naming Exception"+ne.getMessage());}
    catch (javax.ejb.CreateException ce){Debug.P("Create Exception"+ce.getMessage());}
    catch (javax.ejb.FinderException fe){Debug.P("Finder Exception"+fe.getMessage());}
    }When I run it, I get the following Naming Exception: Course not found
    I confirmed at the administrative console, that I have "Course" listed
    under Enterprise Applications:
    As per the ejb FAQ, I set up my $CLASSPATH so it starts as follows:
    /opt/j2ee/SUNWappserver/lib/appserv-rt.jar:
    /opt/j2ee/SUNWappserver/lib/javaee.jar:I also verifed in my domain.xml that the orb-listener-1, the default
    naming service port was at 3700.
    Here is the info on the Bean that I have running for both of the tries
    at my Client code.
    ejb-jar.xml
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <ejb-jar xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
    http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd"
    version="2.1">
      <enterprise-beans>
        <entity>
           <description>Course</description>
           <display-name>CourseBean</display-name>
           <ejb-name>CourseBean</ejb-name>
           <home>RS.CourseHome</home>
           <remote>RS.Course</remote>
           <ejb-class>RS.CourseBean</ejb-class>
           <persistence-type>Container</persistence-type>
           <prim-key-class>RS.CoursePK</prim-key-class>
           <reentrant>false</reentrant>
           <abstract-schema-name>Course</abstract-schema-name>
           <cmp-field><field-name>number</field-name></cmp-field>
           <cmp-field><field-name>name</field-name></cmp-field>
        </entity>
      </enterprise-beans>
      <assembly-descriptor>
         <security-role>
            <description>Everyone</description>
           <role-name>everyone</role-name>
         </security-role>
         <method-permission>
            <unchecked/>
            <method>
               <ejb-name>CourseBean</ejb-name>
               <method-name>*</method-name>
            </method>
          </method-permission>
         <container-transaction>
            <method>
               <ejb-name>CourseBean</ejb-name>
               <method-name>*</method-name>
            </method>
            <trans-attribute>Required</trans-attribute>
         </container-transaction>
      </assembly-descriptor>
    </ejb-jar>
    Sun-ejb-jar.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE sun-ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 8.1 EJB 2.1//EN"
    "http://www.sun.com/software/appserver/dtds/sun-ejb-jar_2_1-1.dtd">
    <sun-ejb-jar>
      <enterprise-beans>
         <name>CourseBean</name>
         <ejb>
           <ejb-name>CourseBean</ejb-name>
           <jndi-name>Course</jndi-name>
         </ejb>
      <cmp-resource>
         <jndi-name>jdbc/__default</jndi-name>
         <create-tables-at-deploy>true</create-tables-at-deploy>
         <drop-tables-at-undeploy>true</drop-tables-at-undeploy>
      </cmp-resource>
      </enterprise-beans>
    </sun-ejb-jar>
    Course.java
    package RS;
    import java.rmi.RemoteException;
    public interface Course extends javax.ejb.EJBObject {
      public String getName() throws RemoteException;
      public void setName (String Str) throws RemoteException;
      public int getNumber() throws RemoteException;
      public void setNumber (int n) throws RemoteException;
    CourseHome.java
    package RS;
    import java.rmi.RemoteException;
    import javax.ejb.CreateException;
    import javax.ejb.FinderException;
    public interface CourseHome extends javax.ejb.EJBHome {
    public Course create(int id) throws
    CreateException,RemoteException;
    public Course findByPrimaryKey(CoursePK pk)
    throws FinderException,RemoteException;
    CourseBean.java
    package RS;
    import javax.ejb.EntityContext;
    public abstract class CourseBean implements javax.ejb.EntityBean {
    public CoursePK ejbCreate (int number) throws javax.ejb.CreateException{
      this.setNumber(number);
      return null;
    public void ejbPostCreate (int number) {
    public abstract String getName();
    public abstract void setName (String str);
    public abstract int getNumber ();
    public abstract void setNumber (int number);
    public void setEntityContext (EntityContext ctx) {}
    public void unsetEntityContext() {}
    public void ejbActivate () {}
    public void ejbPassivate () {}
    public void ejbLoad () {}
    public void ejbStore () {}
    public void ejbRemove() {}
    }Laurence L. Leff, Ph.D. Associate Professor of Computer Science
    Western Illinois University, 1 University Circle 61455, Pager: 309 367 0787
    FAX 309 298 2302

    hi s-mcgowan,
    "some other processing" comprises of printing of debug lines and publishing to the message queue using JMS. I added more debug lines so that i could see whats really happening... here is the result
    myTableHome.create(...); <----------- no exception was thrown and it returned LocalMyTable object
    print out "Insert successful"
    print out "publishing message"
    ... publish message to message queue using JMS...
    print out "Publish done"
    ... after few milliseconds...
    java.sql.BatchUpdateException: Data exception -- row already exist in index PK_MYTABLE on table MYTABLE.
    From the exception it seems like its doing a batch insert. So that seems to explain why the java.sql.BatchUpdateException is thrown few milliseconds after my call to myTableHome.create(...);
    Is it possible to disable batch update / insert? how?
    thanks in advance,
    leigh

  • Error in WebDynpro Application in accessing "MIME Repository"

    Hi All,
    I am writing a XML file to Mime Repository from WebDynpro Application.
    To do this, I developed the below code:
      DATA mime_repository TYPE REF TO if_mr_api.
      DATA url TYPE string VALUE
    '/SAP/BC/WebDynpro/SAP/PUBLIC/BC/SSR/uuielibs/example.xml'.
      mime_repository = cl_mime_repository_api=>get_api( ).
      CALL METHOD mime_repository->put
        EXPORTING
          i_url                     = url
          i_content                 = content
          i_suppress_package_dialog = 'X'.
    In execution process,I am getting an error,
    "Screen output without connection to user" and "DYNPRO_SEND_IN_BACKGROUND"
    In calling the method IF_MR_API~PUT, I have passed "X" to I_SUPPRESS_PACKAGE_DIALOG to avoid Transport Request screen.
    Can you please suugest how can I overcoem this issue.

    Leha,
    Is this RFC expecting any mandatory parameters ? if that is the case make sure that you are sending the expected type mandatory parameter.  (you can print a message on the screen and verify this)
    If you are sure that you are sending the correct details to execute RFC, Please turn on the debiug session for the portal user in the backend and see whether the values are passing from the portal or not.
    How to switch on Debug mode in the backend for the specific user:
    Requirements:
    1. Make sure the user id existed in Portal and SAP Backend.
    2. Setup the debug mode for the user in the backend
    3. Run the application from the portal
    4. While executing the application from the portal , The backend stops the execution to debug, so from here you have to execute the FM step by step and verify whether you are getting the values from the portal or not.
    Steps to switch on Debug mode in the backend:
    Logon to ECC System>> To access the function module use SE37 tcode from the SAP Easy access menu>>Enter the Function Module name and click on Display>>From the SAP Menu click on Utilities>>Settings >>Debugging >>Enter the user ID to switch on the debug mode and Enter.
    Now the user ID is switched on for Debug. Go to the Function module Source Code>> palce the cursor at the start of the soruce code>>From the Menu go to Utilities>>BreakPoint>>Set?Delete Break Point
    This will set the break point for the mentioned user id and now you can veryfy the values on the backend.
    Once you complete the debug process please turnoff the debug mode.
    Thanks
    Krishna

  • Problem in accessing a EJB bean through a servlet

    Dear all,
    I'm a trying to call a stateless session bean which has its home and component interfaces, which prints the name it receives from the servlet client.
    I'm trying to access a remote server EJB beans, which has been registered with JNDI & when deploying the EJB beans onto the Jboss server which operates in localhost: 8081 it has shown
    20:19:16,890 INFO  [EjbModule] Deploying greetBean
       20:19:17,109 INFO  [ProxyFactory] Bound EJB Home 'greetBean' to jndi 'greetJndi'
    20:19:17,125 INFO  [EJBDeployer] Deployed: file:/C:/jboss-4.0.5.GA/server/default/deploy/greet.jarThis is my servlet which is there in tomcat container which runs in localhost:8082 to access the bean:
    import java.net.*;
    import javax.ejb.*;
    import javax.rmi.*;
    import java.rmi.*;
    import javax.naming.*;
    import java.util.*;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class greetServlet extends HttpServlet
    public void doPost
    (HttpServletRequest req, HttpServletResponse res)
    throws ServletException,IOException
    res.setContentType("text/html");
    PrintWriter out=res.getWriter();
    try
         out.println("Inside servlet");
    Properties props=new Properties();
    props.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
    *props.put(Context.PROVIDER_URL, "localhost:8081");*
    props.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
    System.out.println("Properties ok");
    Context ctx=new InitialContext(props);
    System.out.println("context ok");
    greetHome home = (greetHome)
    ctx.lookup("greetJndi");
    System.out.println("home ok");
    greetRemote remote=home.create();
    System.out.println("remote ok");
    String a = req.getParameter("text1");
    String s = remote.greetme(a);
    System.out.println(s);
    out.println(s);
    catch(Exception e)
    {System.out.println(""+e);}
    }When i try to access the bean it's throwing a communication exception. The exact stack trace is:
    javax.naming.CommunicationException: Could not obtain connection to any of these
          urls: localhost:8081 and discovery failed with error: javax.naming.Communicatio
         nException: Receive timed out [Root exception is java.net.SocketTimeoutException
         : Receive timed out] [Root exception is javax.naming.CommunicationException: Fai
         led to retrieve stub from server localhost:8081 [Root exception is java.io.EOFEx
    ception]]Could anyone say why this is occuring and how this can be fixed.
    Thanx in advance.

    when i change the properties url attribute to jnp://localhost:1099 like
    props.put(Context.PROVIDER_URL, "jnp://localhost:1099");It's throwing unmarshall exception:
    javax.naming.CommunicationException [Root exception is java.rmi.ServerException:
    RemoteException occurred in server thread; nested exception is:
            java.rmi.UnmarshalException: error unmarshalling arguments; nested excep
    tion is:
            java.net.MalformedURLException: no protocol: Files/Apache]Could anyone throw light on this?

  • Database access from session bean

    Hello,
    I have a stateless session bean which performs some complex
    calculations, and also does some database access.
    For the database access the bean class has a datasource as
    follows:
    public class TestBean implements SessionBean {
    private DataSource ds_;
    public void ejbCreate() {
         getDataSources();
    private void getDataSources() {
         try {
         Context ictx = new InitialContext();
         ds_ = (DataSource)ictx.lookup("java:comp/env/jdbc/TestDB");
         } catch (Exception e) {
         e.printStackTrace();
         throw new EJBException(e);
    Now this class has a method (which is also in the remote interface)
    calculateSomething(). This method constructs a number of other
    objects that do the actual calculation, and one of these objects
    does the actual database access. How would another object be able to
    use the datasource that was constructed in the bean class?
    I could pass the datasource reference to that object, but that would
    break my encapsulation. This is because that object does not get
    created directly by the bean object, but rather the way the objects
    interact is something like A -> B -> C, where A is the TestBean, and
    C is the object that does the DB access. If I passed the datasource,
    I would need to make B aware of the datasource, which doesn't
    seem good design, because B doesn't do any database access.
    Alternatively I could do the lookup in class C, but that would
    degrade the performance, as an object C gets created and destroyed
    every time the calculateSomething() method is called.
    A third option I have thought of, is to add a public method to the
    bean that returns a connection. Whenever another object gets
    created, a reference to the bean object will be passed along. Then,
    if another object needs to do database access, it will call back
    the bean to get a connection. This seems just as bad (if not worse)
    than the first option.
    Does anyone have an elegant solution for this situation? What is
    the best practice of handling datasources when a bean class doesn't
    do the database access itself? In all the examples I've seen so far,
    all the functionality was in the session bean class, but again that
    doesn't seem good OO design, and would result in a single huge class.
    regards,
    Kostas

    Thanks again to both for the replies. Here are my responses:
    Yi Lin: Yes, I know that an entity bean would solve this problem, however it has been decided not to use entity beans so this is not my call (I think the reason entity beans are not allowed in this project is that they are considered risky: there are other applications that access the same database, so if the container caches entity bean data as you describe, then the users might get inconsistent results).
    Gerard: Actually object B is the one that has the business logic and C is a peer object that only does database access and no calculaitons. For example B can be Customer, and C CustomerDB. This is why object B does not have any knowledge of datasources or connections. So my design does not appear to be that bad!
    As far as the factory you propose is concerned, I cannot understand how this would solve my problem. In order to solve this situation the factory would need to be persistent, i.e. get created by the ejbCreate() method, and destroyed whenever the container decides to destroy the bean. There would be no point in object C creating the factory, as I would have the overhead of doing the JNDI lookup every time I create a C.
    So the question remains the same: how would I pass a reference to the factory from A to C without making B aware of it?

  • Unable to access nested managed bean property in JSF 1.2.9

    In an old version of JSF, namely 1.2-b20-FCS from April/21/2006, I could access nested properties of a managed bean. So I had a managed bean OuterBean, and in JSF I could write
    <h:inputText value="#{outerBean.innerBean1.propertyA"/>
    The Java class OuterBean has a member function
    InnerBean OuterBean.getInnerBean1();
    That is, there is a function getInnerBean1() taking no arguments, and it returns something which in my example above is the class InnerBean.
    Class InnerBean has a member function getPropertyA().
    But in the latest JSF from July/17/2008, this nested stuff is not working.
    Simple access like #{outerBean.propertyA} works, but nested access like #{outerBean.innerBean.propertyA} does not.
    The exception is something like
    org.apache.jasper.el.JspELException: /whatever/mypage.jsp(71,15) '#{outerBean.innerBean.username}' Error reading 'innerBean' on type
    mypackage.OuterBean at org.apache.jasper.el.JspValueExpression.getValue(JspValueExpression.java:107) at javax.faces.component.UIOutput.getValue(UIOutput.java:184) at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getValue(HtmlBasicInputRenderer.java:201) at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getCurrentValue(HtmlBasicRenderer.java:284) at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeEnd(HtmlBasicRenderer.java:154) at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:861) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:946) at javax.faces.render.Renderer.encodeChildren(Renderer.java:148) at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:936) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:942) at com.sun.faces.application.ViewHandlerImpl.doRenderView(ViewHandlerImpl.java:271) at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:202) at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:109) at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100) at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266) atThanks.

    Sorry, it looks fine to me. In my original post, I had the call stack in code and for some reasons the newlines were removed. So let me try again in text, but putting two newlines. Hope it works this time:
    org.apache.jasper.el.JspELException: /whateverr/mypage.jsp(71,15) '#{outerBean.innerBean.property}' Error reading 'innerBean' on type mypackage.OuterBean at
    org.apache.jasper.el.JspValueExpression.getValue(JspValueExpression.java:107) at javax.faces.component.UIOutput.getValue(UIOutput.java:184) at
    com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getValue(HtmlBasicInputRenderer.java:201) at
    com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getCurrentValue(HtmlBasicRenderer.java:284) at
    com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeEnd(HtmlBasicRenderer.java:154) at
    javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:861) at
    javax.faces.component.UIComponent.encodeAll(UIComponent.java:946) at
    javax.faces.render.Renderer.encodeChildren(Renderer.java:148) at
    javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837) at
    javax.faces.component.UIComponent.encodeAll(UIComponent.java:936) at
    javax.faces.component.UIComponent.encodeAll(UIComponent.java:942) at
    com.sun.faces.application.ViewHandlerImpl.doRenderView(ViewHandlerImpl.java:271) at
    com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:202) at
    com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:109)
    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100) at
    com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139) at
    javax.faces.webapp.FacesServlet.service(FacesServlet.java:266) at
    Edited by: sn72 on Sep 21, 2008 10:21 AM
    Edited by: sn72 on Sep 21, 2008 10:22 AM

  • Access MIME repository by URL

    Hi !
    For an automated test I need to deploy some text or HTML files to a Web AS ABAP.
    Planned to use the mime repository for this, BUT ... Is there any possibility to access a folder of the MIME repository by a public URL (no login required) ? If yes, how do I build the URL (depending on the path in the MIME repository) ?
    If no, anyone got an idea how else I could publish public html or text files so that they can be delivered like a "normal" ABAP application ?
    Any help will be appreciated ...
    Best regards,
    Axel

    OK, here is an exemple :
    This the URL of my company's logo which is used on the logon page of one of our BSP application. As the logo is displayed, before you are logged in, the URL needs to work with no authentication (which means with user SAPSYS).
    http://my_server.my_domain/sap/public/bsp/sap/zlm_hds_system/logo.jpg
    In SICF, we have created a link /sap/public/bsp/sap/zlm_hds_system which points toward /sap/bc/bsp/sap/zlm_hds_system
    Regards,
    Olivier

  • Error in accessing FS Repository

    Hi
    I am getting this error when I try to connect to a windows file share using CM Repository in FSDB mode.
    It was working fine till now. But it stopped functioning now. The whole scenario was working for all IDs. But now it works for other id but not for my id.
    I have followed EP300 exercise to create file share and repository managers.
    On the portal screen I get the error as :
    Item not found       
    /sapportal/Product 1       
    The item you are attempting to access is not available. Check that the name or link is correct. You might also check whether the associated repository is currently accessible.     
    Then If I look into the trace file of the portal, I see this error :
    #1.5#005056A842CA00630000000100000D380004037B6DA1C7DC#1129728562238#com.sapportals.wcm.repository.manager.generic.security.w2k.W2kSecurityManager#sap.com/irj#com.sapportals.wcm.repository.manager.generic.security.w2k.W2kSecurityManager#E120799#686####5bf3f5e040a411dab074005056a842ca#SAPEngine_Application_Thread[impl:3]_9##0#0#Warning##Plain###Failed to check W2K file system access (user E120799, permission node_list_children, resource /sapportal, W2K path c:
    temp
    sapportal com.sapportals.wcm.repository.manager.generic.security.w2k.W2kException:  User-Password not valid for Windows or  SET_CB_NAME privilege maybe not granted for process owner 
    #1.5#005056A842CA00630000000200000D380004037B6DA1D7DA#1129728562254#com.sapportals.wcm.WcmException#sap.com/irj#com.sapportals.wcm.WcmException.WcmException(90)#E120799#686####5bf3f5e040a411dab074005056a842ca#SAPEngine_Application_Thread[impl:3]_9##0#0#Error##Plain###Pair user-password for user E120799 is not longer valid for this system(Password might have expired), please reenter  password for this user in System Landscape com.sapportals.wcm.repository.manager.generic.security.w2k.W2kException:  User-Password not valid for Windows or  SET_CB_NAME privilege maybe not granted for process owner 
    Any Idea ?
    Thanks in Advance

    Hello,
    we have the same problem with access to the file system repository with an End-User Account. If the End-User has the content_admin role he can access to the file-system (w2ksecurity). He can´t access to the file-system without this role.
    Do anybody have an idea/ Solution for this problem?
    I'd be very grateful for any answer.
    This is very urgently.
    Thanks in advance
    Katayoun Mahpour

Maybe you are looking for

  • K7N2 Delta problems

    Hey all..having a huge problem with my computer and have no idea what's going on.....when i try to reformat, i am getting errors with blue screen. errors are as follows: Page_Fault_In_Non_Paged_Area followed by the stop error numbers                

  • How To Access HTTPS Web Service  in Application Module

    I need to know how to access HTTPS web service in application module. If you can provide the tutorial or guidance to achieve this really appreciate. Thanks Sameera

  • PL/SQL function body returning SQL - report error:ORA-01403: no data found

    Hi, I am working on Application Express 4.0.2.00.06, and 11G database. I have a problem with classic report area of type - PL/SQL function body returning SQL query. Query works if I define region area as - Use Generic Column Names (parse query at run

  • To startup database in  noarchivelog

    Hi All, I want to know how can I start database in noarchivelog mode without using alter database noarchivelog; Is there anything to set with parameter? Thanks, Vishal

  • Transfer problems

    My son bought an iPod touch 3g off of ebay. The seller left the apps and music on there and we'd like to delete some of the music. But when I try to transfer purchases it says: "Some of the purchased items on the iPod could not be transferred to your