Problems in accessing EJB from stand-alone client

Hi,
I am trying to access a EJB deployed in RI from a stand-alone client. When I run it, I got this exception:
Exception in thread "main" java.rmi.AccessException: CORBA NO_PERMISSION 9998 Ma
ybe; nested exception is:
org.omg.CORBA.NO_PERMISSION: minor code: 9998 completed: Maybe
org.omg.CORBA.NO_PERMISSION: minor code: 9998 completed: Maybe
at java.lang.Class.newInstance0(Native Method)
at java.lang.Class.newInstance(Unknown Source)
at com.sun.corba.ee.internal.iiop.messages.ReplyMessage_1_2.getSystemExc
eption(ReplyMessage_1_2.java:93)
at com.sun.corba.ee.internal.iiop.ClientResponseImpl.getSystemException(
ClientResponseImpl.java:108)
at com.sun.corba.ee.internal.POA.GenericPOAClientSC.invoke(GenericPOACli
entSC.java:136)
at org.omg.CORBA.portable.ObjectImpl._invoke(Unknown Source)
at TheBeanRemoteStub.test(Unknown Source)
at Client.main(Client.java:19)
The following is the code of the client:
System.setProperty(Context.SECURITY_PRINCIPAL, "achong");
System.setProperty(Context.SECURITY_CREDENTIALS, "achong");
Context context = new InitialContext(System.getProperties());
Object object = PortableRemoteObject.narrow(context.lookup("MyBean"), TheBeanHome.class);
TheBeanHome home = (TheBeanHome) object;
I have set "support client choice" while deploying the bean, and set which roles can access which methods. Any idea? Is my code is incorrect?

I have the same problem like you.
If you solve it, please give me a hint.
Thank you very much!
[email protected]

Similar Messages

  • Security exception while trying to access EJB from stand alone client

    Hi!, I am trying a sample EJB application to R&D some security related issues. I want to access EJB through a web application as well as a stand-alone client. I have set approriate <method-permission> in EJB deployment descriptor. I am using users.properties/roles.properties file for authentication mechanism. I am using JBoss 3.2.
    - On the web application side I am using BASIC authentication and the servlet is able to access the EJB OK, as long as I am using a login/password that has access to the EJB.
    - Now I am trying to access the EJB using a stand alone Java class. These are the things I have tried till now:
    =>Created a InitialContext with appropriate principal, credentials and tried getting a reference to EJB home interface. That resulted in security exception.
    =>Logged into a LoginContext by using appropriate JBossSX classes and then tried getting a EJB home interface. Again security exception.
    Now I am not sure what to do. I read at some places about client side container but not sure what that is. Does anyone has any ideas to try? Is there any other way I can make a swing application and a web application authenticate to EJB container?
    Also can anyone point me to any documentation that gives some idea about how the security credentials gets propagated from web application/standalone client to EJB container?

    It would be better if you can post your code...and DD that way we can help you better

  • Accessing JMS from stand-alone client

    I'm currently attempting to access EJBs, JMS topics and JMS queues from a swing client running on a different machine to the application server (in this case, Sun App Server 9).
    I have added the following jars to the classpath: appserv-rt.jar, javaee.jar and imqjmsra.jar, as well as generated EJB stubs. I have specified the two -D options on the command line:
    -Dorg.omg.CORBA.ORBInitialHost=<server>
    -Dorg.omg.CORBA.ORBInitialPort=3700
    I have tried adding my own jndi.properties with:
    java.naming.factory.initial=com.sun.jndi.cosnaming.CNCtxFactory
    java.naming.provider.url=iiop://<server>:3700
    I have also tried without including a jndi.properties file and using the one supplied by the appserv-rt.jar (this causes more errors than adding my own).
    I am able to lookup an EJB using the global JNDI name and successfully invoke methods on the EJB. If I use the java:comp/env context then I receive the same error as I do with the JMS issues which I'm about to describe.
    When I attempt to access the JMS factories, topics and queues using both the java:comp/env and the global JNDI name I receive the following error:
    javax.naming.NameNotFoundException [Root exception is org.omg.CosNaming.NamingCo
    ntextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0]
    at com.sun.jndi.cosnaming.ExceptionMapper.mapException(ExceptionMapper.j
    ava:44)
    at com.sun.jndi.cosnaming.CNCtx.callResolve(CNCtx.java:453)
    at com.sun.jndi.cosnaming.CNCtx.lookup(CNCtx.java:492)
    at com.sun.jndi.cosnaming.CNCtx.lookup(CNCtx.java:470)
    at javax.naming.InitialContext.lookup(InitialContext.java:351)
    The global JNDI name for the topic factory (for example) is jms/TopicConnectionFactory - I have tried both lookups:
    InitialContext context = new InitialContext();
    context.lookup("jms/TopicConnectionFactory") //lookup 1
    context.lookup("java:comp/env/jms/TopicConnectionFactory") //lookup 2The factory is clearly visible in JNDI under the jms/TopicConnectionFactory when I browse the JNDI from the Sun Admin Console.
    I run the application on a separate machine via the standard java.exe -jar myclient.jar (the jar's manifest has the main class and the classpath described above set)
    Does anybody see anything that I could be missing to get JMS lookups to work from a thick client. As mentioned I can lookup EJBs with no problems so I am definitely connecting to the app server correctly - I figure I'm missing another jar or something like that.
    I have also tried adding application-client.xml and sun-application-client.xml descriptors to myclient.jar/META-INF but that doesn't seem to work either, and when I do I don't think the descriptors are being read because I am unable to lookup the EJB with the java:comp/env JNDI reference - I still need to use the global JNDI name. I would like to use the java:comp/env but I'm not certain how I get the application client jar to load these descriptors, or does something in the appserv-rt.jar do that when it is first accessed (a little unsure of this bit).
    My main concern though, even with global JNDI lookups is that the JMS lookups fail and the EJB lookups succeed.
    Any help would be greatly appreciated.
    I tried again with using the jndi.properties file in the appserv-rt.jar rather than setting anything on the InitialContext. After getting past all of the NoClassDefFound errors by adding more of the app server jars onto the client classpath I managed to get something working, however with the information that was spat out on the client console while performing the lookup I'm pretty certain this isn't exactly what I want - it does work however. My concern is that the messages that are being displayed makes me think I have created my own factory locally (or something weird like that). The messages I received were:
    Looking up: jms/TopicConnectionFactory
    23/06/2006 16:40:45 com.sun.messaging.jms.ra.ResourceAdapter start
    INFO: MQJMSRA_RA1101: SJSMQ JMS Resource Adapter starting...
    ================================================================================
    Sun Java(tm) System Message Queue 4.0
    Sun Microsystems, Inc.
    Version: 4.0 (Build 27-a)
    Compile: Thu Mar 2 22:14:05 PST 2006
    Copyright (c) 2006 Sun Microsystems, Inc. All rights reserved.
    SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
    This product includes code licensed from RSA Data Security.
    ================================================================================
    23/06/2006 16:40:46 com.sun.messaging.jms.ra.ResourceAdapter start
    INFO: MQJMSRA_RA1101: SJSMQ JMS ResourceAdaapter configuration=
    raUID =null
    brokerType =REMOTE
    brokerInstanceName =imqbroker
    brokerBindAddress =null
    brokerPort =7676
    brokerHomeDir =/u2/sas9/imq/bin/..
    brokerVarDir =/u2/sas9/domains/domain1/imq
    brokerJavaDir =/usr/java
    brokerArgs =null
    brokerStartTimeout =60000
    adminUsername =admin
    adminPassFile =/var/tmp/asmq40969.tmp
    useJNDIRmiServiceURL =true
    rmiRegistryPort =8686
    startRmiRegistry =false
    useSSLJMXConnector =true
    brokerEnableHA =false
    clusterId =null
    brokerId =null
    jmxServiceURL =null
    dbType =null
    dbProps ={}
    dsProps ={}
    ConnectionURL =mq://<server>:7676/
    UserName =guest
    ReconnectEnabled =true
    ReconnectInterval =5000
    ReconnectAttempts =3
    AddressListBehavior =RANDOM
    AddressListIterations =3
    InAppClientContainer =true
    InClusteredContainer =false
    GroupName =null
    23/06/2006 16:40:46 com.sun.messaging.jms.ra.ResourceAdapter start
    INFO: MQJMSRA_RA1101: start:SJSMQ JMSRA Connection Factory Config={imqOverrideJM
    SPriority=false, imqConsumerFlowLimit=1000, imqOverrideJMSExpiration=false, imqA
    ddressListIterations=3, imqLoadMaxToServerSession=true, imqConnectionType=TCP, i
    mqPingInterval=30, imqSetJMSXUserID=false, imqConfiguredClientID=, imqSSLProvide
    rClassname=com.sun.net.ssl.internal.ssl.Provider, imqJMSDeliveryMode=PERSISTENT,
    imqConnectionFlowLimit=1000, imqConnectionURL=http://localhost/imq/tunnel, imqB
    rokerServiceName=, imqJMSPriority=4, imqBrokerHostName=localhost, imqJMSExpirati
    on=0, imqAckOnProduce=, imqEnableSharedClientID=false, imqAckTimeout=0, imqAckOn
    Acknowledge=, imqConsumerFlowThreshold=50, imqDefaultPassword=guest, imqQueueBro
    wserMaxMessagesPerRetrieve=1000, imqDefaultUsername=guest, imqReconnectEnabled=f
    alse, imqConnectionFlowCount=100, imqAddressListBehavior=RANDOM, imqReconnectAtt
    empts=3, imqSetJMSXAppID=false, imqConnectionHandler=com.sun.messaging.jmq.jmscl
    ient.protocol.tcp.TCPStreamHandler, imqSetJMSXRcvTimestamp=false, imqBrokerServi
    cePort=0, imqDisableSetClientID=false, imqSetJMSXConsumerTXID=false, imqOverride
    JMSDeliveryMode=false, imqBrokerHostPort=7676, imqQueueBrowserRetrieveTimeout=60
    000, imqSetJMSXProducerTXID=false, imqSSLIsHostTrusted=false, imqConnectionFlowL
    imitEnabled=false, imqReconnectInterval=5000, imqAddressList=mq://<server>:7676/, i
    mqOverrideJMSHeadersToTemporaryDestinations=false}
    23/06/2006 16:40:46 com.sun.messaging.jms.ra.ResourceAdapter start
    INFO: MQJMSRA_RA1101: SJSMQ JMSRA Started
    23/06/2006 16:40:46 com.sun.messaging.jms.ra.ManagedConnectionFactory setPasswor
    d
    INFO: MQJMSRA_MF1101: setPassword:NOT setting default value
    23/06/2006 16:40:46 com.sun.messaging.jms.ra.ManagedConnectionFactory setAddress
    List
    INFO: MQJMSRA_MF1101: setAddressList:NOT setting default value=localhost
    23/06/2006 16:40:46 com.sun.messaging.jms.ra.ManagedConnectionFactory setUserNam
    e
    INFO: MQJMSRA_MF1101: setUserName:NOT setting default value=guest
    23/06/2006 16:40:46 com.sun.messaging.jms.ra.ManagedConnection <init>
    INFO: MQJMSRA_MC1101: constructor:Created mcId=1:xacId=4902744336909087232:Using
    xacf config={imqOverrideJMSPriority=false, imqConsumerFlowLimit=1000, imqOverri
    deJMSExpiration=false, imqAddressListIterations=3, imqLoadMaxToServerSession=tru
    e, imqConnectionType=TCP, imqPingInterval=30, imqSetJMSXUserID=false, imqConfigu
    redClientID=, imqSSLProviderClassname=com.sun.net.ssl.internal.ssl.Provider, imq
    JMSDeliveryMode=PERSISTENT, imqConnectionFlowLimit=1000, imqConnectionURL=http:/
    /localhost/imq/tunnel, imqBrokerServiceName=, imqJMSPriority=4, imqBrokerHostNam
    e=localhost, imqJMSExpiration=0, imqAckOnProduce=, imqEnableSharedClientID=false
    , imqAckTimeout=0, imqAckOnAcknowledge=, imqConsumerFlowThreshold=50, imqDefault
    Password=guest, imqQueueBrowserMaxMessagesPerRetrieve=1000, imqDefaultUsername=g
    uest, imqReconnectEnabled=true, imqConnectionFlowCount=100, imqAddressListBehavi
    or=RANDOM, imqReconnectAttempts=3, imqSetJMSXAppID=false, imqConnectionHandler=c
    om.sun.messaging.jmq.jmsclient.protocol.tcp.TCPStreamHandler, imqSetJMSXRcvTimes
    tamp=false, imqBrokerServicePort=0, imqDisableSetClientID=false, imqSetJMSXConsu
    merTXID=false, imqOverrideJMSDeliveryMode=false, imqBrokerHostPort=7676, imqQueu
    eBrowserRetrieveTimeout=60000, imqSetJMSXProducerTXID=false, imqSSLIsHostTrusted
    =false, imqConnectionFlowLimitEnabled=false, imqReconnectInterval=5000, imqAddre
    ssList=mq://<server>:7676/, imqOverrideJMSHeadersToTemporaryDestinations=false}
    23/06/2006 16:40:46 com.sun.messaging.jms.ra.ManagedConnection <init>
    INFO: MQJMSRA_MC1101: constructor:Created mcId=2:xacId=4902744336909100288:Using
    xacf config={imqOverrideJMSPriority=false, imqConsumerFlowLimit=1000, imqOverri
    deJMSExpiration=false, imqAddressListIterations=3, imqLoadMaxToServerSession=tru
    e, imqConnectionType=TCP, imqPingInterval=30, imqSetJMSXUserID=false, imqConfigu
    redClientID=, imqSSLProviderClassname=com.sun.net.ssl.internal.ssl.Provider, imq
    JMSDeliveryMode=PERSISTENT, imqConnectionFlowLimit=1000, imqConnectionURL=http:/
    /localhost/imq/tunnel, imqBrokerServiceName=, imqJMSPriority=4, imqBrokerHostNam
    e=localhost, imqJMSExpiration=0, imqAckOnProduce=, imqEnableSharedClientID=false
    , imqAckTimeout=0, imqAckOnAcknowledge=, imqConsumerFlowThreshold=50, imqDefault
    Password=guest, imqQueueBrowserMaxMessagesPerRetrieve=1000, imqDefaultUsername=g
    uest, imqReconnectEnabled=true, imqConnectionFlowCount=100, imqAddressListBehavi
    or=RANDOM, imqReconnectAttempts=3, imqSetJMSXAppID=false, imqConnectionHandler=c
    om.sun.messaging.jmq.jmsclient.protocol.tcp.TCPStreamHandler, imqSetJMSXRcvTimes
    tamp=false, imqBrokerServicePort=0, imqDisableSetClientID=false, imqSetJMSXConsu
    merTXID=false, imqOverrideJMSDeliveryMode=false, imqBrokerHostPort=7676, imqQueu
    eBrowserRetrieveTimeout=60000, imqSetJMSXProducerTXID=false, imqSSLIsHostTrusted
    =false, imqConnectionFlowLimitEnabled=false, imqReconnectInterval=5000, imqAddre
    ssList=mq://<server>:7676/, imqOverrideJMSHeadersToTemporaryDestinations=false}
    23/06/2006 16:40:46 com.sun.messaging.jms.ra.ManagedConnection <init>
    INFO: MQJMSRA_MC1101: constructor:Created mcId=3:xacId=4902744336909108480:Using
    xacf config={imqOverrideJMSPriority=false, imqConsumerFlowLimit=1000, imqOverri
    deJMSExpiration=false, imqAddressListIterations=3, imqLoadMaxToServerSession=tru
    e, imqConnectionType=TCP, imqPingInterval=30, imqSetJMSXUserID=false, imqConfigu
    redClientID=, imqSSLProviderClassname=com.sun.net.ssl.internal.ssl.Provider, imq
    JMSDeliveryMode=PERSISTENT, imqConnectionFlowLimit=1000, imqConnectionURL=http:/
    /localhost/imq/tunnel, imqBrokerServiceName=, imqJMSPriority=4, imqBrokerHostNam
    e=localhost, imqJMSExpiration=0, imqAckOnProduce=, imqEnableSharedClientID=false
    , imqAckTimeout=0, imqAckOnAcknowledge=, imqConsumerFlowThreshold=50, imqDefault
    Password=guest, imqQueueBrowserMaxMessagesPerRetrieve=1000, imqDefaultUsername=g
    uest, imqReconnectEnabled=true, imqConnectionFlowCount=100, imqAddressListBehavi
    or=RANDOM, imqReconnectAttempts=3, imqSetJMSXAppID=false, imqConnectionHandler=c
    om.sun.messaging.jmq.jmsclient.protocol.tcp.TCPStreamHandler, imqSetJMSXRcvTimes
    tamp=false, imqBrokerServicePort=0, imqDisableSetClientID=false, imqSetJMSXConsu
    merTXID=false, imqOverrideJMSDeliveryMode=false, imqBrokerHostPort=7676, imqQueu
    eBrowserRetrieveTimeout=60000, imqSetJMSXProducerTXID=false, imqSSLIsHostTrusted
    =false, imqConnectionFlowLimitEnabled=false, imqReconnectInterval=5000, imqAddre
    ssList=mq://<server>:7676/, imqOverrideJMSHeadersToTemporaryDestinations=false}
    23/06/2006 16:40:46 com.sun.messaging.jms.ra.ManagedConnection <init>
    INFO: MQJMSRA_MC1101: constructor:Created mcId=4:xacId=4902744336909117696:Using
    xacf config={imqOverrideJMSPriority=false, imqConsumerFlowLimit=1000, imqOverri
    deJMSExpiration=false, imqAddressListIterations=3, imqLoadMaxToServerSession=tru
    e, imqConnectionType=TCP, imqPingInterval=30, imqSetJMSXUserID=false, imqConfigu
    redClientID=, imqSSLProviderClassname=com.sun.net.ssl.internal.ssl.Provider, imq
    JMSDeliveryMode=PERSISTENT, imqConnectionFlowLimit=1000, imqConnectionURL=http:/
    /localhost/imq/tunnel, imqBrokerServiceName=, imqJMSPriority=4, imqBrokerHostNam
    e=localhost, imqJMSExpiration=0, imqAckOnProduce=, imqEnableSharedClientID=false
    , imqAckTimeout=0, imqAckOnAcknowledge=, imqConsumerFlowThreshold=50, imqDefault
    Password=guest, imqQueueBrowserMaxMessagesPerRetrieve=1000, imqDefaultUsername=g
    uest, imqReconnectEnabled=true, imqConnectionFlowCount=100, imqAddressListBehavi
    or=RANDOM, imqReconnectAttempts=3, imqSetJMSXAppID=false, imqConnectionHandler=c
    om.sun.messaging.jmq.jmsclient.protocol.tcp.TCPStreamHandler, imqSetJMSXRcvTimes
    tamp=false, imqBrokerServicePort=0, imqDisableSetClientID=false, imqSetJMSXConsu
    merTXID=false, imqOverrideJMSDeliveryMode=false, imqBrokerHostPort=7676, imqQueu
    eBrowserRetrieveTimeout=60000, imqSetJMSXProducerTXID=false, imqSSLIsHostTrusted
    =false, imqConnectionFlowLimitEnabled=false, imqReconnectInterval=5000, imqAddre
    ssList=mq://<server>:7676/, imqOverrideJMSHeadersToTemporaryDestinations=false}
    23/06/2006 16:40:46 com.sun.messaging.jms.ra.ManagedConnection <init>
    INFO: MQJMSRA_MC1101: constructor:Created mcId=5:xacId=4902744336909126400:Using
    xacf config={imqOverrideJMSPriority=false, imqConsumerFlowLimit=1000, imqOverri
    deJMSExpiration=false, imqAddressListIterations=3, imqLoadMaxToServerSession=tru
    e, imqConnectionType=TCP, imqPingInterval=30, imqSetJMSXUserID=false, imqConfigu
    redClientID=, imqSSLProviderClassname=com.sun.net.ssl.internal.ssl.Provider, imq
    JMSDeliveryMode=PERSISTENT, imqConnectionFlowLimit=1000, imqConnectionURL=http:/
    /localhost/imq/tunnel, imqBrokerServiceName=, imqJMSPriority=4, imqBrokerHostNam
    e=localhost, imqJMSExpiration=0, imqAckOnProduce=, imqEnableSharedClientID=false
    , imqAckTimeout=0, imqAckOnAcknowledge=, imqConsumerFlowThreshold=50, imqDefault
    Password=guest, imqQueueBrowserMaxMessagesPerRetrieve=1000, imqDefaultUsername=g
    uest, imqReconnectEnabled=true, imqConnectionFlowCount=100, imqAddressListBehavi
    or=RANDOM, imqReconnectAttempts=3, imqSetJMSXAppID=false, imqConnectionHandler=c
    om.sun.messaging.jmq.jmsclient.protocol.tcp.TCPStreamHandler, imqSetJMSXRcvTimes
    tamp=false, imqBrokerServicePort=0, imqDisableSetClientID=false, imqSetJMSXConsu
    merTXID=false, imqOverrideJMSDeliveryMode=false, imqBrokerHostPort=7676, imqQueu
    eBrowserRetrieveTimeout=60000, imqSetJMSXProducerTXID=false, imqSSLIsHostTrusted
    =false, imqConnectionFlowLimitEnabled=false, imqReconnectInterval=5000, imqAddre
    ssList=mq://<server>:7676/, imqOverrideJMSHeadersToTemporaryDestinations=false}
    23/06/2006 16:40:46 com.sun.messaging.jms.ra.ManagedConnection <init>
    INFO: MQJMSRA_MC1101: constructor:Created mcId=6:xacId=4902744336909134336:Using
    xacf config={imqOverrideJMSPriority=false, imqConsumerFlowLimit=1000, imqOverri
    deJMSExpiration=false, imqAddressListIterations=3, imqLoadMaxToServerSession=tru
    e, imqConnectionType=TCP, imqPingInterval=30, imqSetJMSXUserID=false, imqConfigu
    redClientID=, imqSSLProviderClassname=com.sun.net.ssl.internal.ssl.Provider, imq
    JMSDeliveryMode=PERSISTENT, imqConnectionFlowLimit=1000, imqConnectionURL=http:/
    /localhost/imq/tunnel, imqBrokerServiceName=, imqJMSPriority=4, imqBrokerHostNam
    e=localhost, imqJMSExpiration=0, imqAckOnProduce=, imqEnableSharedClientID=false
    , imqAckTimeout=0, imqAckOnAcknowledge=, imqConsumerFlowThreshold=50, imqDefault
    Password=guest, imqQueueBrowserMaxMessagesPerRetrieve=1000, imqDefaultUsername=g
    uest, imqReconnectEnabled=true, imqConnectionFlowCount=100, imqAddressListBehavi
    or=RANDOM, imqReconnectAttempts=3, imqSetJMSXAppID=false, imqConnectionHandler=c
    om.sun.messaging.jmq.jmsclient.protocol.tcp.TCPStreamHandler, imqSetJMSXRcvTimes
    tamp=false, imqBrokerServicePort=0, imqDisableSetClientID=false, imqSetJMSXConsu
    merTXID=false, imqOverrideJMSDeliveryMode=false, imqBrokerHostPort=7676, imqQueu
    eBrowserRetrieveTimeout=60000, imqSetJMSXProducerTXID=false, imqSSLIsHostTrusted
    =false, imqConnectionFlowLimitEnabled=false, imqReconnectInterval=5000, imqAddre
    ssList=mq://<server>:7676/, imqOverrideJMSHeadersToTemporaryDestinations=false}
    23/06/2006 16:40:47 com.sun.messaging.jms.ra.ManagedConnection <init>
    INFO: MQJMSRA_MC1101: constructor:Created mcId=7:xacId=4902744336909143040:Using
    xacf config={imqOverrideJMSPriority=false, imqConsumerFlowLimit=1000, imqOverri
    deJMSExpiration=false, imqAddressListIterations=3, imqLoadMaxToServerSession=tru
    e, imqConnectionType=TCP, imqPingInterval=30, imqSetJMSXUserID=false, imqConfigu
    redClientID=, imqSSLProviderClassname=com.sun.net.ssl.internal.ssl.Provider, imq
    JMSDeliveryMode=PERSISTENT, imqConnectionFlowLimit=1000, imqConnectionURL=http:/
    /localhost/imq/tunnel, imqBrokerServiceName=, imqJMSPriority=4, imqBrokerHostNam
    e=localhost, imqJMSExpiration=0, imqAckOnProduce=, imqEnableSharedClientID=false
    , imqAckTimeout=0, imqAckOnAcknowledge=, imqConsumerFlowThreshold=50, imqDefault
    Password=guest, imqQueueBrowserMaxMessagesPerRetrieve=1000, imqDefaultUsername=g
    uest, imqReconnectEnabled=true, imqConnectionFlowCount=100, imqAddressListBehavi
    or=RANDOM, imqReconnectAttempts=3, imqSetJMSXAppID=false, imqConnectionHandler=c
    om.sun.messaging.jmq.jmsclient.protocol.tcp.TCPStreamHandler, imqSetJMSXRcvTimes
    tamp=false, imqBrokerServicePort=0, imqDisableSetClientID=false, imqSetJMSXConsu
    merTXID=false, imqOverrideJMSDeliveryMode=false, imqBrokerHostPort=7676, imqQueu
    eBrowserRetrieveTimeout=60000, imqSetJMSXProducerTXID=false, imqSSLIsHostTrusted
    =false, imqConnectionFlowLimitEnabled=false, imqReconnectInterval=5000, imqAddre
    ssList=mq://<server>:7676/, imqOverrideJMSHeadersToTemporaryDestinations=false}
    23/06/2006 16:40:47 com.sun.messaging.jms.ra.ManagedConnection <init>
    INFO: MQJMSRA_MC1101: constructor:Created mcId=8:xacId=4902744336909151488:Using
    xacf config={imqOverrideJMSPriority=false, imqConsumerFlowLimit=1000, imqOverri
    deJMSExpiration=false, imqAddressListIterations=3, imqLoadMaxToServerSession=tru
    e, imqConnectionType=TCP, imqPingInterval=30, imqSetJMSXUserID=false, imqConfigu
    redClientID=, imqSSLProviderClassname=com.sun.net.ssl.internal.ssl.Provider, imq
    JMSDeliveryMode=PERSISTENT, imqConnectionFlowLimit=1000, imqConnectionURL=http:/
    /localhost/imq/tunnel, imqBrokerServiceName=, imqJMSPriority=4, imqBrokerHostNam
    e=localhost, imqJMSExpiration=0, imqAckOnProduce=, imqEnableSharedClientID=false
    , imqAckTimeout=0, imqAckOnAcknowledge=, imqConsumerFlowThreshold=50, imqDefault
    Password=guest, imqQueueBrowserMaxMessagesPerRetrieve=1000, imqDefaultUsername=g
    uest, imqReconnectEnabled=true, imqConnectionFlowCount=100, imqAddressListBehavi
    or=RANDOM, imqReconnectAttempts=3, imqSetJMSXAppID=false, imqConnectionHandler=c
    om.sun.messaging.jmq.jmsclient.protocol.tcp.TCPStreamHandler, imqSetJMSXRcvTimes
    tamp=false, imqBrokerServicePort=0, imqDisableSetClientID=false, imqSetJMSXConsu
    merTXID=false, imqOverrideJMSDeliveryMode=false, imqBrokerHostPort=7676, imqQueu
    eBrowserRetrieveTimeout=60000, imqSetJMSXProducerTXID=false, imqSSLIsHostTrusted
    =false, imqConnectionFlowLimitEnabled=false, imqReconnectInterval=5000, imqAddre
    ssList=mq://<server>:7676/, imqOverrideJMSHeadersToTemporaryDestinations=false}
    Looking up: jms/topic/MyTopic
    Does anybody know what these messages mean and also whether or not this is what I should be seeing on the client side?

    Greetings!!
    Dear danrak,
    Probably u must ahve found a solution to this issue.
    I am facing a similar problem.
    I can lookup EJBs but not JMS factoriers.
    can u please guide me in this respect!
    this is my output
    Jan 5, 2007 6:09:38 PM com.sun.messaging.jms.ra.ResourceAdapter start
    INFO: MQJMSRA_RA1101: SJSMQ JMS Resource Adapter starting...
    ================================================================================
    Sun Java(tm) System Message Queue 4.0
    Sun Microsystems, Inc.
    Version: 4.0 (Build 27-a)
    Compile: Thu 03/02/2006
    Copyright (c) 2006 Sun Microsystems, Inc. All rights reserved.
    SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
    This product includes code licensed from RSA Data Security.
    ================================================================================
    Jan 5, 2007 6:09:39 PM com.sun.messaging.jms.ra.ResourceAdapter start
    INFO: MQJMSRA_RA1101: SJSMQ JMS ResourceAdaapter configuration=
         raUID =null
         brokerType =REMOTE
         brokerInstanceName =imqbroker
         brokerBindAddress =null
         brokerPort =7676
         brokerHomeDir =C:\Sun\AppServer\imq\bin\..
         brokerVarDir =C:/Sun/AppServer/domains/domain1\imq
         brokerJavaDir =C:/Sun/AppServer/jdk
         brokerArgs =null
         brokerStartTimeout =60000
         adminUsername =admin
         adminPassFile =C:\Documents and Settings\Administrator\Local Settings\Temp\asmq36440.tmp
         useJNDIRmiServiceURL =true
         rmiRegistryPort =1099
         startRmiRegistry =true
         useSSLJMXConnector =true
         brokerEnableHA =false
         clusterId =null
         brokerId =null
         jmxServiceURL =null
         dbType =null
         dbProps ={}
         dsProps ={}
         ConnectionURL =mq://FarhanJan:7676/
         UserName =guest
         ReconnectEnabled =true
         ReconnectInterval =5000
         ReconnectAttempts =3
         AddressListBehavior =PRIORITY
         AddressListIterations =3
         InAppClientContainer =true
         InClusteredContainer =false
         GroupName =null
    Jan 5, 2007 6:09:39 PM com.sun.messaging.jms.ra.ResourceAdapter start
    INFO: MQJMSRA_RA1101: start:SJSMQ JMSRA Connection Factory Config={imqOverrideJMSPriority=false, imqConsumerFlowLimit=1000, imqOverrideJMSExpiration=false, imqAddressListIterations=3, imqLoadMaxToServerSession=true, imqConnectionType=TCP, imqPingInterval=30, imqSetJMSXUserID=false, imqConfiguredClientID=, imqSSLProviderClassname=com.sun.net.ssl.internal.ssl.Provider, imqJMSDeliveryMode=PERSISTENT, imqConnectionFlowLimit=1000, imqConnectionURL=http://localhost/imq/tunnel, imqBrokerServiceName=, imqJMSPriority=4, imqBrokerHostName=localhost, imqJMSExpiration=0, imqAckOnProduce=, imqEnableSharedClientID=false, imqAckTimeout=0, imqAckOnAcknowledge=, imqConsumerFlowThreshold=50, imqDefaultPassword=guest, imqQueueBrowserMaxMessagesPerRetrieve=1000, imqDefaultUsername=guest, imqReconnectEnabled=false, imqConnectionFlowCount=100, imqAddressListBehavior=PRIORITY, imqReconnectAttempts=3, imqSetJMSXAppID=false, imqConnectionHandler=com.sun.messaging.jmq.jmsclient.protocol.tcp.TCPStreamHandler, imqSetJMSXRcvTimestamp=false, imqBrokerServicePort=0, imqDisableSetClientID=false, imqSetJMSXConsumerTXID=false, imqOverrideJMSDeliveryMode=false, imqBrokerHostPort=7676, imqQueueBrowserRetrieveTimeout=60000, imqSetJMSXProducerTXID=false, imqSSLIsHostTrusted=false, imqConnectionFlowLimitEnabled=false, imqReconnectInterval=5000, imqAddressList=mq://FarhanJan:7676/, imqOverrideJMSHeadersToTemporaryDestinations=false}
    Jan 5, 2007 6:09:39 PM com.sun.messaging.jms.ra.ResourceAdapter start
    INFO: MQJMSRA_RA1101: SJSMQ JMSRA Started
    Jan 5, 2007 6:09:43 PM com.sun.messaging.jms.ra.ManagedConnectionFactory setPassword
    INFO: MQJMSRA_MF1101: setPassword:NOT setting default value
    Jan 5, 2007 6:09:43 PM com.sun.messaging.jms.ra.ManagedConnectionFactory setAddressList
    INFO: MQJMSRA_MF1101: setAddressList:NOT setting default value=localhost
    Jan 5, 2007 6:09:43 PM com.sun.messaging.jms.ra.ManagedConnectionFactory setUserName
    INFO: MQJMSRA_MF1101: setUserName:NOT setting default value=guest
    Jan 5, 2007 6:09:45 PM com.sun.enterprise.connectors.ConnectorConnectionPoolAdminServiceImpl obtainManagedConnectionFactory
    SEVERE: mcf_add_toregistry_failed
    Jan 5, 2007 6:09:45 PM com.sun.enterprise.naming.SerialContext lookup
    SEVERE: NAM0004: Exception during name lookup : {0}
    com.sun.enterprise.connectors.ConnectorRuntimeException: Failed to register MCF in registry
    Your Help will be highly appreciated.

  • How to access my application on a SunOne 8.0.0_01 from a stand-alone client

    Hello,
    perhaps someone of you knows how can solve my problem accessing my J2EE-Application with EJBs, etc. from a stand-alone client.
    In the classpath of my client the appserv-rt.jar and j2ee.jar are accessible. In the sourcecode I tried to access the server with:
    Properties env = new Properties();
    env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.cosnaming.CNCtxFactory");       
    env.put(Context.PROVIDER_URL, "iiop://myserver:3700");
    Context initialContext = new InitialContext(env);
    Object objRef = initialContext.lookup("MySessionBean");With these setting I get this exception:
    java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
         java.rmi.RemoteException
         at com.sun.corba.se.internal.iiop.ShutdownUtilDelegate.mapSystemException(ShutdownUtilDelegate.java:64)
         at javax.rmi.CORBA.Util.mapSystemException(Util.java:65)
         at de.fhhn.ectsmodulclient.interfaces._ECTSModulSession_Stub.getStudiengaenge(Unknown Source)
         at de.hshn.ectsmodulclient.web.StandAloneClient.showStudiengaenge(StandAloneClient.java:68)
         at de.hshn.ectsmodulclient.web.StandAloneClient.main(StandAloneClient.java:90)
    Caused by: java.rmi.RemoteException
         at com.sun.enterprise.iiop.POAProtocolMgr.mapException(POAProtocolMgr.java:213)
         at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:797)
         at com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInvocationHandler.java:137)
         at $Proxy36.getStudiengaenge(Unknown Source)Can anybody tell me what the problem is and probably how I can make it work?
    Are there some "hidden" configuration-parameters on the serverside that I have to set/change?
    Thank you for your help!
    Greetings
    Gregor Ewald

    Did your stand-alone client on the remote machine encounter the same error as your tomcat attempt? Try looking in the tomcat log for a more detailed stack trace.
    I'm able to do this from tomcat 5.0 on a remote machine with JDK 1.5 and the latest version of the J2EE 1.4 SDK release (AS 8.2) for an appserver running on linux or solaris. You might want to try with those versions as well.
    --ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Stand alone client for remote EJB corba error

    Regarding problem below, I've checked System env variables
    that weblogic server is using for CORBA classes:
    javax.rmi.CORBA.UtilClass=weblogic.iiop.UtilDelegateImpl
    org.omg.CORBA.ORBSingletonClass=weblogic.corba.orb.ORB
    org.omg.CORBA.ORBClass weblogic.corba.orb.ORB
    javax.rmi.CORBA.PortableRemoteObjectClass=weblogic.iiop.PortableRemoteObjectDelegateImpl
    But these are server classes and not found in wlclient.jar and wljmsclient.jar. What classes should be used for client? What needs to be set in order to get successful remote RMI/EJB call to weblogic server?
    Original post:
    I have a stand alone spring client for simple stateless session EJB deployed on weblogic 9.2. I'm using spring (jdk 1.5) to call this remote EJB and the only way I can succeed is to have full weblogic.jar in my bootstrap classpath. Otherwise I get corba error:
    CORBA BAD_PARAM 0 No; nested exception is:
    org.omg.CORBA.BAD_PARAM: vmcid: 0x0 minor code: 0 completed: No
    Interestingly, within same client I have JMS call to weblogic JMS and that fails if weblogic.jar is in boot classpath. Getting rid of weblogic.jar from boot classpath works if I have wlclient.jar and wljmsclient.jar in regular classpath (as per weblogic docs). I would think that for stand alone client all I would need is to weblogic client jars, why should I need to have full weblogic.jar?
    I can't get those work together with same classpath. I wonder if anybody has some pointers and/or advice. I was looking to set system parameters for corba for weblogic client that maybe could help:
    org.omg.CORBA.ORBClass
    org.omg.CORBA.ORBSingletonClass
    javax.rmi.CORBA.UtilClass
    javax.rmi.CORBA.StubClass
    javax.rmi.CORBA.PortableRemoteObjectClass
    But I can't find definitive answer.
    Regards,
    -pp
    Edited by mr.papini at 06/28/2007 9:05 AM

    I'm stuck exactly with the same issue while trying to port my application from weblogic to jboss.
    I tried to specify different ORB implementations (JacORB, OpenORB) for jvm option org.omg.CORBA.ORBClass, but JBoss couldn't get them instantiated. Native Sun implementation which is used in JBoss by default and can be instantiated, apparently is not fully compatible with weblogic security module.
    So did you manage to find out the solution?
    Edited by DigitalDude at 04/09/2008 11:47 PM

  • Looking up EJBs from a java client

    While trying to migrate my application from standalone-oc4j
    to Oracle Application Server 10g, I ran into the following problem.
    My application has a stateless session bean. When trying to lookup the bean (from a java client), I get the following exception:
    javax.naming.NamingException: Lookup error: javax.naming.AuthenticationException
    Invalid username/password for UnifyoccEAR (ias_admin)
    My code used the username/password I used to log into web-based console (which I used to deploy the application). The lookup code follows:
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY,
    OracleJASLayer.INITIAL_CONTEXT_FACTORY);
    env.put(Context.PROVIDER_URL, "ormi://localhost:3201/UnifyoccEAR");
    env.put(Context.SECURITY_AUTHENTICATION, "simple");
    env.put(Context.SECURITY_PRINCIPAL, username);
    env.put(Context.SECURITY_CREDENTIALS, password);
    Context ctx = new InitialContext(env);
    Object obj = ctx.lookup("unify/nxj/controlCenters/occ/ControlCenterEJB");
    On a whim, I tried the old SCOTT/TIGER username/password and got the following
    exception:
    javax.naming.NoPermissionException: Not allowed to look up unify/nxj/controlCenters/occ/ControlCenterEJB,
    check the namespace-access tag setting in orion-application.xml for details
    So evidently, SCOTT/TIGER is in the security database used by the app (but isn't
    authorized) while the ias_admin user is not in the security database.
    I have the following questions:
    1. In the default configuration, is there a username/password I can use to
    lookup EJB homes in the jndi namespace of an OC4J instance? If so, what
    is it?
    2. Where is the security database? I tried looking in the web-based console
    to find how to configure security and could not figure it out. I did find
    the Security page for the application, but when I tried to add a user,
    it had no effect. Furthermore, this page did not show a user entry for
    SCOTT; hence, it doesn't seem that OC4J is actually using the information
    on this page. This is strange because the path to this page is:
    Farm > Application Server: ias_admin.lab10.sac.unify.com > OC4J: home > Application: UnifyoccEAR > Security
    I then went to the Security page for the default application and found
    that it did have a SCOTT user. So I added a new user and tried to run
    my java client. This resulted in the javax.naming.AuthenticationException
    described above (I was expected the NoPermissionException encounted when
    using SCOTT/TIGER). Next, I used the Security page for the default application
    to change the password for SCOTT and reran my java client using SCOTT/TIGER.
    This time I was expecting an AuthenticationException exception, but got the
    NoPermission exception. Therefore, it seems that OC4J isn't using this
    security data either.
    Hunting in the console (again) for the security database, I stumble accross
    the Infrasturcture page and see an Identity Management section and see that
    it is configure to use an Oracle Internet Directory server. Using
    <ORACLE_HOME>/bin/oidadmin, I connect to the directory server and look
    for the SCOTT user. I don't find it, so I believe that this can't be the
    security database either.
    3. Finally, how do I configure the OC4J instance such that it will allow
    anonymous users to lookup my EJB from a java client?
    Please help a confused and frustrated user.

    Looking at your example, it looks like you are using a J2EE client container or some properties file to specify the JNDI environment used to create the initial context (for you use the no-arg constructor to InitialContext). Since our application needs to the ability to dynamically connect to ejb's running on different Java application servers (e.g., WebLogic, WebSphere, JBoss), such an approach will not work. Instead we must do it the old-fashioned way and pass the jdni connection info to the InitialContext constructor.
    In any event, our problem isn't how to write the connection code, it is how to test it. Specifically, we can't figure out a valid username/password that will allow us to look up the home. Nor can we figure out how to configure security for the oc4j instance.

  • Access EJB from Servlet that in different archive?

    <font class="mediumtxt">package kyro.ejb.session;
    import javax.ejb.*;
    import javax.persistence.EntityManager;
    import javax.persistence.PersistenceContext;
    @Stateless(name="StandAlone")
    @Remote(StandAlone.class)
    public class StandAloneBean
    implements StandAlone, StandAloneLocal
    public StandAloneBean() {
    public String sayHello() {     
    return "sayHello";
    I want to access ejb from servlet that .war and .jar not in single .ear. I want to try that just with annotation not xml descriptor cause is easy to understand for me. I use Glassfish. But i can't lookup that ejb. How can i lookup that ejb with jndi? Can't you give me example of servlet to access that? I not use JNDI.properties, are that caused i can't access my ejb? I just thing .war and.jar in one server, are i have to used JNDI.properties. can you explain how to use JNDI.properties in servlet or separate file?
    </font>

    But i can't lookup that ejb. How are you trying and what exception is occurring?
    How can i lookup that ejb with jndi? [https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html|https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html]
    m

  • Stand-Alone Client to Access JMS Resource without ACC

    I'am having trouble to run the JMS SimpleProducer example from the JMS tutorial as a Stand-Alone application.
    Although its works as suggested when run inside an ACC. (The tutorial I refer to: http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JMS5.html#wp79822 )
    The JMS provider I use is Sun Java System Application Server Platform Edition 8.2 (build b06-fcs).
    Its documentation states that one could run a client outside the ACC and still access JMS:
    http://docs.sun.com/source/819-0217-10/dgacc.html#wp1022252
    Following those instructions throws an exeption when invoking
    Context jndiContext = new InitialContext();
    jndiContext.lookup("jms/ConnectionFactory");Of course I did add the three required libraries (appserv-rt.jar, j2ee.jar, imqjmsra.jar) and added the VM arguments to point the client's orb to the JSAS. Also, the JMS administed object exist, admin console shows them and example in ACC worked fine.
    The last step of the tutorial says: "� As long as the client environment is set appropriately and the JVM is compatible, you merely need to run the main class." Is there anything I miss? Btw. I run the example on Mac OS X 10.4.6 and Java 1.5.0_06.
    Why does the exception refer to org/netbeans/modules/schema2beans/BaseBeanThat is the exception thrown:
    Destination name is jms/Queue
    04.04.2006 16:25:12 com.sun.corba.ee.spi.logging.LogWrapperBase doLog
    INFO: "IOP00710299: (INTERNAL) Successfully created IIOP listener on the specified host/port: all interfaces/49648"
    Exception in thread "main" java.lang.NoClassDefFoundError: org/netbeans/modules/schema2beans/BaseBean
            at java.lang.ClassLoader.defineClass1(Native Method)
            at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
            at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
            at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
            at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
            at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
            at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
            at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
            at com.sun.enterprise.connectors.ConnectorAdminServicesFactory.getService(ConnectorAdminServicesFactory.java:35)
            at com.sun.enterprise.connectors.ConnectorRuntime.createServices(ConnectorRuntime.java:109)
            at com.sun.enterprise.connectors.ConnectorRuntime.getRuntime(ConnectorRuntime.java:71)
            at com.sun.enterprise.naming.factory.ConnectorObjectFactory.getObjectInstance(ConnectorObjectFactory.java:55)
            at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
            at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:293)
            at javax.naming.InitialContext.lookup(InitialContext.java:351)
            at SimpleProducer.main(SimpleProducer.java:66)
    Java Result: 1

    Adding a fourth jar from the JSAS to the standalone application resolves the problem: appserv-admin.jar - available at install_dir/lib/appserv-admin.jar
    Does the tutorial miss this or is there anything I missunderstood?

  • Stand-alone client - lookup problem

    I have a stand-alone Java client application (ContactClient) that I want to use to access an EJB called Contact. I am using J2EE, deploying with deploytool. The EJB has a JNDI name of "MyContact", and the Client reference is "ejb/TheContact". The relevant code in the app is:
    try
    java.util.Properties props = new java.util.Properties();
    props.put(Context.INITIAL_CONTEXT_FACTORY,
    "com.sun.jndi.cosnaming.CNCtxFactory");
    props.put(Context.PROVIDER_URL, "iiop://localhost:1050");
    Context initial = new InitialContext(props);
    Object objref = initial.lookup("ejb/TheContact");
    ContactHome home =
    (ContactHome)PortableRemoteObject.narrow(objref,
    ContactHome.class);
    contact = home.create();
    catch (Exception ex)
    System.err.println("Exception: " + ex.getMessage());
    ex.printStackTrace();
    The following exception is thrown by initial.lookup("ejb/TheContact");
    javax.naming.NameNotFoundException. Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0
    I have tried changing the name to "TheContact", and to "java:comp/env/TheContact" with no success. If I change it to the JNDI name "MyContact", the lookup works, but the following call, PortableRemoteObject.narrow(), throws a java.lang.ClassCastException.
    What am I doing wrong?
    John

    Hi, Thanks for your fast reply, but it still doesn't work.
    With your Code I get a classCastException in this line:
    "SessionHome home = (SessionHome)ctx.lookup("SessionBeanInstance");"
    Here is the code from the whole thing, as it works with the appclient script:
    SessionHome: //RemoteHomeInterface
    package ejb;
    import java.rmi.RemoteException;
    import javax.ejb.CreateException;
    import javax.ejb.EJBHome;
    public interface SessionHome extends EJBHome {
    Session create() throws RemoteException, CreateException;
    Session //Session RemoteInterface
    package ejb;
    import javax.ejb.EJBObject;
    import java.rmi.RemoteException;
    public interface Session extends EJBObject {
    public String getString() throws RemoteException;
    SessionBeanInstance //The SessionBean
    package ejb;
    import javax.ejb.SessionBean;
    import javax.ejb.CreateException;
    import javax.ejb.SessionContext;
    public class SessionBeanInstance implements SessionBean{
    public SessionContext context;
    public String getString(){ return "works"; }
    public SessionBeanInstance() {  }
    public void ejbCreate() throws CreateException { System.out.println("Bean created"); }
    public void ejbActivate() {  }
    public void ejbPassivate() {  }
    public void ejbRemove() {  }
    public void setSessionContext(SessionContext ctx) {  context = ctx;  }
    clientMain //The client class
    package client;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    import javax.naming.NamingEnumeration;
    import javax.rmi.PortableRemoteObject;
    import ejb.*;
    import java.util.Hashtable;
    public class clientMain {
    private SessionHome home;
    private Session mySession;
    private Context ctx;
    private Object objref;
    public clientMain() {
    try{
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.cosnaming.CNCtxFactory");
    env.put(Context.PROVIDER_URL, "iiop://127.0.0.1:3700");
    try{
    Context ctx = new InitialContext(env);
    SessionHome home = (SessionHome)ctx.lookup("SessionBeanInstance");
    Session remote = (Session)home.create();
    String test = remote.getString();
    System.out.println(test);
    catch(Exception e){ e.printStackTrace(); }
    catch (Exception ex) { 
    System.err.println("Caught an exception.");
    ex.printStackTrace();
    The error occurs only if is start with the "java -jar" script. Here is the error:
    lang.ClassCastException: com.sun.corba.se.impl.corba.CORBAObjectImpl
    at client.clientMain.<init>(clientMain.java:27)
    at client.Client.main(Client.java:10)
    I don't know what to do, to get it work...

  • Need to print simultaneously via the network/TCP/IP & also print parallel from stand-alone PC

    1. HP LaserJet 4200 Q2427A
    2. Win7 - 32bit
    3. When I print from the Networked PC (which is on same subnet as printer) Prints come out. No problems. Then I need to print from a PC( which is a standalone PC w/ no connection to the corporate LAN, but does have a separate DSL connection to the internet) connected via the parallel cable. Prints fine no problems. When I try to then go back to the networked PC and print, The job takes 10-15 minutes print if at all- which sometimes it does not print at all.
    4. The stand-alone PC was replaced with a new windows 7 PC. The previous stand-alone PC was running windows XP. We did not experience any issues when PC was XP. PC was replaced due to Hard drive going bad and age. The windows 7 PC has a PCI parallel card installed for the parallel connection.
    Have also tried using a parallel to usb adapter with same results.

    That would be Wireless Distribution System (WDS). That is to say Wireless to Wireless. And if I recall correctly that option is not available to you.
    Bridge Mode is bridging between ethernet and WiFi.
    One way you could maybe do what you want without ethernet over powerline adaptors is to get an Airport Express (more money), attach that to the Pirelli via ethernet. Put the Express into Bridge Mode. Now have the Express provide the WDS server to the Airport Extreme Base Station. Of course you now have 3 WiFi transmiters in your home just so you can print something, but just think of the coverage in your home.
    NOTE: If for some reason you decide to try this Express to AEBS WDS system, you can create a roaming network by giving all 3 WiFi systems the same SSID and password. When everyone is using the same SSID and password you can roam around the house and your laptops will automatically switch to the base station with the strongest signal (assuming that is worth something to you).

  • Dialog Instance Java is not up after restoring the DB from Stand alone

    Dear Gurus,
    We are migrating our Stand alone Production (Dual Stack) system to Cluster hardware and we donu2019t have any dialog instances for Standalone Production system.In the process we have taken the backup from the stand alone system and restored in cluster.
    After that, the dialog instance Java in is not coming up but central instance java was working fine
    As per our analysis, due to only one entry is there for java in the stand alone database and the same database backup is restored in the cluster, the DI instance java is not coming up. Please any body give us the solution to resolve this issue.
    Your earliest reply is very much appreciated.
    Regards
    Kali

    Dear Manoj,
    Thanks for your reply.
    My Problem was solved.
    As per SAP , it won't suggest or support the DB refresh. so did export and import then it was working fine.

  • Issue in accessing EJB from plain java

    Hi,
    I am new to OAS. I am using OAS 10.1.2.
    I want to access EJB which runs inside OAS, through a plain java program which runs from outside the OAS environment (standalone java program).
    I am confused on what to use. RMIInitialContextFactory or ApplicationClientInitialContextFactory for the context in the java program.
    what should be the provide URL ?
    java.naming.provider.url","ormi://hostname:18140/
    is it "ormi" or something else? what is the port number should i use. there are many ports in this OAS. i see that in the console("Ports") link.
    also let me know what should i mention in the EJB xml descriptor.
    Is this lookup to be done by retrieving from jndi?
    pls help.
    Thanks,
    Sukumar
    with this confusion i developed an EJB with the following details
    ejb-jar.xml
    <ejb-ref>
         <ejb-ref-name>ejb/testDetails</ejb-ref-name>
         <ejb-ref-type>Entity</ejb-ref-type>
    <home>com.xxx.xxx.testDetailsHome</home>
    <remote>com.xxx.xxx.testDetails</remote>
         </ejb-ref>
    orion-ejb-jar.xml
    <entity-deployment name="ejb/testDetails" location="ejb/testDetails"
    Client Java program
    public class testDetailsClient
    public static void main(String [] args)
    testDetailsClient testDetailsClient = new testDetailsClient();
    try
    Context context =getInitialContext();
    testDetailsHome testDetailsHome = (testDetailsHome)PortableRemoteObject.narrow(context.lookup("java:comp/env/ejb/testDetails"), testDetailsHome.class);
    testDetails testDetails;
    catch(Throwable ex)
    ex.printStackTrace();
    private static Context getInitialContext() throws NamingException
    Hashtable env = new Hashtable();
    env.put("java.naming.factory.initial","com.evermind.server.rmi.RMIInitialContextFactory");
    //env.put("java.naming.factory.initial","com.evermind.server.ApplicationClientInitialContextFactory");
    env.put("java.naming.provider.url","ormi://host_name:18140/"); //23791 18140
    env.put(Context.SECURITY_PRINCIPAL, "ias_admin");
    env.put(Context.SECURITY_CREDENTIALS, "abc123");
    InitialContext context = new InitialContext(env);
    return context;
    if i execute this, it says
    javax.naming.NameNotFoundException: java:comp/env/ejb/testDetails not found
    18140 is Application Server Control RMI port.
    if i run the same code with ApplicationClientInitialContextFactory, it throws exception saying
    java.lang.InstantiationException: No location specified and no suitable instance of the type 'com.testdetails.testDetails' found for the ejb-ref ejb/testDetails
         at com.evermind.server.administration.ApplicationResourceFinder.getEJBHome(ApplicationResourceFinder.java:268)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at com.evermind.server.rmi.RMICallHandler.run(RMICallHandler.java:124)
         at com.evermind.server.rmi.RMICallHandler.run(RMICallHandler.java:48)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
         at java.lang.Thread.run(Thread.java:534)
    javax.naming.NamingException: Error reading application-client descriptor: No location specified and no suitable instance of the type 'com.testdetails.testDetails' found for the ejb-ref ejb/testDetails
         at com.evermind.server.ApplicationClientInitialContextFactory.getInitialContext(ApplicationClientInitialContextFactory.java:161)
         at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:662)
         at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
         at javax.naming.InitialContext.init(InitialContext.java:219)
         at javax.naming.InitialContext.<init>(InitialContext.java:195)
         at com.testdetails.testDetailsClient.getInitialContext(testDetailsClient.java:89)
         at com.testdetails.testDetailsClient.main(testDetailsClient.java:20)
    pls help

    Hi,
    you do not have to package your EJB and PAR together! You can deploy them separately and then reference the J2EE Application from your PAR or vice versa to access it.
    For instance you can access the EJB from your PAR as described here:
    http://help.sap.com/saphelp_nw2004s/helpdata/en/42/9ddf20bb211d72e10000000a1553f6/frameset.htm
    Or you can access a Portal application from J2EE like described here:
    http://help.sap.com/saphelp_nw2004s/helpdata/en/42/9ddd0cbb211d72e10000000a1553f6/frameset.htm
    Even if you package your PAR in to the same EAR with your EJB they will result in two different containers on the J2EE Engine and you will have to reference them as described in the link above to access the functionality of one component from the other.
    Best regards,
    Stefan Brauneis

  • Accessing EJBs from a servlet

    Hi everyone,
    I deployed my EJB component in an Oracle 8.1.7 database and I try to access it from a servlet.
    If I run my servlet from JDeveloper 3.2 (Web-to-Go), it all works fine. If I run my servlet from JRun 3.01 or from Tomcat 3.2.1, I get the following exception:
    javax.naming.NoInitialContextException: Need to specify class name in environmen
    t or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
    at java.lang.Throwable.fillInStackTrace(Native Method)
    at java.lang.Throwable.fillInStackTrace(Compiled Code)
    at java.lang.Throwable.<init>(Compiled Code)
    at java.lang.Exception.<init>(Compiled Code)
    at javax.naming.NamingException.<init>(NamingException.java:104)
    at javax.naming.NoInitialContextException.<init>(NoInitialContextException.java:58)
    at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:649)
    at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:242)
    at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:279)
    at javax.naming.InitialContext.lookup(InitialContext.java:349)
    at com.cognicase.framework.base.U0003.AbstractORB.getBean(AbstractORB.java:285)
    at com.cognicase.framework.base.U0003.AbstractORB.getBean(Compiled Code)
    at com.cognicase.demo.U2007BL.U2007WP_Users.lookupBean(U2007WP_Users.java:60)
    at com.cognicase.framework.is.U0103.AbstractBeanWrapper.beforeBeanCall(AbstractBeanWrapper.java:121)
    at com.cognicase.demo.U2007BL.U2007WP_Users.valideUser(U2007WP_Users.java:77)
    at com.cognicase.demo.U2000WB.U2000MW_WorkSpace.CallEjb(Compiled Code)
    at com.cognicase.demo.U2000WB.U2000MW_WorkSpace.doValidateLogin(Compiled Code)
    at com.cognicase.demo.U2000WB.U2000MW_WorkSpace.processService(U2000MW_WorkSpace.java:98)
    at Demo_0100_01.service(Demo_0100_01.java:128)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
    at org.apache.tomcat.core.Handler.service(Compiled Code)
    at org.apache.tomcat.core.ServletWrapper.service(Compiled Code)
    at org.apache.tomcat.core.ContextManager.internalService(Compiled Code)
    at org.apache.tomcat.core.ContextManager.service(Compiled Code)
    at org.apache.tomcat.service.connector.Ajp13ConnectionHandler.processConnection(Compiled Code)
    at org.apache.tomcat.service.TcpWorkerThread.runIt(Compiled Code)
    at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(Compiled Code)
    at java.lang.Thread.run(Compiled Code)
    If I add my servlet classes, aurora_client.jar, mts.jar, vbjapp.jar and vbjorb.jar files to the CLASSPATH, it works fine.
    The behavior is the same in JRun and Tomcat.
    I don't like this solution since I have to make the CLASSPATH point to my application classes at the web server level instead of at the application context level.
    Has anyone been able to solve this problem?
    Thanks for your help.
    null

    Yes, I did. Actually, if I run my servlet in JDeveloper (Web-to-Go), it all works fine. I also extracted the code that calls the EJB from the servlet and I tested it in a small Java application, and it also works fine.
    Things stop to work when I deploy my servlet in JRun or in Tomcat.
    It appears that my code is correct, but the environment I try to run it is not, and I can't figure out what's wrong.
    Can anyone help me?
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Sandeep Desai ([email protected]):
    Have you provided the environmental settings in the servlet.
    It should be :
    import oracle.aurora.jndi.sess_iiop.ServiceCtx;
    env.put(Context.URL_PKG_PREFIXES, "oracle.aurora.jndi");
    env.put(Context.SECURITY_PRINCIPAL, username);
    env.put(Context.SECURITY_CREDENTIALS, password);
    env.put(Context.SECURITY_AUTHENTICATION, ServiceCtx.NON_SSL_LOGIN);
    InitialContext ctx = new InitialContext(env);
    Object obj = ctx.lookup("test/EJBHome");
    HomeObject home = PortableRemoteObject.narrow(
    obj,"HomeObject.class");
    RemoteObject remote = home.create();
    This should make it work!!
    <HR></BLOCKQUOTE>
    null

  • Separating all.css from stand-alone mobile site

    I have come to the conclusion that I need to create a stand-alone mobile site for a client's ecommerce site. Should I copy and paste my css code from the desktop version "all.css" into the phone.css so as to keep them separate? The "Main template_phone.dwt" uses "all.css" and "phone.css" but I don't want to change any of the css for my desktop version. Thank you!

    That really depends on the situation and what if any CSS you are reusing.
    There are several ways to do what you need including, seperate CSS files, Media Queries (Dreamweaver), the BC built in mobile template system, if doing it in Muse they now have mobile capability now as well.
    So we would really need more information to advise what would be the best solution for you.

  • Accessing EJBs from a Web project

    Hi,
    I am getting the error: "com.sap.engine.services.jndi.persistent.exceptions.NameNotFoundException: Path to object does not exist at java:comp, the whole lookup name is java:comp/env/ejb/UserInfoServer." when I try to access the session bean from my web project.  I have followed the instructions explicitly in http://help.sap.com/saphelp_nw04s/helpdata/en/55/29ed5eff965448941c0b42f01b9804/frameset.htm and also tried every other combination I can think of for configuring the references in both the EJB project & the web project (both in the same ear).  I do have a jndi name in the visual administrator for localebjs/sap.com/myEar/UserInfoServer.  Does anyone have any ideas?
    Thanks & merry Christmas/Happy New year to all the SDN folks!

    I've managed to get around the problem for the time being by using "/localejbs/provider/application/beanName" - bypassing (I think) the whole JNDI issue -  this is OK for now, but it's obviously not a long term fix. 
    Previously, I had used the default & so did not enter anything in the ejb-j2ee-engine.xml, and so my ejb's showed up nicely in the Visual Administrator JNDI Registry under the localejbs tab as you would expect. The problem appears to be in the Web project - The key is that the error is "Path to object not found" rather than "Name not found".  It seems to me that it knows what it is looking for & that it is valid, but doesn't know how to get there! Note that the EJB project is in the same EAR. The only reference to "Path" that I can find is in the help doc above where it says "If the name of the target enterprise bean is not unique in the enterprise application scope, you can enter the path to the JAR file that contains the bean...".  I've gone through the Car Rental Application pdf (I can't find the download that contains the entire application) & followed the instructions there explicitly for referencing ejbs from the web..

Maybe you are looking for

  • Printing List View - URL Mailitem Showing Up!

    Hi, When I try to Print from iCal using List View, lots of URL code shows up under my To Do Items. Is this normal? For example: Buy Black Trainers URL: mailitem:12BBAE63-0EFD-43AA-8AEF-A50E33029129?type=todo&action=showparent Why on Earth would anyon

  • Tried "everything" LR4.4 will not extract

    I know this is a common issue, but I have tried everything I can think of to get Lightroom 4.4 to extract/install. I'm getting the same error that others get "A problem occurred while extracting your files. Check available space, write priviledges, b

  • Disks won't unmount

    Hello, I have an old imac, that is running OS 10.6.5; As of today I cannot get it to unmount any disks: USB drives CD's External hard drives (Both USB and Firewire) I have tried to repair permissions and repair the disk (Disk Utilities) both cases gi

  • How to see psd files as images not icons in Pshop file open window win7 ?

    Hi, I have just moved over to win7 64bit pro from XP and have Photoshop CS6 installed now, however I only see psd icons in the Photoshop file open window which is crazy, Pshop needs to show its files as images, goes without saying doesnt it, yet I se

  • SQL Remote Connection Error 26 with pictures

    Hi. I am trying to connect SQL Server 2012 via internet, but I cannot. I do the following steps: 1- I tuned up my modem settings for port forwarding to my computer: (TCP: 1433, UDP: 1434, Computer Name: TURAN, LAN IP: 192.168.1.27) http://i.stack.img