Initial Context Factory for same OC4J EJB access in 10.1.3.1

What should the INITIAL_CONTEXT_FACTORY be set to when you try to access an EJB from within the same OC4J instance? Should it be:
a) ApplicationClientInitialContextFactory
b) RMIInitialContextFactory
c) Nothing at all
d) Something else completely
I ask because I am try to move from 10.1.3.0 to 10.1.3.1 and I have a thread spawned during startup that is unable to access the EJB
2007-05-25 07:22:50.862 WARNING J2EE RMI-00009 Exception returned by remote server: {0}
07/05/25 07:22:50 Unknown service: MySessionHome
javax.naming.NameNotFoundException: MySessionHome not found
It does not set the INITIAL_CONTEXT_FACTORY because it has been my understanding that this is not necessary. Did something change in 10.1.3.1?

Has anyone found a solution for this problem? I tried adding the following entry to my orion-application.xml file with no luck. I was able to fix the problem by adding commons-digester.jar,commons-logging.jar, and log4j-1.2.15.jar to the /BC4J/lib folder on the server. Unfortunately this fix caused errors when trying to launch the BPEL console. Any help would be greatly appreciated.
<imported-shared-libraries>
<remove-inherited name="apache.commons.logging"></remove-inherited>
</imported-shared-libraries>
I am unable to deploy my application due to the error below.
Caused by: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: No suitable Log constructor [Ljava.lang.Class;@6b8c38 for org.apache.commons.logging.impl.Log4JLogger (Caused by java.lang.NoClassDefFoundError: org/apache/log4j/Category) (Caused by org.apache.commons.logging.LogConfigurationException: No suitable Log constructor [Ljava.lang.Class;@6b8c38 for org.apache.commons.logging.impl.Log4JLogger (Caused by java.lang.NoClassDefFoundError: org/apache/log4j/Category))
        at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:543)
        at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:235)
        at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:209)
        at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:351)
        at com.sun.faces.config.ConfigureListener.<clinit>(ConfigureListener.java:212)
        ... 19 more
Caused by: org.apache.commons.logging.LogConfigurationException: No suitable Log constructor [Ljava.lang.Class;@6b8c38 for org.apache.commons.logging.impl.Log4JLogger (Caused by java.lang.NoClassDefFoundError: org/apache/log4j/Category)
        at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:413)
        at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:529)
        ... 23 more
Caused by: java.lang.NoClassDefFoundError: org/apache/log4j/Category
        at java.lang.Class.getDeclaredConstructors0(Native Method)
        at java.lang.Class.privateGetDeclaredConstructors(Class.java:2357)
        at java.lang.Class.getConstructor0(Class.java:2671)
        at java.lang.Class.getConstructor(Class.java:1629)
        at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:410)
        ... 24 more                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Similar Messages

  • Initial Context Factory

    Hi
    I am trying to develop a EJB Project and trying to call the EAR depployed on the server using JNDI.
    I am writing the code using Java Client
    Can i have the name of Initial Context Factory for WAS 6.40.
    Its Urgent
    With Wishes
    Krishna Kanth

    Hi,
    the Initial context factory on Web AS 6.40 is
    com.sap.engine.services.jndi.InitialContextFactoryImpl

  • ClassNotFoundException for initial-context-factory using foreign JMS p.

    Hi,
    I am currently working on migrating an application from weblogic 9 to weblogic 10 and I bumped into this issue while MDB connecting to JMS.
    [Loaded cz.jaksky.riskscenario.beans.RiskScenarioServiceLocalHome from file:/C:/SVN/app-WLS10-FRESH/app-deploy/servers/myserver/tmp/_WL_user/performance/nyubkw/point-interfaces.jar]
    <17-Sep-2012 11:01:27 o'clock CEST> <Warning> <EJB> <BEA-010061> <The Message-Driven EJB: PerformanceAsyncRequestBean is unable to connect to the JMS destination: wls.AsyncQueue. The Error was:
    javax.naming.NoInitialContextException: Cannot instantiate class: cz.jaksky.common.jms.JMSInitialContextFactory [Root exception is java.lang.ClassNotFoundException: cz.jaksky.common.jms.JMSInitialContextFactory]
    at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:657)
    at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
    at javax.naming.InitialContext.init(InitialContext.java:223)
    at javax.naming.InitialContext.<init>(InitialContext.java:197)
    at weblogic.deployment.jms.ForeignOpaqueReference.getReferent(ForeignOpaqueReference.java:182)
    at weblogic.jndi.internal.WLNamingManager.getObjectInstance(WLNamingManager.java:96)
    at weblogic.jndi.internal.ServerNamingNode.resolveObject(ServerNamingNode.java:377)
    at weblogic.jndi.internal.BasicNamingNode.resolveObject(BasicNamingNode.java:856)
    at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:209)
    at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:214)
    at weblogic.jndi.internal.WLEventContextImpl.lookup(WLEventContextImpl.java:254)
    at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:411)
    at javax.naming.InitialContext.lookup(InitialContext.java:392)
    at weblogic.jms.common.CDS$2.run(CDS.java:486)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
    at weblogic.jms.common.CrossDomainSecurityManager.runAs(CrossDomainSecurityManager.java:131)
    at weblogic.jms.common.CDS.lookupDestination(CDS.java:480)
    at weblogic.jms.common.CDS.lookupDDAndCalloutListener(CDS.java:345)
    at weblogic.jms.common.CDS.access$100(CDS.java:41)
    at weblogic.jms.common.CDS$DDListenerRegistrationTimerListener.timerExpired(CDS.java:193)
    at weblogic.timers.internal.TimerImpl.run(TimerImpl.java:273)
    at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:176)
    Caused by: java.lang.ClassNotFoundException: cz.jaksky.common.jms.JMSInitialContextFactory
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:247)
    at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:46)
    at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:654)
    ... 23 more
    I am using foreign JMS provider with provided mapping. Config follows:
    ejb-jar.xml:
    <enterprise-beans>
              <message-driven>
                   <ejb-name>PortfolioRetrieverAsyncRequestBean</ejb-name>
                   <ejb-class>cz.jaksky.common.async.AsynchronousRequestMessageBean</ejb-class>
                   <transaction-type>Bean</transaction-type>
                   <acknowledge-mode>Auto-acknowledge</acknowledge-mode>
                   <message-driven-destination>
                        <destination-type>javax.jms.Queue</destination-type>
                        <subscription-durability>Durable</subscription-durability>
                   </message-driven-destination>
                   <message-selector>
                        <![CDATA[ Service IN ('PortfolioRetriever')
                      AND MessageType = 'request'
                      AND BigBox = FALSE
                    ]]>
                   </message-selector>
              </message-driven>
         </enterprise-beans>
    weblogic-ejb-jar.xml:
    <weblogic-enterprise-bean>
              <ejb-name>PortfolioRetrieverAsyncRequestBean</ejb-name>
              <message-driven-descriptor>
                   <pool>
                        <max-beans-in-free-pool>64</max-beans-in-free-pool>
                        <initial-beans-in-free-pool>1</initial-beans-in-free-pool>
                   </pool>
                   <destination-jndi-name>wls.AsyncQueue</destination-jndi-name>
                   <initial-context-factory>weblogic.jndi.WLInitialContextFactory</initial-context-factory>
                   <connection-factory-jndi-name>ServiceLocatorAsyncQueueFactory</connection-factory-jndi-name>
              </message-driven-descriptor>
              <dispatch-policy>PortfolioAsyncQueueWorkManager</dispatch-policy>
         </weblogic-enterprise-bean>
    jmsconfig-jms.xml
    <foreign-server name="TibjmsAsyncServer">
    <default-targeting-enabled>true</default-targeting-enabled>
    <foreign-destination name="AsyncQueue.LOCAL.prgdwm355410.7001">
    <local-jndi-name>wls.AsyncQueue</local-jndi-name>
    <remote-jndi-name>AsyncQueue.LOCAL.prgdwm355410.7001</remote-jndi-name>
    </foreign-destination>
    <foreign-connection-factory name="FTQueueConnectionFactory">
    <local-jndi-name>ServiceLocatorAsyncQueueFactory</local-jndi-name>
    <remote-jndi-name>FTQueueConnectionFactory</remote-jndi-name>
    </foreign-connection-factory>
    <initial-context-factory>cz.jaksky.common.jms.JMSInitialContextFactory</initial-context-factory>
    <connection-url>tcp://JUSD-FTPOIA.jaksky.com:22542,tcp://JUSD-FTPOB.jaksky.com:22543</connection-url>
    </foreign-server>
    Module containing this MDB is packed as an ear file with following structure:
    APP-INF/lib/modules.jar - contains AsynchronousRequestMessageBean class
    APP-INF/lib/interface.jar - contains JMSInitialContextFactory (class used for initial-context-factory)
    portfolio-async.jar
    META-INF/ejb-jar.xml content pasted above
    META-INF/webogic-ejb-jar.xml content pasted above
    Weblogic system classpath doesn't contain any application sepcific libraries.
    This set up was working for weblogic 9 without any problem. I am just wondering what the problem is whether I am faceing class loading issue or JMS configuration issue and how to resolve it.
    Edited by: user13047709 on 18-Sep-2012 07:15
    Edited by: user13047709 on 18-Sep-2012 07:16

    Hi,
    When working with a non-WebLogic JNDI provider (or a non-WebLogic JMS provider), the non-WebLogic client classes must be made available to the classloader of the calling application in WebLogic Server. This is usually accomplished by adding them to the system classpath.
    In your case, WebLogic is looking for a proprietary/foreign JNDI Context Factory class named "cz.jaksky.common.jms.JMSInitialContextFactory", which means you need to make sure that a jar/dir that contains the non-WebLogic class "JMSInitialContextFactory.class" is in the classpath.
    The configuration for this should be similar in WL9 and WL10. It could be that your classpath is already setup to reference the foreign class, but it refers to a directory/jar that you haven't setup yet on your WL10 host.
    HTH,
    Tom

  • How to configure initial-context-factory and provider_url on Websphere MQ

    I have a few questions about WebSphere MQ. Currently, my application is able work well with other JMS provider. But I would like to move to use WebSphere instead.
    Can anyone suggest me how to configure the application connecting WebSphere?
    �     I�m using the Initial java naming factory as bellows: com.sun.jndi.fscontext.RefFSContextFactoryIs it the correct class?
    �     About the java-naming-factory-url, How do I know what object that I should use? I found this example in JMSAdmin.config � iiop://localhost:7555� What�s iiop ?
    �     What jar file that I should add in my classpath?

    Hi,
    You have a few options...
    1. Use WebSphere Application Server as the JNDI provider
    2. Don't use JNDI
    3. Use the File System Context as the JNDI provider
    Exploring these options in a bit more detail...
    1. Use WebSphere Application Server as the JNDI provider
    Assuming you have WAS, the best way of obtaining your queue is to define the Queue and Queue Connection Factory objects in WAS using the admin console, then obtain them from the Initial Context as per the following article
    http://publib.boulder.ibm.com/infocenter/wasinfo/v6r0/index.jsp?topic=/com.ibm.websphere.express.doc/info/exp/ae/rnam_example_prop2.html
    If you prefer not to do JNDI lookups in your code a great alternative is to use Spring (www.springframework.org). If you haven't come across spring before it's well worth a look. One of it's many features is a bean factory for creating your objects. There is lots of support for retrieving JMS objects from JNDI, so in the main all you have to do is write some XML similar to the following...
    <bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate">
           <property name="environment">
                  <props>
                         <prop key="java.naming.factory.initial">${jndi.initialContextFactory}</prop>
                         <prop key="java.naming.provider.url">${jndi.providerUrl}</prop>
                  </props>
           </property>
    </bean>
    <bean id="queueConnectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean">
           <property name="jndiTemplate" ref="jndiTemplate"/>
           <property name="jndiName" value="${jndi.queueConnectionFactory}"/>
    </bean>
    <bean id="queueName" class="org.springframework.jndi.JndiObjectFactoryBean">
           <property name="jndiTemplate" ref="jndiTemplate"/>
           <property name="jndiName" value="${jndi.queueName}"/>
    </bean>There's a bit more to it than this, but not much. I've been meaning to write a tutorial on this for a while so if you're interested let me know.
    2. Don't use JNDI
    This approach involves using the creating the native MQ Queue Connection Factory and Queue classes. You can hard code this, but it's much better to abstract it from your application. Again you can use Spring. The definition would look something like the following...
    <bean id="MQJMS_TP_CLIENT_MQ_TCPIP"
    class="org.springframework.beans.factory.config.FieldRetrievingFactoryBean">
           <property name="staticField">
                  <value>com.ibm.mq.jms.JMSC.MQJMS_TP_CLIENT_MQ_TCPIP</value>
           </property>
    </bean>
    <bean id="queueConnectionFactory" class="com.ibm.mq.jms.MQQueueConnectionFactory">
           <property name="transportType" ref="MQJMS_TP_CLIENT_MQ_TCPIP" />
           <property name="queueManager" value="${mq.queueManager}" />
           <property name="hostName" value="${mq.host}" />
           <property name="port" value="${mq.port}" />
           <property name="channel" value="${mq.channel}" />
    </bean>
    <bean id="publishInvoiceQ" class="com.ibm.mq.jms.MQQueue">
           <constructor-arg value="${mq.queueName}" />
    </bean>
    3. Use the File System Context
    The file system context is just like a JNDI context, but instead of using a url like iiop://host:port you have to specify a file system url. Because FSContext is just another JNDI context you can still use the spring configuration from option 1, but just change the relevant parameters.
    In order to define you queues and queue connection factory using the File System Context, you need to download a swing application called JMS Admin. Get it here
    http://www-1.ibm.com/support/docview.wss?rs=171&uid=swg24004691&loc=en_US&cs=utf-8&lang=en
    With regards your specific questions...
    IIOP is just another communication protocol. If you want more details I'm sure typing "what is iiop" into google will provide plenty of hits.
    I'll do my best to answer the remain two tomorrow - I wrote an application a few months ago which used the File System Context, but don't have the details to hand.

  • Finding intial context factory for java naming connect to DS5

    I'm a newbie to LDAP programming using the JNDI interfaces to connect to my
    DS 5 implementation. I can't seem to find any reference as to where the
    correct factory for the initialDirContext is! I need the factory classname
    for this call:
    env.put(Context.INITIAL_CONTEXT_FACTORY,"factory classname goes here");
    which is neccesary to set the initialDirContext.
    As far as I can tell there is no default context for an LDAP connection that
    would make this easier and I don't know where or if I can find one remotely
    located on my DS5 box.
    Any help would be appreciated,
    -Jake

    I'm a newbie to LDAP programming using the JNDI interfaces to connect to my
    DS 5 implementation. I can't seem to find any reference as to where the
    correct factory for the initialDirContext is! I need the factory classname
    for this call:
    env.put(Context.INITIAL_CONTEXT_FACTORY,"factory classname goes here");
    which is neccesary to set the initialDirContext.
    As far as I can tell there is no default context for an LDAP connection that
    would make this easier and I don't know where or if I can find one remotely
    located on my DS5 box.
    Any help would be appreciated,
    -Jake

  • I have macbook pro w existing iPhoto library. Now have Canon printer and loaded Canon software for same. Cannot access iPhoto library from Canon software, but prints fine from iPhoto. How can I use iPhoto library w Canon software?

    I have a macbook pro w exisitng iPhoto library. I now have Canon printer and loaded Canon software for same. I cannot access iPhoto library for use from Canon software. I can print from iPhoto directly to new printer without problem. How can I use iPhoto library with Canon software? I would like to try the software to see which I prefer...

    Simply export some photos from iPhoto to a folder on the desktop and experiment.
    Without telling us even what this program is, not to mind what it does, that's the best anyone can suggest.
    Regards
    TD

  • App client can't instantiate the initial context factory

    hi
    i wrote an application client and a stateless session bean that i deployed with the deploytool from sun to the j2ee application server. now when i start my application client i get the following message:
    NoInitialContextException: Cannot instantiate class: COM.sun.enterprise.naming.SerialInitContextFactory. Root exception is java.lang.ClassNotFoundException: COM.sun.enterprise.naming.SerialInitContextFactory
    at java.net.URLClassLoader$1.run
    my jndi.properties looks like this:
    java.naming.factory.initial=COM.sun.enterprise.naming.SerialInitContextFactory
    java.naming.factory.url.pkgs=COM.sun.enterprise.naming
    and my server runs on the same computer as the client. the classpath variable is set to the j2ee.jar file ( and this file contains the selected initial factory ). i could not understand why i get this errormessage. has anyone a idea?

    thanks to all
    now i got it working. i'm using the orion application server and to get access from a remote computer ( outside the application server ) i have to set the environment properties in the following way:
    Properties prop = new Properties();
                        prop.put(Context.INITIAL_CONTEXT_FACTORY,"com.evermind.server.rmi.RMIInitialContextFactory");
                        prop.put(Context.PROVIDER_URL,"ormi://localhost/TestBean02");
                        prop.put(Context.SECURITY_PRINCIPAL,"admin");
                        prop.put(Context.SECURITY_CREDENTIALS,"123");
    InitialContext initial = new InitialContext(prop);
    Object objref = initial.lookup("MyBeanel");
    home = (TestBeanHome)PortableRemoteObject.narrow(objref, TestBeanHome.class);
    this works, the client needs only the j2ee.jar and the orion.jar in the classpath.

  • EJB JNDI access from app1 to app2 in same oc4j (standalone) 9.0.4

    I have two applications CatalogosWeb and WSCatalogosWeb both in the same instance of a 9.0.4 standalone OC4J. The first one implements a set of EJB's (both entity and session). In the second i have the EJB classes included int the "classes" directory.
    When I try to acces de EJB from the second application I get a ClassCastException.
    The source code is approximately:
    ic = new InitialContext(env);
    where env is>
    {java.naming.provider.url=ormi://localhost:23791/CatalogosWeb, java.naming.factory.initial=com.evermind.server.rmi.RMIInitialContextFactory, java.naming.security.principal=admin, java.naming.security.credentials=welcome}
    later I try to access the EJB>
    Object objref = ic.lookup(jndiHomeName);
    Object obj = PortableRemoteObject.narrow(objref, className);
    When the PortableRemoteObject tries to "narrow" the class I get the ClassCastException.

    user496903 ,
    When you need to perform lookups within the same OC4J container, you don't use RMIInitialContextFactory. Instead, you should use the new InitialContext() constructor, that defaults the initial context factory property to (if my memory doesn't fail) ApplicationInitialContextFactory...
    Look for more info in the Oracle App Server EJB developer Guide,
    hope it helps
    RB

  • Concurrent access to initial context?

    Using WebLogic Server 6.0
    I wrote a simple stand alone Java client (see code below) that
    performs the following steps:
    1. Gets the Initial Context for the WLS JNDI
    2. Closes the initial context
    3. Goes into an indefinite loops (to keep the client alive)
    I start up one client and it performs steps 1, 2, and 3 and is
    sitting at step3.
    Then I start up another client. It hangs at step 1 until I kill
    the first client.
    It cannot obtain the initial context while the first client is
    running.
    I do not understand this behavior! Is this behavior correct?
    If so, could somebody
    explain why it works this way. The initial context is used to
    lookup our EJBs. If two
    clients cannot access the Initial Context at the same time, won't
    this be a major
    bottle neck when using EJBs?
    Please help!
    Here's is the code for the client....
    public static void main(String args[])
         try
         Context ctx = null;
         System.out.println("Before get context.");
         Hashtable env = new Hashtable();
         env.put(Context.INITIAL_CONTEXT_FACTORY,
              "weblogic.jndi.WLInitialContextFactory");
         env.put(Context.PROVIDER_URL,
              "t3://localhost:7001");
         ctx = new InitialContext(env);
         System.out.println("Initial context created.");
         ctx.close();
         System.out.println("Closed context.");
         // Hang
         while(true){}
         catch (Exception e)
         e.printStackTrace();

    Yes - it was the CPU problem. If I use Thread.sleep(...) it works fine.
    I had a feeling it was a mistake on my part. Thanks for the help.
    Robert Patrick <[email protected]> wrote:
    There is definitely something else going on here. Try adding a
    Thread.sleep(1000) inside your while loop to prevent the process from
    spinning and eating up all the CPU...
    MK Parini wrote:
    Using WebLogic Server 6.0
    I wrote a simple stand alone Java client (see code below) that
    performs the following steps:
    1. Gets the Initial Context for the WLS JNDI
    2. Closes the initial context
    3. Goes into an indefinite loops (to keep the client alive)
    I start up one client and it performs steps 1, 2, and 3 and is
    sitting at step3.
    Then I start up another client. It hangs at step 1 until I kill
    the first client.
    It cannot obtain the initial context while the first client is
    running.
    I do not understand this behavior! Is this behavior correct?
    If so, could somebody
    explain why it works this way. The initial context is used to
    lookup our EJBs. If two
    clients cannot access the Initial Context at the same time, won't
    this be a major
    bottle neck when using EJBs?
    Please help!
    Here's is the code for the client....
    public static void main(String args[])
    try
    Context ctx = null;
    System.out.println("Before get context.");
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY,
    "weblogic.jndi.WLInitialContextFactory");
    env.put(Context.PROVIDER_URL,
    "t3://localhost:7001");
    ctx = new InitialContext(env);
    System.out.println("Initial context created.");
    ctx.close();
    System.out.println("Closed context.");
    // Hang
    while(true){}
    catch (Exception e)
    e.printStackTrace();

  • Sample weblogic-ejb-jar.xml for Resource-ref EJB 3.0

    I am trying to create an MDB that can be re-used under different names.
    @MessageDriven(description = "An MDB that transfers messages from one Queue to another", activationConfig = { @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue") })
    @TransactionAttribute(TransactionAttributeType.REQUIRED)
    public class TransferMdb implements MessageListener {
    private static final Logger LOG = Logger.getLogger(TransferMdb.class);
    @Resource(name = "jms/connfactory")
    private ConnectionFactory connectionFactory;
    @Resource(name = "jms/targetDestination")
    private Queue targetDestination;
    <ejb-jar version="3.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/ejb-jar_3_0.xsd">
    <enterprise-beans>
    <message-driven>
    <ejb-name>TransferMdb</ejb-name>
    <ejb-class>TransferMdb</ejb-class>
    </message-driven>
    </enterprise-beans>
    </ejb-jar>
    <weblogic-ejb-jar>
    <weblogic-enterprise-bean>
    <ejb-name>TransferMdb</ejb-name>
    <message-driven-descriptor>
    <pool>
    <max-beans-in-free-pool>200</max-beans-in-free-pool>
    <initial-beans-in-free-pool>5</initial-beans-in-free-pool>
    </pool>
    <destination-jndi-name>test_queue</destination-jndi-name>
    <transaction-descriptor>
    <trans-timeout-seconds>20</trans-timeout-seconds>
    </transaction-descriptor>
    </message-driven-descriptor>
    <reference-descriptor>
    <resource-description>
    <res-ref-name>jms/connectionfactory</res-ref-name>
    <jndi-name>connectionfactory</jndi-name>
    </resource-description>
    <resource-description>
    <res-ref-name>jms/targetDestination</res-ref-name>
    <jndi-name>reply_queue</jndi-name>
    </resource-description>
    </reference-descriptor>
    </weblogic-enterprise-bean>
    </weblogic-ejb-jar>
    However when I deploy the above, I get exceptions such as:
    problem: cvc-complex-type.2.4a: Expected elements 'initial-context-factory@http://www.bea.com/ns/weblogic/weblogic-ejb-jar provider-url@http://www.bea.com/ns/weblogic/weblogic-ejb-jar connection-factory-jndi-name@http://www.bea.com/ns/weblogic/weblogic-ejb-jar jms-polling-interval-seconds@http://www.bea.com/ns/weblogic/weblogic-ejb-jar jms-client-id@http://www.bea.com/ns/weblogic/weblogic-ejb-jar generate-unique-jms-client-id@http://www.bea.com/ns/weblogic/weblogic-ejb-jar durable-subscription-deletion@http://www.bea.com/ns/weblogic/weblogic-ejb-jar max-messages-in-transaction@http://www.bea.com/ns/weblogic/weblogic-ejb-jar distributed-destination-connection@http://www.bea.com/ns/weblogic/weblogic-ejb-jar use81-style-polling@http://www.bea.com/ns/weblogic/weblogic-ejb-jar init-suspend-seconds@http://www.bea.com/ns/weblogic/weblogic-ejb-jar max-suspend-seconds@http://www.bea.com/ns/weblogic/weblogic-ejb-jar security-plugin@http://www.bea.com/ns/weblogic/weblogic-ejb-jar' instead of 'transaction-descriptor@http://www.bea.com/ns/weblogic/weblogic-ejb-jar' here in element message-driven-descriptor@http://www.bea.com/ns/weblogic/weblogic-ejb-jar:<null>
    problem: cvc-complex-type.2.4a: Expected elements 'transaction-descriptor@http://www.bea.com/ns/weblogic/weblogic-ejb-jar iiop-security-descriptor@http://www.bea.com/ns/weblogic/weblogic-ejb-jar resource-description@http://www.bea.com/ns/weblogic/weblogic-ejb-jar resource-env-description@http://www.bea.com/ns/weblogic/weblogic-ejb-jar ejb-reference-description@http://www.bea.com/ns/weblogic/weblogic-ejb-jar service-reference-description@http://www.bea.com/ns/weblogic/weblogic-ejb-jar enable-call-by-reference@http://www.bea.com/ns/weblogic/weblogic-ejb-jar network-access-point@http://www.bea.com/ns/weblogic/weblogic-ejb-jar clients-on-same-server@http://www.bea.com/ns/weblogic/weblogic-ejb-jar run-as-principal-name@http://www.bea.com/ns/weblogic/weblogic-ejb-jar create-as-principal-name@http://www.bea.com/ns/weblogic/weblogic-ejb-jar remove-as-principal-name@http://www.bea.com/ns/weblogic/weblogic-ejb-jar passivate-as-principal-name@http://www.bea.com/ns/weblogic/weblogic-ejb-jar jndi-name@http://www.bea.com/ns/weblogic/weblogic-ejb-jar local-jndi-name@http://www.bea.com/ns/weblogic/weblogic-ejb-jar dispatch-policy@http://www.bea.com/ns/weblogic/weblogic-ejb-jar remote-client-timeout@http://www.bea.com/ns/weblogic/weblogic-ejb-jar stick-to-first-server@http://www.bea.com/ns/weblogic/weblogic-ejb-jar' instead of 'reference-descriptor@http://www.bea.com/ns/weblogic/weblogic-ejb-jar' here in element weblogic-enterprise-bean@http://www.bea.com/ns/weblogic/weblogic-ejb-jar:<null>
    at weblogic.descriptor.internal.MarshallerFactory$1.evaluateResults(MarshallerFactory.java:234)
    at weblogic.descriptor.internal.MarshallerFactory$1.evaluateResults(MarshallerFactory.java:221)
    at weblogic.descriptor.internal.MarshallerFactory$1.createDescriptor(MarshallerFactory.java:146)
    at weblogic.descriptor.BasicDescriptorManager.createDescriptor(BasicDescriptorManager.java:306)
    at weblogic.application.descriptor.AbstractDescriptorLoader2.getDescriptorBeanFromReader(AbstractDescriptorLoader2.java:788)
    Truncated. see log file for complete stacktrace
    I am clearly missing items in the weblogic-ejb-jar.xml. If anyone has a sample or tips, that would be awesome as a starting point.

    Those tags just declare that you are using our CMP provider and that
    your descriptor is in META-INF/weblogic-cmp-rdbms-jar.xml.
    FWIW, you might also want to check out EJBGen. It tends to keep more up
    to date with WLS than xdoclet.
    -- Rob
    Gen wrote:
    I am using xdoclets to generate descriptor file weblogic-ejb-jar.xml
    for a BMP entity bean. Xdoclet is generating the descriptor file
    alright, but is putting the following extra tags. This happens even
    for samples which come with the download, so my tags in java file are
    not wrong.
    My question is, are the extra tags below harmless, or should I
    manually go to each desciptor file and remove them?
    Thanks.
    ----------- EXTRA TAGS GENERATED START ---------
    persistence> <persistence-type>
    <type-identifier>WebLogic_CMP_RDBMS</type-identifier>
    <type-version>6.0</type-version>
    <type-storage>META-INF/weblogic-cmp-rdbms-jar.xml</type-storage>
    </persistence-type>
    <persistence-use>
    <type-identifier>WebLogic_CMP_RDBMS</type-identifier>
    <type-version>6.0</type-version>
    </persistence-use>
    </persistence>
    ----------- EXTRA TAGS GENERATED END ---------
    ----------- TAGS I PUT IN JAVA CLASS START --------
    * @ejb:bean name="com.ejb.entity.Customer"
    * jndi-name="com.ejb.entity.CustomerHome"
    * view-type="remote"
    * type="BMP"
    * primkey-field="com.ejb.entity.CustomerPK"
    * reentrant="false"
    * @weblogic:cache
    * max-beans-in-cache="1000"
    * read-timeout-seconds="900"
    * concurrency-strategy="ReadOnly"
    ----------- TAGS I PUT IN JAVA CLASS END --------

  • Creating initial context from a java client

    I have tried to create intial context from a java client.....
    but that gives me the following exception:
    My code:TestClient.java
    import java.util.*;
    import javax.naming.*;
    public class TestClient
    public static void main(String nilesh[]) throws NamingException
    Hashtable hash = new Hashtable();
    hash.put("Context.INITIAL_CONEXT_FACTORY","com.evermind.server.rmi.RMIInitialContextFactory");
    hash.put("Context.PROVIDER_URL","ormi://localhost:23791/symularity");
    hash.put("Context.SECURITY_PRINCIPAL","admin");
    hash.put("Context.SECURITY_CREDENTIALS","admin");
    Context ctx = new InitialContext(hash);
    System.out.println("Context: "+ctx);
    The output is:
    ERROR! Shared library ioser12 could not be found.
    Exception in thread "main" javax.naming.NamingException: Error accessing repository: Cannot con
    nect to ORB
    at com.sun.enterprise.naming.EJBCtx.<init>(EJBCtx.java:51)
    at com.sun.enterprise.naming.EJBInitialContextFactory.getInitialContext(EJBInitialConte
    xtFactory.java:62)
    at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
    at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
    at javax.naming.InitialContext.init(Unknown Source)
    at javax.naming.InitialContext.<init>(Unknown Source)
    at TestClient.main(TestClient.java:14)
    is anybody able to solve my problem....
    Thanks in advance..
    NileshG

    Nilesh,
    First of all make sure that the shared library error you are getting is fixed by including the library in your classpath. Secondly, where are you running the client from? The connection factory that you use varies depending on where you are connecting from:
    1. ApplicationClientContextFactory is used when looking up remote objects from standalone application clients. This uses refs and mappings in application-client.xml.
    2. RMInitialContextFactory is used when looking up remote objects between different containers.
    3. ApplicationInitalContextFactory is used when looking up remote objects in same application. This is the default initial context factory and this uses refs/mappings in web.xml and ejb-jar.xml.
    Rob Cole
    Oracle Hello Rob cole..
    thank u for ur reply...but actualy i dont know what is application-client.xml and where i can find that file in my j2ee folder...can u give me detail explanation about that...actually i have not created any application or not deployed also without deploying any application i have created that TestClient.java class so how it will relate with application-client.xml....so i have changed the lookup code with ApplicaitonClientContextFactory...but still the same error is coming......can u give me the full explanation or solution of my problem...
    Thanks & Regards
    NileshG...

  • Initial context

    Hi!
    I am using a jndi initial context object to lookup my ejbs in weblogic.
    There are places, where I initialize the initial context differently. I was
    wondering if it's ok to do that.
    For example,
    Scenario A:
    InitialContext context = new InitialContext();
    context.lookup("some bean");
    Scenario B:
    HashMap prop = new HashMap();
    prop.set(contextFactory, ...);
    prop.set(providerUrl, ...);
    InitialContext context = new InitialContext();
    context.lookup("some bean");
    Should I foresee any kind of problems with Scenario A. Does weblogic know
    what context factory and provider url to use if I don't mention it.
    Thanks in advance,
    Van

    If you are creating InitialContext inside the container, you
    do not need to specify any properties - it is container's responsibility
    to set them up.
    van saravanan <[email protected]> wrote:
    Hi!
    I am using a jndi initial context object to lookup my ejbs in weblogic.
    There are places, where I initialize the initial context differently. I was
    wondering if it's ok to do that.
    For example,
    Scenario A:
    InitialContext context = new InitialContext();
    context.lookup("some bean");
    Scenario B:
    HashMap prop = new HashMap();
    prop.set(contextFactory, ...);
    prop.set(providerUrl, ...);
    InitialContext context = new InitialContext();
    context.lookup("some bean");
    Should I foresee any kind of problems with Scenario A. Does weblogic know
    what context factory and provider url to use if I don't mention it.
    Thanks in advance,
    Van--
    Dimitri

  • How OSB pass Initial Context parameters to EJB

    For security reasons I have to pass a ticket (through initial context) to legacy system from OSB for calling EJB, below is a code
    Hashtable env = new Hashtable(2);
    env.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
    env.put(Context.PROVIDER_URL, connectionUrl);
    env.put(javax.naming.Context.SECURITY_PRINCIPAL, ticket);
    env.put(javax.naming.Context.SECURITY_CREDENTIALS, "");
    InitialContext ctx = new InitialContext(env);
    Object homeRef = ctx.lookup("com.cih.services.contact.interfaces.IContactServiceRemote");
    IContactServiceRemoteHome home = (IContactServiceRemoteHome) javax.rmi.PortableRemoteObject
    .narrow(homeRef, IContactServiceRemoteHome.class);
    IContactServiceRemote ejb = home.create();
    Please let me know how we can pass Initial context parameter from Business service or proxy service to legacy system.
    Thanks

    Hi Russ
    Yes, I've done this too. Basic SQL though will not allow the updating of a table inside a function, so we have to get clever. The trick is to use the PRAGMA AUTONOMOUS TRANSACTION command. Here's an example:
    FUNCTION UPDATE_MYTABLE(P_VALUE IN NUMBER)
    RETURN VARCHAR2 IS
    PRAGMA AUTONOMOUS_TRANSACTION;
    BEGIN
    UPDATE SCHEMA_OWNER.MY_TABLE SET MY_VALUE = P_VALUE;
    COMMIT;
    RETURN('Done');
    END UPDATE_TABLE;
    When the update has been completed the Discoverer worksheet will respond with 'Done'.
    Everyone: don't forget to grant EXECUTE on this function to all of the necessary users, including the EUL owner, and also don't forget to import the function using the Admin edition so that it is available for the users. You will also need to make sure that all necessary users have been granted the UPDATE privilege on the table.
    I hope this helps
    Regards
    Michael

  • Initial Context Conflict with EJB

    Hi People.
    I have been trying to debug this follow. I have got a EJB running on a server (in machine A) and I created an initialcontext for the remote EJB.
    properties.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
    properties.put(Context.PROVIDER_URL, url);
    if (user != null) {
    properties.put(Context.SECURITY_PRINCIPAL, user);
    properties.put(Context.SECURITY_CREDENTIALS, password == null ? "" : password);
    InitialContext contex = new InitialContext(properties);
    And on Machine B, I have a JMS server running of which I created another initialContext
    try {
    InitialContext ic = TopicSend.getInitialContext(CONSTANTS.JMS_SERVER);
    ts = new TopicSend();
    ts.init(ic, CONSTANTS.CLIENT_ORDER_TOPIC);
    System.out.println("Adding a topic Send");
    but I have the following security(below), which indicate that the userid of the EJB initialContext has actually spilled over to the declaration of the initialcontext of the JMS. Do Advise......
    ERROR MESSAGE
    JMS init failed: java.lang.SecurityException: Invalid Subject: principals=[userID]
    Start server side stack trace:
    java.lang.SecurityException: Invalid Subject: principals=[userID]
    at weblogic.security.service.SecurityServiceManager.seal(SecurityServiceManager.java:893)
    at weblogic.rjvm.MsgAbbrevInputStream.getSubject(MsgAbbrevInputStream.java:147)
    at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:309)
    at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:30)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:152)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:133)
    End server side stack trace
    java.lang.SecurityException: Invalid Subject: principals=userID]
    Start server side stack trace:
    java.lang.SecurityException: Invalid Subject: principals=[userID]
    at weblogic.security.service.SecurityServiceManager.seal(SecurityServiceManager.java:893)
    at weblogic.rjvm.MsgAbbrevInputStream.getSubject(MsgAbbrevInputStream.java:147)
    at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:309)
    at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:30)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:152)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:133)
    End server side stack trace
    at weblogic.rmi.internal.BasicOutboundRequest.sendReceive(BasicOutboundRequest.java:85)
    at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:262)
    at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:229)
    at weblogic.rmi.internal.ProxyStub.invoke(ProxyStub.java:35)
    at $Proxy0.lookup(Unknown Source)
    at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:339)
    at javax.naming.InitialContext.lookup(InitialContext.java:350)
    at JMSApi.TopicSend.init(TopicSend.java:56)

    I got the same problem, did u figure out what is the solution?
    java.lang.SecurityException: Invalid Subject: principals=[UserID]....
    my email address is [email protected]

  • EJB initial Context

    Any one have set their initial context for EJB for J2eesdk kit similar to Weblogic initial context please mail me i will be grateful to you
    mail:[email protected]

    Have a look at the ServiceLocator pattern, this caches references found and has a method getInitialContext() which instantiates an InitialContext and sets it as a member value of the ServiceLocator which itself is a Singelton.

Maybe you are looking for

  • ITunes library won't open at all??

    on my shared computer, all the other users can open itunes with no problems. but every time I try to open itunes, it says "The iTunes Library.itl file is locked, on a locked disk, or you do not h ave write permission for this file." I've reinstalled

  • Downloading Flash in a zip file

    Hi, Is it possible to download Flash Player in a zip file format, with only the files NPSWF32.dll, flashplayer.xpt, GetFlash.exe and GetFlash.exe.manifest? The idea is to unzip those files in Mozilla Firefox's \plugins and \components (for flashplaye

  • I got a macbook pro with serial number C1*****V30 but i want the full details of the laptop without opening it. how?

    i got a macbook pro with serial number C1*****V30 but i want the full details of the laptop without opening it. how? <edited by host>

  • Jdbc adapter synchronization

    Hi experts, please help me. XI/PI 7.0 i have 3 dbf files. 1.dbf 2.dbf 3.dbf and i use 3 communication chanels to select data from each file and use it in my BP: jdbcChanel1 jdbcChanel2 jdbcChanel3. So, i do it consistently: Select data from the first

  • Javascript on PDF reports

    Hello - I was wondering if there is a way to code javascript within a PDF report? I'd like to create a onmouseover event in which I would reference a .JS file. If anyone has any insights on this, please let me know as I've been researching for some t