EJB called via JNDI in a Repository Service :: ClassCastException

Hi SDN,
I've got a problem in calling an EJB from a Repository Service...
Here the steps I've follow:
  -  An EJB has been created with some Business Methods in it; it has been packaged in an EAR and deployed;
  -  This EJB is looked up succesfully via JNDI in a WDJ application and also in an Abstract Portal Component; I use the following guides:
[Accessing EJB Apps using JNDI|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/0736159e-0301-0010- 9ea4-c63d83d0797b?QuickLink=index&overridelayout=true]
[Referencing an EJB in an Abstract Portal Component|http://wiki.sdn.sap.com/wiki/display/HOME/ConnectingEJBUsing ExternalJars]
  -  A Repository Service has been created and registered on "CREATE_CHILD_TEMPLATE" ResourceEvent; I can see from logs that this service works correctly;
   -  I've copied in the PAR lib and private/lib folders two jars (ejb20.jar and the JAR created building the EJB) and they are added to the build path;
  -  If I try to look up the EJB via JNDI in the received service method, I get a ClassCastException...
Here some code:
try {
     //I use System.err to see log in the Default Trace
     System.err.println("Initialize EJB");
     //TestJNDIHome class seems to be visible at runtime, following instruction does not throw any exception
     System.err.println("ToString TestJNDIHome: " + TestJNDIHome.class.toString());
     //EJB and PAR are on the same J2EE engine, so no InitialContext parameters, I'm right?
     InitialContext context = new InitialContext();
     Object jndiobj = context.lookup("altevie.com/testear/TestJNDIBean");
     System.err.println("Classe oggetto recuperato da lookup: " + jndiobj.getClass());
     TestJNDIHome home = (TestJNDIHome) javax.rmi.PortableRemoteObject.narrow(jndiobj, TestJNDIHome.class);
     testJNDI = home.create();
} catch (NamingException ex) {
     System.err.println("NamingException :: " + ex.getLocalizedMessage());
} catch (RemoteException ex) {
     System.err.println("RemoteException :: " + ex.getLocalizedMessage());
} catch (CreateException ex) {
     System.err.println("CreateException :: " + ex.getLocalizedMessage());          
Here the portalapp.xml (in the same PAR there are two objects, the Repository Service and an Abstract Portal Component, but I've got the same problem also removing the Abstract Portal Component...):
<application>
  <application-config>
    <property name="com.sap.engine.interfaces.cross.ObjectReferenceImpl" value="SAPJ2EE::altevie.com/testEAR"/>
    <property name="SharingReference" value="usermanagement, knowledgemanagement, landscape, htmlb, exportalJCOclient, exportal"/>
    <property name="PrivateSharingReference" value="SAPJ2EE::altevie.com/testEAR"/>
  </application-config>
  <components>
    <component name="TestJSP">
      <component-config>
        <property name="ClassName" value="com.comer.eps.epcomp.TestJSP"/>
      </component-config>
      <component-profile/>
    </component>
  </components>
  <services>
    <service name="RFServiceWrapper">
      <service-config>
        <property name="className" value="com.sap.netweaver.rf.wrapper.RFServiceWrapper"/>
        <property name="startup" value="true"/>
      </service-config>
    </service>
  </services>
</application>
javax.rmi.PortableRemoteObject.narrow method call throws a ClassCastException...
From the previous println I can see the lookup method returns a com.sap.engine.interfaces.cross.ObjectReferenceImpl object, I do not know if it is correct...
I've tried to lookup the Local (localejbs/altevie.com/testear/TestJNDIBean) and Remote (altevie.com/testear/TestJNDIBean) JNDI Bean name, but I get the same error...
I'm sure the JNDI name is correct (it works with WDJ and Abstract Portal Component... I've also tested via LOOKUP command using telnet to connect to J2EE AS and I've checked JNDI Registry and EJB Container services in Visual Admin)...
Here the stack trace of the error:
java.lang.ClassCastException: com.comer.eps.ejb.AccessiEJBHome
     at com.sap.engine.services.cross.PortableRemoteObjectContainer.narrow(PortableRemoteObjectContainer.java:179)
     at com.sap.engine.system.PortableRemoteObjectProxy.narrow(PortableRemoteObjectProxy.java:24)
     at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:134)
     at com.comer.eps.repsrv.onsave.RipubblicaByDE.initializeEJB(RipubblicaByDE.java:145)
Can you help me? Why JNDI lookup works in an Abstract Portal Application and doesn't in a Repository Service (same code...)?
Thank you so much and best regards,
Manuel
Text Formatted: Manuel Xiccato on Sep 27, 2011 12:29 PM

Hi SDN,
I've got a problem in calling an EJB from a Repository Service...
Here the steps I've follow:
  -  An EJB has been created with some Business Methods in it; it has been packaged in an EAR and deployed;
  -  This EJB is looked up succesfully via JNDI in a WDJ application and also in an Abstract Portal Component; I use the following guides:
[Accessing EJB Apps using JNDI|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/0736159e-0301-0010- 9ea4-c63d83d0797b?QuickLink=index&overridelayout=true]
[Referencing an EJB in an Abstract Portal Component|http://wiki.sdn.sap.com/wiki/display/HOME/ConnectingEJBUsing ExternalJars]
  -  A Repository Service has been created and registered on "CREATE_CHILD_TEMPLATE" ResourceEvent; I can see from logs that this service works correctly;
   -  I've copied in the PAR lib and private/lib folders two jars (ejb20.jar and the JAR created building the EJB) and they are added to the build path;
  -  If I try to look up the EJB via JNDI in the received service method, I get a ClassCastException...
Here some code:
try {
     //I use System.err to see log in the Default Trace
     System.err.println("Initialize EJB");
     //TestJNDIHome class seems to be visible at runtime, following instruction does not throw any exception
     System.err.println("ToString TestJNDIHome: " + TestJNDIHome.class.toString());
     //EJB and PAR are on the same J2EE engine, so no InitialContext parameters, I'm right?
     InitialContext context = new InitialContext();
     Object jndiobj = context.lookup("altevie.com/testear/TestJNDIBean");
     System.err.println("Classe oggetto recuperato da lookup: " + jndiobj.getClass());
     TestJNDIHome home = (TestJNDIHome) javax.rmi.PortableRemoteObject.narrow(jndiobj, TestJNDIHome.class);
     testJNDI = home.create();
} catch (NamingException ex) {
     System.err.println("NamingException :: " + ex.getLocalizedMessage());
} catch (RemoteException ex) {
     System.err.println("RemoteException :: " + ex.getLocalizedMessage());
} catch (CreateException ex) {
     System.err.println("CreateException :: " + ex.getLocalizedMessage());          
Here the portalapp.xml (in the same PAR there are two objects, the Repository Service and an Abstract Portal Component, but I've got the same problem also removing the Abstract Portal Component...):
<application>
  <application-config>
    <property name="com.sap.engine.interfaces.cross.ObjectReferenceImpl" value="SAPJ2EE::altevie.com/testEAR"/>
    <property name="SharingReference" value="usermanagement, knowledgemanagement, landscape, htmlb, exportalJCOclient, exportal"/>
    <property name="PrivateSharingReference" value="SAPJ2EE::altevie.com/testEAR"/>
  </application-config>
  <components>
    <component name="TestJSP">
      <component-config>
        <property name="ClassName" value="com.comer.eps.epcomp.TestJSP"/>
      </component-config>
      <component-profile/>
    </component>
  </components>
  <services>
    <service name="RFServiceWrapper">
      <service-config>
        <property name="className" value="com.sap.netweaver.rf.wrapper.RFServiceWrapper"/>
        <property name="startup" value="true"/>
      </service-config>
    </service>
  </services>
</application>
javax.rmi.PortableRemoteObject.narrow method call throws a ClassCastException...
From the previous println I can see the lookup method returns a com.sap.engine.interfaces.cross.ObjectReferenceImpl object, I do not know if it is correct...
I've tried to lookup the Local (localejbs/altevie.com/testear/TestJNDIBean) and Remote (altevie.com/testear/TestJNDIBean) JNDI Bean name, but I get the same error...
I'm sure the JNDI name is correct (it works with WDJ and Abstract Portal Component... I've also tested via LOOKUP command using telnet to connect to J2EE AS and I've checked JNDI Registry and EJB Container services in Visual Admin)...
Here the stack trace of the error:
java.lang.ClassCastException: com.comer.eps.ejb.AccessiEJBHome
     at com.sap.engine.services.cross.PortableRemoteObjectContainer.narrow(PortableRemoteObjectContainer.java:179)
     at com.sap.engine.system.PortableRemoteObjectProxy.narrow(PortableRemoteObjectProxy.java:24)
     at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:134)
     at com.comer.eps.repsrv.onsave.RipubblicaByDE.initializeEJB(RipubblicaByDE.java:145)
Can you help me? Why JNDI lookup works in an Abstract Portal Application and doesn't in a Repository Service (same code...)?
Thank you so much and best regards,
Manuel
Text Formatted: Manuel Xiccato on Sep 27, 2011 12:29 PM

Similar Messages

  • EJB lookup via JNDI results in java.lang.NoClassDefFoundError

    Hello,
    I have created and deployed an EJB to the WebAS (ver 6.40).  There is no problem looking up the bean via JNDI and calling its methods from a J2EE application - I successfully did this via a servlet.
    However, a JNDI lookup from a Web Dynpro application - on the same server - results in a java.lang.NoClassDefFoundError error.
    The code for the JNDI lookup is identical in either case.
    Any thoughts?

    Hello,
    I am calling ejb from .jsp use following code
    Properties props = new Properties();
    InitialContext ctx = new InitialContext();
    Object ob = ctx.lookup("java:comp/env/ejb/CalculatorBean");
    CalculatorHome home = (CalculatorHome) PortableRemoteObject.narrow(ob, CalculatorHome.class);
    calc = home.create();
    I have a error:
    java.lang.ClassNotFoundException: class com.sap.examples.calculator.beans.CalcProxy : com.sap.engine.services.jndi.persistent.exceptions.NameNotFoundException: Path to object does not exist at calculator, the whole lookup name is java:comp/env/ejb/CalculatorBean
    My ejb-jar.xml is:
    <display-name>
         CalculatorEjb</display-name>
         <enterprise-beans>
              <session>
                   <icon/>
                   <ejb-name>Calculator</ejb-name>
                   <home>com.sap.examples.calculator.CalculatorHome</home>
                   <remote>com.sap.examples.calculator.CalculatorRemote</remote>
                   <local-home>com.sap.examples.calculator.CalculatorLocalHome</local-home>
                   <local>com.sap.examples.calculator.CalculatorLocal</local>
                   <service-endpoint>com.sap.examples.calculator.CalculatorServiceEndpoint</service-endpoint>
                   <ejb-class>com.sap.examples.calculator.CalculatorBean</ejb-class>
                   <session-type>Stateless</session-type>
                   <transaction-type>Container</transaction-type>
                   <ejb-ref>
                        <ejb-ref-name>ejb/CalculatorBean</ejb-ref-name>
                        <ejb-ref-type>Session</ejb-ref-type>
                        <home>com.sap.examples.calculator.CalculatorHome</home>
                        <remote>com.sap.examples.calculator.CalculatorRemote</remote>
                        <ejb-link>Calculator</ejb-link>
                   </ejb-ref>
                   <ejb-local-ref>
                        <description/>
                        <ejb-ref-name>ejb/CalculatorBean</ejb-ref-name>
                        <ejb-ref-type>Session</ejb-ref-type>
                        <local-home>com.sap.examples.calculator.CalculatorLocalHome</local-home>
                        <local>com.sap.examples.calculator.CalculatorLocal</local>
                        <ejb-link>Calculator</ejb-link>
                   </ejb-local-ref>
              </session>
         </enterprise-beans>
    my ejb-j2ee-engine.xml is:
    <?xml version="1.0" encoding="UTF-8"?>
    <ejb-j2ee-engine
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="ejb-j2ee-engine.xsd">
         <enterprise-beans>
              <enterprise-bean>
                   <ejb-name>Calculator</ejb-name>
                   <ejb-ref>
                        <ejb-ref-name>ejb/CalculatorBean</ejb-ref-name>
                        <jndi-name>ejb/CalculatorBean</jndi-name>
                   </ejb-ref>
                   <ejb-local-ref>
                        <ejb-ref-name>ejb/CalculatorBean</ejb-ref-name>
                        <jndi-name>ejb/CalculatorBean</jndi-name>
                   </ejb-local-ref>
              </enterprise-bean>
         </enterprise-beans>
    </ejb-j2ee-engine>

  • "Multicast" support for EJB-EJB calls to cluster

    What I have to work with:
    + WebLogic Server 5.1 cluster
    + Stateless session EJBs
    What I want to do:
    + Be able to know list of available servers in the cluster
    and use this list to broadcast same information to all EJBs
    with same name in cluster
    + I understand that the cluster-aware EJB stub has this list
    when a client gets a home reference to the EJB Object
    + I have not seen any specific WebLogic API to get this list
    either by accessing the cluster-aware JNDI table or the
    cluster-aware EJB stub.
    + Othwerwise, I would then need to implement my own server
    list manager to get this list. Such task should not be that difficult.
    Why I want to do the above:
    + I would like to implement a EJB sendAll() method that will
    send the same request to all EJBs of the same JNDI name in the cluster.
    + Please correct me if I am wrong but I have not seen anywhere
    in the WebLogic 5.1 documentation regarding the automatic multicast
    ability of broadcasting EJBs calls via EJB-to-EJB communication to a
    cluster.
    + I understand that multicasting is only used internally, ie,
    heartbeats.
    Plus, I believe that RMI does not support multicasting.

    I'd like to hear a bit more about what you are trying to do. (at a
    higher level)
    RMI / EJB is a point-to-point model. A client is making an RMI call to
    a server. Granted, in our clustering solution, there may not be one
    physical server, but the idea is to give the appearance of one big,
    reliable server.
    -- Rob
    Ren Bitonio wrote:
    >
    What I have to work with:
    + WebLogic Server 5.1 cluster
    + Stateless session EJBs
    What I want to do:
    + Be able to know list of available servers in the cluster
    and use this list to broadcast same information to all EJBs
    with same name in cluster
    + I understand that the cluster-aware EJB stub has this list
    when a client gets a home reference to the EJB Object
    + I have not seen any specific WebLogic API to get this list
    either by accessing the cluster-aware JNDI table or the
    cluster-aware EJB stub.
    + Othwerwise, I would then need to implement my own server
    list manager to get this list. Such task should not be that difficult.
    Why I want to do the above:
    + I would like to implement a EJB sendAll() method that will
    send the same request to all EJBs of the same JNDI name in the cluster.
    + Please correct me if I am wrong but I have not seen anywhere
    in the WebLogic 5.1 documentation regarding the automatic multicast
    ability of broadcasting EJBs calls via EJB-to-EJB communication to a
    cluster.
    + I understand that multicasting is only used internally, ie,
    heartbeats.
    Plus, I believe that RMI does not support multicasting.--
    Coming Soon: Building J2EE Applications & BEA WebLogic Server
    by Michael Girdley, Rob Woollen, and Sandra Emerson
    http://learnweblogic.com

  • Calling EJB facades via class instantiated via reflection?

    We are loading plugins via Java reflection. Anything instantiated via newInstance() does not appear to have access to the Local interface.
    Right now, to get to the session bean we must use the Remote interface. This is annoying due to the performance, and seems completely unnecessary when everything is operating in one JVM.
    Tests were done to print out the JNDI namespace and the local interfaces don't seem to be accessible. Any advice?

    My project consists of an EJB package and WAR. I have not had any problem calling the local facades from JSP, Servlet, or web service in the EJB package.
    Further, I can use XStream reflection and do local EJB calls.
    It baffles me why I can't do the local calls in some classes via InitialContext lookups.
    I will post test code next week.

  • SJSAS 9.1 does not expose EJB 3.0 remote Interface via JNDI

    I have successfully deployed a simple Stateful EJB 3.0 bean (CartBean, like the one in the Java EE 5 tutorial remote interface Cart) on SJSAS 9.1, located on machine host1.
    After I deployed the CartBean, I browsed the SJSAS and noticed the existence of the following JNDI entries:
    ejb/Cart
    ejb/Cart__3_x_Internal_RemoteBusinessHome__
    ejb/Cart#main.Cart
    ejb/mgmt
    ejb/myOtherEJB_2_x_bean ( +myOtherEJB_2_x_bean+ is a different 2.x bean that I have deployed as well)So, I am trying to access the remote interface of the CartBean from a remote machine, host2. The client application is a Java-standalone client.
    I am using the Interoperable Naming Service syntax: corbaname:iiop:host1:3700#<JNDI name>
    The problem is that the remote interface of the bean does NOT seem to be available via JNDI. I get the javax.naming.NameNotFoundException when I try to do a lookup like:
    corbaname:iiop:host1:3700#ejb/Cart
    On the other hand, the following lookups succeed:
    corbaname:iiop:host1:3700#ejb/mgmt
    corbaname:iiop:host1:3700#myOtherEJB_2_x_bean
    and also the following succeeds:
    corbaname:iiop:host1:3700#ejb/Cart__3_x_Internal_RemoteBusinessHome__So it seems like the Remote interface is not available via JNDI, rather only some internal SJSAS implementation (the object returned from the ejb/Cart__3_x_Internal_RemoteBusinessHome__ lookup is of type: com.sun.corba.se.impl.corba.CORBAObjectImpl
    Why is this happening? I know there used to be a bug in Glassfish, but I thought it had been fixed since 2006.
    Many thanks in advance, any help would be greatly appreciated.

    The EJB 3.0 Remote Business references are not directly stored in CosNaming. EJB 3.0 Remote references do not have the cross-vendor interoperability requirements that the EJB 2.x Remote view had.
    You can still access Remote EJB references from a different JVM as long as the client has access to SJSAS naming provider. Please see our EJB FAQ for more details :
    https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html

  • Weblogic 10.3 POJO to EJB 3.0 call using JNDI

    Hi all,
    We are upgrading our applications from OAS to WL 10.3 and I am running into EJB lookup issues. Here is what I currently have in terms of setup.
    One EAR file being deployed and there are two main jar files in it that communicate with each other. The first jar file contains POJOs and the second is an EJB jar file. One of the classes in the POJO jar file is doing a lookup for an EJB that can be found in the EJB jar file.
    EAR file
    ---> POJO jar
    ---> EJB jar file
    The EJB itself is declared as follows
    @Stateless
    public class MyBean implements MyBeanService
    I added ejb-jar.xml and weblogic-ejb-jar.xml DDs to my ejb jar file and the bean reference shows up in the Weblogic console under the application after the deployment.
    ejb-jar.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <ejb-jar xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd" version="3.0">
    <enterprise-beans>
              <session>
                   <ejb-name>MyBean</ejb-name>
                   <business-local>package.MyBeanService</business-local>
                   <ejb-class>package.MyBean</ejb-class>
                   <session-type>Stateless</session-type>
              </session>
         </enterprise-beans>
    </ejb-jar>
    weblogic-ejb-jar.xml
    <weblogic-ejb-jar xmlns="http://www.bea.com/ns/weblogic/90"
    xmlns:j2ee="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.bea.com/ns/weblogic/90
    http://www.bea.com/ns/weblogic/90/weblogic-ejb-jar.xsd">
         <weblogic-enterprise-bean>
              <ejb-name>MyBean</ejb-name>
              <jndi-name>ejb/MyBeanService</jndi-name>
         </weblogic-enterprise-bean>
    </weblogic-ejb-jar>
    My POJO call to JNDI is
    InitialContext initialContext = new InitialContext();
    Object found = initialContext.lookup("ejb/MyBeanService"); //---------------------FAILS ON THE LOOKUP ON THIS LINE
    System.out.println(found.getClass());
    Error
    javax.naming.NameNotFoundException: Unable to resolve 'ejb.MyBeanService'. Resolved 'ejb'; remaining name 'MyBeanService'
    Am I not using the right lookup name? Must I prefix the call with the name of my ejb jar name?
    Thanks
    S.

    Hi,
    I made the changes as requested and it looks as follows.
    <weblogic-ejb-jar xmlns="http://www.bea.com/ns/weblogic/90"
    xmlns:j2ee="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.bea.com/ns/weblogic/90
    http://www.bea.com/ns/weblogic/90/weblogic-ejb-jar.xsd">
         <weblogic-enterprise-bean>
              <ejb-name>MyBean</ejb-name>
              <stateless-session-descriptor>
                        <business-local>package.MyBeanService</business-local>
                        <jndi-name>ejb/MyBeanService</jndi-name>
                   </business-interface-jndi-name-map>
              </stateless-session-descriptor>
         </weblogic-enterprise-bean>
    </weblogic-ejb-jar>
    I don't think <business-remote> works in <business-interface-jndi-name-map>.
    VALIDATION PROBLEMS WERE FOUND problem: cvc-complex-type.2.4a: Expected element 'business-remote@http://xmlns.oracle.com/weblogic/weblogic-ejb-jar' instead of 'business-local@http://xmlns.oracle.com/weblogic/weblogic-ejb-jar' here in element business-interface-jndi-name-map@http://xmlns.oracle.com/weblogic/weblogic-ejb-jar:<null> problem: cvc-complex-type.2.4a: Expected element 'business-remote@http://xmlns.oracle.com/weblogic/weblogic-ejb-jar' instead of 'jndi-name@http://xmlns.oracle.com/weblogic/weblogic-ejb-jar' here in element business-interface-jndi-name-map@http://xmlns.oracle.com/weblogic/weblogic-ejb-jar:<null> problem: cvc-complex-type.2.4c: Expected element 'business-remote@http://xmlns.oracle.com/weblogic/weblogic-ejb-jar' before the end of the content in element business-interface-jndi-name-map@http://xmlns.oracle.com/weblogic/weblogic-ejb-jar:<null>
    Anyhow if I use the <business-remote> I still get the following error when I call
    Object found = initialContext.lookup("ejb/MyBeanService"); ----> ERROR
    javax.naming.NameNotFoundException: Unable to resolve 'ejb.MyBeanService'. Resolved 'ejb'; remaining name 'MyBeanService'
    Thanking you in advance.
    S.

  • Service Call via RFC

    Hi all.
    I am currently starting with WDA and facing some problems in calling BAPI via RFC.
    We have a "plain" WAS without SD or other modules. Our data is distributed over multiple R/3 systems.
    When I try to implement a Service Call to the BAPI BAPI_CUSTOMER_GETLIST via RFC I got the error message that this FM is not available in the current system (WAS).
    Does anyone has experience in how to get this working?
    What is the best practice here?
    - Building wrapper on WAS which calls the FM via RFC on the other system?
    - Installing missing modules on WAS ?
    Any comment would be appreciated.
    Cheers,
    Sascha

    Hi again.
    To shorten development time we considered the following solution:
    We are generating web service proxy classes on the WAS for the BAPIs of the R/3 system we want to use. Afterwards we are generating wrapper function modules which will use these proxies. So we do not have to import all missing structrues cause these are generated automatically during proxy generation.
    I tested this already with BAPI_CUSTOMER_GETDETAIL2. Calling the wrapping fm which calls the service proxy works fine from se80. I do get a result via the service.
    Then i generated a service call for my WEBDynpro component using the wizard in WDA.
    Silly is that the generated code is not compilable cause of missing ,. Anyway after correcting I tried to run my webdynpro application and when the fm gets called via the generated service method I receive the following message:
    CODE           SOAP:111
    ERRORTEXT     Unallowed RFC-XML Tag (SOAP_EINVALDOC)
    Any ideas?
    Why is it working when i call the fm directly but not when calling it from my webdynpro app?
    Thanks in advance
    Sascha
    Message was edited by: Sascha Dingeldey
    Message was edited by: Sascha Dingeldey

  • Hot to retrieve an authenticated user for JCA in a repository service?

    Hi,
    I implemented a repository service wich calls an ABAP Functionmodule via JCA and RFC. This connection has to be build up with the current logged in user.
    But how can I get an authenticated ep6-user in the repository service received-event? Or is it possible to do this with an ep5-user?
    I don't want to use username/password.
    String sapsystem = "R3SYSTEM";
    IConnectorGatewayService cgService = (IConnectorGatewayService)PortalRuntime.getRuntimeResources().getService(IConnectorService.KEY);
    ConnectionProperties connProps = new ConnectionProperties(locale, (IPrincipal)user);
    IConnection connection = cgService.getConnection(sapsystem, connProps);
    In the last line I got the error message:
    com.sapportals.connector.connection.ConnectionFailedException: Connection Failed: Nested Exception. Failed to get connection. Please contact your admin.
    Any ideas?
    Thanks.

    Peter, the autheticated user is available from the portal request object. Get that one in your application and read from the UME all the properties you wanna get and build your web service call with it. It looks for me straight forward, what exactly is your problem?
    cheers

  • Accessing JMX via JNDI?

    Hi all,
    I've used JMX just a bit via custom jsps and the HttpAdapter that ships with Coherence. I would like to know how, if at all, to access the MBeans via JNDI. Running in WLS 8.1, I can access the WebLogic MBeans by looking up the MBean server via JNDI or by looking up the WLS-specific MBeanHome via JNDI. Can I do something similar with the Coherence MBeans? In my jsp, I can get the default MBeanServer via the MBeanServerFactory and then look up something like "Coherence:type=Service,*" and go from there. With JNDI, I look up "weblogic.management.server" but can't use it to look up any Coherence MBeans. Is there a different MBean server I should be looking up? Something else completely?
    Also, is there a way to use something more like strong typing? In other words, can I cast an object to something like ServiceMBean and call methods like getRequestTotalCount() on it? I know this works with WLS, but they document the interfaces. I haven't seen anything similar for Coherence.
    thanks
    john

    Hi all,
    I've used JMX just a bit via custom jsps and the HttpAdapter that ships with Coherence. I would like to know how, if at all, to access the MBeans via JNDI. Running in WLS 8.1, I can access the WebLogic MBeans by looking up the MBean server via JNDI or by looking up the WLS-specific MBeanHome via JNDI. Can I do something similar with the Coherence MBeans? In my jsp, I can get the default MBeanServer via the MBeanServerFactory and then look up something like "Coherence:type=Service,*" and go from there. With JNDI, I look up "weblogic.management.server" but can't use it to look up any Coherence MBeans. Is there a different MBean server I should be looking up? Something else completely?
    Also, is there a way to use something more like strong typing? In other words, can I cast an object to something like ServiceMBean and call methods like getRequestTotalCount() on it? I know this works with WLS, but they document the interfaces. I haven't seen anything similar for Coherence.
    thanks
    john

  • Datasource via JNDI vs Driver Manager

    I am really desperate to use Datasource for connectivity to Oracle (rather than using the driver manager) in my little J2EE app (no EJB) on IBM WSAD 5.0.
    I have some example using DB2 datasource via JNDI.
    I replaced the properties with my Oracle database parameters.
    as below
    userid=scott
    password=tiger
    url=jdbc:oracle:thin:@localhost:1521:library
    driver=oracle.jdbc.OracleDriver
    lookupName=jdbc/library
    database=library
    There is an object "DB2DataSource" coming from package COM.ibm.db2.jdbc.DB2DataSource in the example code "CreateDatasource.java" I am using to create the data source.
    I have added JNDI.jar(from oracle), Naming.jar(from WSAD home), nasmingClient.jar(from WSAD home) in to the project.
    By looking at Oracle manual we need import com.evermind.sql.DriverManagerDataSource; and
    com.evermind.server to get initialContext.
    But compiler cant find them.
    Can anyone tell me what is the equivalent in Oracle?
    Thanks
    Mei

    Hold on.
    This is what I think. There will be others here who might be able to build to this and provide you the solution.
    All that you need to do is
    1. Add the Oracle driver to the WebSphere classpath.
    2. Use the Admin Console / WSAD screens to create a JDBC Driver for the Oracle Driver.
    3. Create a datasource within this driver. There is step-by-step documentation on how to do this.
    4. Specify a JNDI name for the datasource.
    5. Lookup the DataSource and cast it to a DataSource object.
    6. Call getConnection method to get a connection.
    Your coding portion is only steps 5 and 6 above.
    Steps 1 through 4 needs to happen in the Admin Console / WSAD tool. I have done it in both the places before and it is a fairly straightforward process. You do not need any of the jars that you are mentioning below or need to do anything special.
    Vijay

  • How can I persist a Java object to the PCD via JNDI ?

    Hi,
    I'm trying to persist XML data on the PCD via JNDI. I'm using
    portal version 6.2.0.4.200408172051.
    I followed the instructions in the "Portal Runtime Technology 640"
    document.
    The example they showed was:
    import javax.naming.Context;
    Context context = PortalRegistry.getCentralConfigurationContext();
    Context applicationContext = context.lookup("MyAppName");
    It was possible to obtain 'applicationContext' in the above example by
    using:-
    Context context = PortalRegistry.getCentralConfigurationContext();
    String appName = request.getComponentContext().getApplicationName();
    Context applicationContext = (Context) context.lookup(appName);
    However, any attempt to bind, rebind an object (implementing IStreamSource)
    resulted in NamingExcptions. As did 'listBindings' and 'list' (see below).
    BeanWrapper d = new BeanWrapper("test input");
    applicationContext.rebind("PCD_LOOKUP_KEY", d);
    // where 'd' implements IStreamSource
    class BeanWrapper implements IStreamSource {
    String content = "balh";
    BeanWrapper(String s) {
    content = s;
    public InputStream getInputStream() throws IOException {
    ByteArrayInputStream bis = new ByteArrayInputStream(content.getBytes());
    return bis;
    } // getInputStream
    } // BeanWrapper
    I don't know what I've done wrong. I couldn't find any more documentation
    on this topic...
    Any help would be appreciated.
    cheers,
    Michael
    javax.naming.NameNotFoundException: [Xfs] Object not found. Root exception is javax.naming.NamingException: [Xfs] Object not found
    at com.sapportals.portal.pcd.gl.xfs.BasicContext.lookup(BasicContext.java:840)
    at com.sapportals.portal.pcd.gl.PcdPersContext.lookup(PcdPersContext.java:422)
    at com.sapportals.portal.pcd.gl.PcdFilterContext.filterLookup(PcdFilterContext.java:387)
    at com.sapportals.portal.pcd.gl.PcdProxyContext.basicContextLookup(PcdProxyContext.java:1083)
    at com.sapportals.portal.pcd.gl.PcdProxyContext.proxyLookupLink(PcdProxyContext.java:1170)
    at com.sapportals.portal.pcd.gl.PcdProxyContext.proxyLookup(PcdProxyContext.java:1132)
    at com.sapportals.portal.pcd.gl.PcdProxyContext.getBasicObject(PcdProxyContext.java:1330)
    at com.sapportals.portal.pcd.gl.PcdProxyContext.getBasicContext(PcdProxyContext.java:1306)
    at com.sapportals.portal.pcd.gl.PcdProxyContext.rebind(PcdProxyContext.java:473)
    at com.sapportals.portal.pcd.gl.PcdGlContext.rebind(PcdGlContext.java:1185)
    at com.sapportals.portal.pcd.gl.PcdProxyContext.rebind(PcdProxyContext.java:515)
    at com.sapportals.portal.pcd.gl.PcdProxyContext.rebind(PcdProxyContext.java:683)
    at com.sapportals.portal.pcd.gl.PcdProxyContext.rebind(PcdProxyContext.java:688)
    at com.sapportals.portal.prt.jndisupport.util.AbstractContextWrapper.rebind(AbstractContextWrapper.java:46)
    at com.siemens.pct.employee.cu_selector.CUSelector.saveCuBeanToPCD(CUSelector.java:305)
    at com.siemens.pct.employee.cu_selector.CUSelectorUpload.doUpload(CUSelectorUpload.java:70)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.sapportals.portal.prt.component.AbstractPortalComponent.handleRequestEvent(AbstractPortalComponent.java:700)
    at com.sapportals.portal.prt.component.AbstractPortalComponent.handleEvent(AbstractPortalComponent.java:412)
    at com.sapportals.portal.prt.pom.ComponentNode.handleEvent(ComponentNode.java:250)
    at com.sapportals.portal.prt.pom.PortalNode.fireEventOnNode(PortalNode.java:333)
    at com.sapportals.portal.prt.core.PortalRequestManager.runRequestCycle(PortalRequestManager.java:627)
    at com.sapportals.portal.prt.connection.ServletConnection.handleRequest(ServletConnection.java:208)
    at com.sapportals.portal.prt.dispatcher.Dispatcher$doService.run(Dispatcher.java:532)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sapportals.portal.prt.dispatcher.Dispatcher.service(Dispatcher.java:415)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.inqmy.services.servlets_jsp.server.InvokerServlet.service(InvokerServlet.java:126)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.inqmy.services.servlets_jsp.server.RunServlet.runSerlvet(RunServlet.java:149)
    at com.inqmy.services.servlets_jsp.server.ServletsAndJspImpl.startServlet(ServletsAndJspImpl.java:832)
    at com.inqmy.services.httpserver.server.RequestAnalizer.checkFilename(RequestAnalizer.java:666)
    at com.inqmy.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:313)
    at com.inqmy.services.httpserver.server.Response.handle(Response.java:173)
    at com.inqmy.services.httpserver.server.HttpServerFrame.request(HttpServerFrame.java:1288)
    at com.inqmy.core.service.context.container.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:36)
    at com.inqmy.core.cluster.impl5.ParserRunner.run(ParserRunner.java:55)
    at com.inqmy.core.thread.impl0.ActionObject.run(ActionObject.java:46)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.inqmy.core.thread.impl0.SingleThread.run(SingleThread.java:148)

    Hi Michael,
    here my comments to your questions:
    0.:[Michael says:]
    "So basically you're saying that under SP10 its not possible to store objects on the PCD ... ?"
    I want to clarify this:
    It is possible to store objects in the PCD in lower releases than SP10 (e.g. SP2). But due to the fact that PCD API is not public before SP10 you should not develop a SP2 iView that programmatically uses the PCD API and complain afterwards because some "tiny" things of it are not working in SP10. It might be that you have to adjust some parts of this SP2 iView.
    The kind of object that can be stored in the PCD depends on the fact if the objects have a corresponding object provider or not. If you want to store iViews, roles or one of the other commonly known portal objects you can do it because corresponding object provider (iViewservice, roleservice, etc.) are always available in a running portal.
    If you want to store objects (like your BeanWrapper class) then you should write a corresponding object provider (what I explained in my first reply).
    1.:[Michael asked:]
    Why does list and listBindings fail ? surely that should just
    list the existing bound objects ???
    Nothing was bound!
    Your code line
    applicationContext.rebind("PCD_LOOKUP_KEY", d);
    throws a NamingException because no object provider for class of object d was found.
    So I gess you did a lookup on  applicationContext.lookup( "PCD_LOOKUP_KEY" ) before you did the list/listBindings and because this
    context does not exist the corresponding "Name not found" exception was thrown?
    A list/listBinding on the applicationContext itself should work even if nothing was bound.
    2.:[Michael asked:]
    Is there not some kind of default object/object provider pair
    that can be used to store base types like Strings/Integers etc ?
    No. There are no default object providers for java string/integers. But for this case "persisting a string or integer value at any PCD context" the PCD offers another way to do it: Just create an additional attribute (of type STRING or INT) and persist the corresponding value in this attribute (of type IPcdAttribute - an extension of javax.naming.directory.Attribute )   
    The code for creating a pcd attribute looks e.g. like this:
    IPcdObjectFactory pcdObjFactory = ((IPcdGlService) PortalRuntime
                                                   .getRuntimeResources()
                                                   .getService(IPcdGlService.KEY))
                                                   .getPcdObjectFactory();
    IPcdAttribute newPcdAttr = pcdObjFactory.createPcdAttribute(     PcdAttributeValueType.STRING,
                                            "new_attrId" );     
    newPcdAttr.set(     0,
              "new_AttrValue" );
    ModificationItem mods[] = new ModificationItem[1];
    mods[0] = new ModificationItem(      DirContext.REPLACE_ATTRIBUTE,
                               (Attribute)newPcdAttr );
    pcdCtx.modifyAttributes(     "",
                        mods );
    Hope, that helps you!
    Regards,
    Jens

  • Searching iPlanet Users via JNDI

    This is probably more an iPlanet Directory Server question but since it is also a Sun product, I thought I try here first.
    I have an application that searches an iPlanet 5.1 directory service via JNDI. The directory server has 10,000 users in a single context. When I search for "objectclass=person" with a limit of 1000, I get a strange result. I get 1000 users distributed randomly from A to Z! This is the problem. I do not get the first 1000 users starting from A as I would expect. I therefore don't know how to ask for the next 1000 users since the result it randomly distributed across all 10000 users from A to Z.
    Is there a way to control the iPlanet Directory Server so that it gives me a linear result set starting from the first user in the context through the next 1000 users alphabetically.
    I know I can use ranges (&(sn>=A)(sn<=C)) to control it somewhat, but if that range has more than 1000 users it too is randomly distributed from A to C.
    What I am looking for is a way to have the iPlanet server return linear result sets not randomly distributed results sets.
    Can you help?
    Thanks,
    -- Peter Desaulniers

    No need to reply to this thread, instead please refer to the "Controlling iPlanet search ordering via JNDI" thread if you have some information.

  • Acknwldgmnt on creation of KM doc.Call an Abstrct compnent from repo servic

    Hi All,
    I have implemented a repository service which submits a document for approval automatically once it is created.
    Now my issue i want to call an abstract portal component present in the same project as the repository service.
    My final goal is to display the end user who has just created a document some message.
    Hence my approach is i want to call a abstract portal component which can inturn call a jsp or
    we can write "response.write" statement in the doContent()
    method.
    If anyone can suggest some other approach i would be glad.
    Regards,
    Nikhil

  • Connect Via RMI To A Remote Service?

    Has anyone connected, via RMI, to a remote service within an application module? Currently this seems to wreak havoc upon all future and current ORMI communication to and from the application server in which a model is deployed (or at least within a container). Does anyone have any idea on how to do this correctly?
    -Brian
    When a connection is initiated I get the following stack trace:
    oracle.jbo.JboException: JBO-29000: Unexpected exception caught: java.security.AccessControlException, msg=access denied (java.net.SocketPermission ifd01-d.syd.nighthawkrad.net resolve)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.dispatchMethod(AbstractRemoteApplicationModuleImpl.java:6301)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.executeMethod(AbstractRemoteApplicationModuleImpl.java:6503)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.processSvcMsgRequest(AbstractRemoteApplicationModuleImpl.java:4744)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.processSvcMsgEntries(AbstractRemoteApplicationModuleImpl.java:4995)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.readServiceMessage(AbstractRemoteApplicationModuleImpl.java:4176)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.processMessage(AbstractRemoteApplicationModuleImpl.java:2255)
         at oracle.jbo.server.ApplicationModuleImpl.doMessage(ApplicationModuleImpl.java:7509)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.sync(AbstractRemoteApplicationModuleImpl.java:2221)
         at oracle.jbo.server.remote.ejb.ServerApplicationModuleImpl.doMessage(ServerApplicationModuleImpl.java:79)
         at oracle.jbo.server.ejb.SessionBeanImpl.doMessage(SessionBeanImpl.java:474)
         at sun.reflect.GeneratedMethodAccessor15.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:35)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.interceptor.system.TxBeanManagedInterceptor.invoke(TxBeanManagedInterceptor.java:53)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.StatefulSessionEJBObject.OC4J_invokeMethod(StatefulSessionEJBObject.java:840)
         at RemoteQCServicesAppModule_StatefulSessionBeanWrapper226.doMessage(RemoteQCServicesAppModule_StatefulSessionBeanWrapper226.java:1902)
         at sun.reflect.GeneratedMethodAccessor14.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.rmi.RmiMethodCall.run(RmiMethodCall.java:53)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)
    ## Detail 0 ##
    java.security.AccessControlException: access denied (java.net.SocketPermission ifd01-d.syd.nighthawkrad.net resolve)
         at java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)
         at java.security.AccessController.checkPermission(AccessController.java:427)
         at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
         at java.lang.SecurityManager.checkConnect(SecurityManager.java:1031)
         at java.net.InetAddress.getAllByName0(InetAddress.java:1117)
         at java.net.InetAddress.getAllByName0(InetAddress.java:1098)
         at java.net.InetAddress.getAllByName(InetAddress.java:1061)
         at java.net.InetAddress.getByName(InetAddress.java:958)
         at java.net.InetSocketAddress.<init>(InetSocketAddress.java:124)
         at java.net.Socket.<init>(Socket.java:178)
         at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
         at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
         at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:569)
         at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185)
         at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
         at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:306)
         at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
         at net.nighthawk.ifd.client.communications.Communications.updateFaxViewerRMIServer(Communications.java:156)
         at net.nighthawk.talon.model.bc.autorad.QCServicesAppModuleImpl.sendReport(QCServicesAppModuleImpl.java:5560)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.dispatchMethod(AbstractRemoteApplicationModuleImpl.java:6279)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.executeMethod(AbstractRemoteApplicationModuleImpl.java:6503)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.processSvcMsgRequest(AbstractRemoteApplicationModuleImpl.java:4744)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.processSvcMsgEntries(AbstractRemoteApplicationModuleImpl.java:4995)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.readServiceMessage(AbstractRemoteApplicationModuleImpl.java:4176)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.processMessage(AbstractRemoteApplicationModuleImpl.java:2255)
         at oracle.jbo.server.ApplicationModuleImpl.doMessage(ApplicationModuleImpl.java:7509)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.sync(AbstractRemoteApplicationModuleImpl.java:2221)
         at oracle.jbo.server.remote.ejb.ServerApplicationModuleImpl.doMessage(ServerApplicationModuleImpl.java:79)
         at oracle.jbo.server.ejb.SessionBeanImpl.doMessage(SessionBeanImpl.java:474)
         at sun.reflect.GeneratedMethodAccessor15.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:35)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.interceptor.system.TxBeanManagedInterceptor.invoke(TxBeanManagedInterceptor.java:53)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.StatefulSessionEJBObject.OC4J_invokeMethod(StatefulSessionEJBObject.java:840)
         at RemoteQCServicesAppModule_StatefulSessionBeanWrapper226.doMessage(RemoteQCServicesAppModule_StatefulSessionBeanWrapper226.java:1902)
         at sun.reflect.GeneratedMethodAccessor14.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.rmi.RmiMethodCall.run(RmiMethodCall.java:53)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)

    Has anyone connected, via RMI, to a remote service within an application module? Currently this seems to wreak havoc upon all future and current ORMI communication to and from the application server in which a model is deployed (or at least within a container). Does anyone have any idea on how to do this correctly?
    -Brian
    When a connection is initiated I get the following stack trace:
    oracle.jbo.JboException: JBO-29000: Unexpected exception caught: java.security.AccessControlException, msg=access denied (java.net.SocketPermission ifd01-d.syd.nighthawkrad.net resolve)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.dispatchMethod(AbstractRemoteApplicationModuleImpl.java:6301)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.executeMethod(AbstractRemoteApplicationModuleImpl.java:6503)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.processSvcMsgRequest(AbstractRemoteApplicationModuleImpl.java:4744)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.processSvcMsgEntries(AbstractRemoteApplicationModuleImpl.java:4995)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.readServiceMessage(AbstractRemoteApplicationModuleImpl.java:4176)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.processMessage(AbstractRemoteApplicationModuleImpl.java:2255)
         at oracle.jbo.server.ApplicationModuleImpl.doMessage(ApplicationModuleImpl.java:7509)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.sync(AbstractRemoteApplicationModuleImpl.java:2221)
         at oracle.jbo.server.remote.ejb.ServerApplicationModuleImpl.doMessage(ServerApplicationModuleImpl.java:79)
         at oracle.jbo.server.ejb.SessionBeanImpl.doMessage(SessionBeanImpl.java:474)
         at sun.reflect.GeneratedMethodAccessor15.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:35)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.interceptor.system.TxBeanManagedInterceptor.invoke(TxBeanManagedInterceptor.java:53)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.StatefulSessionEJBObject.OC4J_invokeMethod(StatefulSessionEJBObject.java:840)
         at RemoteQCServicesAppModule_StatefulSessionBeanWrapper226.doMessage(RemoteQCServicesAppModule_StatefulSessionBeanWrapper226.java:1902)
         at sun.reflect.GeneratedMethodAccessor14.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.rmi.RmiMethodCall.run(RmiMethodCall.java:53)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)
    ## Detail 0 ##
    java.security.AccessControlException: access denied (java.net.SocketPermission ifd01-d.syd.nighthawkrad.net resolve)
         at java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)
         at java.security.AccessController.checkPermission(AccessController.java:427)
         at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
         at java.lang.SecurityManager.checkConnect(SecurityManager.java:1031)
         at java.net.InetAddress.getAllByName0(InetAddress.java:1117)
         at java.net.InetAddress.getAllByName0(InetAddress.java:1098)
         at java.net.InetAddress.getAllByName(InetAddress.java:1061)
         at java.net.InetAddress.getByName(InetAddress.java:958)
         at java.net.InetSocketAddress.<init>(InetSocketAddress.java:124)
         at java.net.Socket.<init>(Socket.java:178)
         at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
         at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
         at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:569)
         at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185)
         at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
         at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:306)
         at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
         at net.nighthawk.ifd.client.communications.Communications.updateFaxViewerRMIServer(Communications.java:156)
         at net.nighthawk.talon.model.bc.autorad.QCServicesAppModuleImpl.sendReport(QCServicesAppModuleImpl.java:5560)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.dispatchMethod(AbstractRemoteApplicationModuleImpl.java:6279)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.executeMethod(AbstractRemoteApplicationModuleImpl.java:6503)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.processSvcMsgRequest(AbstractRemoteApplicationModuleImpl.java:4744)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.processSvcMsgEntries(AbstractRemoteApplicationModuleImpl.java:4995)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.readServiceMessage(AbstractRemoteApplicationModuleImpl.java:4176)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.processMessage(AbstractRemoteApplicationModuleImpl.java:2255)
         at oracle.jbo.server.ApplicationModuleImpl.doMessage(ApplicationModuleImpl.java:7509)
         at oracle.jbo.server.remote.AbstractRemoteApplicationModuleImpl.sync(AbstractRemoteApplicationModuleImpl.java:2221)
         at oracle.jbo.server.remote.ejb.ServerApplicationModuleImpl.doMessage(ServerApplicationModuleImpl.java:79)
         at oracle.jbo.server.ejb.SessionBeanImpl.doMessage(SessionBeanImpl.java:474)
         at sun.reflect.GeneratedMethodAccessor15.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:35)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.interceptor.system.TxBeanManagedInterceptor.invoke(TxBeanManagedInterceptor.java:53)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:69)
         at com.evermind.server.ejb.StatefulSessionEJBObject.OC4J_invokeMethod(StatefulSessionEJBObject.java:840)
         at RemoteQCServicesAppModule_StatefulSessionBeanWrapper226.doMessage(RemoteQCServicesAppModule_StatefulSessionBeanWrapper226.java:1902)
         at sun.reflect.GeneratedMethodAccessor14.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.rmi.RmiMethodCall.run(RmiMethodCall.java:53)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)

  • Simplest way to restrict access to remote EJB calls

    I'm using weblogic 10.3 and I'm new to security in weblogic. I was looking at the documentation at http://docs.oracle.com/cd/E13222_01/wls/docs103/ConsoleHelp/taskhelp/security/ManageSecurityForDD.html
    but got a little overwhelmed by the many options on how to implement security. Plus, I am getting confused between JDNI security and EJB Layer security (they're not the same thing, right?)
    Can someone explain what the simplest way would be to prevent an "unauthorized" client to make remote EJB calls? For example, I know of the ConnectionFilters that you can implement, which can prevent remote callers from making T3 or IIOP calls if they're not from an authorized IP, etc. This is a good start but ideally I would want to password protect the EJBs, and any EJB client would have to provide this username/password somehow. Or possibly use two-way SSL for t3? The client app would have to provide a certificate to prove that it's trusted.
    To be clear, I don't think I need weblogic to handle any fine-grained access control. I just want to make sure that the client (e.g., a webapp) is a trusted one. Once the EJB container is satisfied that the client is trusted (preferably by user/pass) then the client is free to execute any EJB methods.
    Thanks in advance.
    Edited by: user10123426 on Mar 14, 2012 10:26 AM

    I'm don't think you can do a posture check by MAC address.  If you're using SSLVPN, and you're running Windows,  you can do a Host Scan check for the following registry key:
    HKLM\System\CurrentControlSet\Services\Tcpip\Parameters\Domain
    Then set up a Pre-Login policy that goes Windows->Registry Check->Success->RegCheckOK
                                                                                                         |->Fail->RegCheckFail
    At this point you've just verified that you can read that key and the value is stored for later use.  You're not making an allow/deny decision yet. 
    Then in your Dynamic Access policy you do a Policy check for Location=RegCheckFail, that says "Unable to read registry".  The following DAP policy check looks for Location=RegCheckOK, and validates that the value is your AD domain. 
    Alternatively, you could put a NAC box (ISE or Clean Access) 'behind/after' the VPN box, so although anyone can connect only domain machines (and/or whatever other posture checks you want to make, e.g. Antivirus status) make it through to the rest of the network.

Maybe you are looking for

  • Shared Review End Review, Deadline not working in Acrobat Pro 9 for Acrobat Reader 8 reviewers

    I am testing the features of PDF Shared Reviews on a network server using Acrobat Pro 9 with reviewers using Acrobat Reader 8.1. (All are Windows users.) After initiating the review via the Tracker and having no problem getting the reviewers to comme

  • Looking for a script to automate renaming layer objects, not the layer itself!

    Hey there everyone, I was wondering if there is a possibility to create/have a script for an automated renaming of several named layer objects in Indesign (CS6). The situation, I'm facing is a document for a templating process with at least 80 layers

  • Button Action if Forms

    I have created a form with a Submit Button.  The action in submit is to email the form.  I have set it up to send as an attachment the entire PDF file.  This works perfectly.  Here is my question:  I have set the visibility to be visible but not prin

  • Problem opening PDF recieved from #rd party tool

    we have 2 adobe document from different PDF producers 1 st  is from a 3rd party 2 nd is from Adobe distiller The 1st document doent work in my application when i try to open it although its a PDF doc too ! , it works when i open it in Adode distiller

  • Error/Crash on Start up

    OSX 10.6.8 keeps crashing on Start Up therefore I'm unable to use SpeedGrade (Cs 6.0.4), which is strange while all other applications on Creative Suite work without any problem on my good old MacPro 2,1 (2x3.0 Ghz) ATI4870 9GB What am I missing? Doe