JNDI lookup in xml file

I want to use JNDi lookup for DB. Where should i specify them. Rigtnow i have given the hibernate connections in persistance xml file with user name pwd etc. But i dont want to do this. I want to use JNDI lookup and configure my weblogic for the JNDI. What are the changes I need to make in the application context and persistance xml files. Pls help?
my persistance .xml file looks like this,
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
version="1.0"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
<persistence-unit name="jpaPersistance" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<class>com.ggg.jp.model.bo.individual</class>
<exclude-unlisted-classes/>
<properties>
<property name="hibernate.archive.autodetection" value="class, hbm"/>
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.connection.driver_class" value="oracle.jdbc.driver.OracleDriver"/>
<property name="hibernate.connection.password" value="test"/>
<property name="hibernate.connection.url" value="jdbc:oracle:thin:@localhost:1521:xe"/>
<property name="hibernate.connection.username" value="test"/>
<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/>
</properties>
</persistence-unit>
</persistence>
Application context looks like this,
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:jee="http://www.springframework.org/schema/jee"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
<!-- <bean/> definitions here -->
<context:annotation-config/>
<bean id="demoDataServiceImpl" class="com.gg.jp.model.services.impl.DemoDataServiceImpl" />
<bean id="recordGeneratorWebServiceHandler" class="com.gg.jp.webservice.RecordGeneratorWebServiceHandler">
<property name="service" ref="demoDataServiceImpl"/>
</bean>
<bean id="entityManagerFactory"
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="persistenceUnitName" value="jpaPersistance"/>
</bean>
     <tx:annotation-driven/>
     <bean id="transactionManager"
     class="org.springframework.orm.jpa.JpaTransactionManager" >
     <property name="entityManagerFactory" ref="entityManagerFactory"/>
     </bean>
     </beans>

Me again!
So I found that I can't do jndi lookup (NamingException) for the datasource as mentioned, in the init method.
However, the very same jndi lookup was successful in the overridden authenticate method, called by oc4j when trying to authenticate the user.
Go figure!
TIA,
- nik.

Similar Messages

  • Lookup into XML file in Lookup Transformation

    Hi,
    I am wondering if it is possible to do a lookup transformation where the source is an XML file, if so, what are the steps?
    thanks in advance
    paburgos

    Hi paburgos,
    If I understand correctly, you want to join two elements inside a XML file. If in this scenario, we can use Merge Join Transformation to achieve the goal.
    For more detail steps, please refer to the reply post by me in the following thread:
    https://social.technet.microsoft.com/Forums/en-US/df240bac-5196-45bc-a55b-cfe0ff5c5443/xml-import-with-duplicate-mappings?forum=sqlintegrationservices
    If there are any misunderstanding, please elaborate the issue for further investigation.
    Thanks,
    Katherine Xiong
    If you have any feedback on our support, please click
    here.
    Katherine Xiong
    TechNet Community Support

  • How to write the jndi lookup for ejb using oc4j server in jdeveloper

    Hi All,
    i am new to the JDeveloper. i want to develop the session bean in JDeveloper using the OC4J server. how to write the jndi lookup in cllient. what are the xml files need to deploy the application. where can i mention the JNDI name in xml file. so please provide the information as soon as possible.
    regards
    ram

    There is quite in-depth information in the Enterprise JavaBeans Developer's Guide.
    Section 2 (Understanding EJB Application Development) explains the xml files needed and Section 29 (Accessing an EJB from a Client) explains how to do a JNDI lookup.
    Hope this helps.

  • How to configure a JNDI ressource in the web.xml file

    Hi,
    does someone know if there is a way to configure a JNDI ressource with its parameters only in the web.xml file ?
    In my case, the JNDI ressouce is an oracle database an its conenction paramters: driverClassName, username, password, etc...
    Actually, I put everything in the configuration file of Tomcat but I would like my war file to be 100% independent of the application server.
    Thanks in advance.
    Fred.

    I wrestled with this for a long time. I may have done something wrong, but to get my mySQL JDNI reference to work, I had to add it to the server.xml file. You can try with web.xml, but I eventually just got frustrated and put it in server.xml.
    The following is between two <context> tags:
    <Resource name="jdbc/instance_name_goes_here"
                   auth="Container"
                   type="javax.sql.DataSource"/>
              <ResourceParams name="jdbc/same_instance_name_here">
                   <parameter>
                        <name>username</name>
                        <value>user_name_goes_here</value>
                   </parameter>
                   <parameter>
                        <name>password</name>
                        <value>password_goes_here</value>
                   </parameter>
                   <parameter>
                        <name>driverClassName</name>
                        <value>jdbc_fully_qualified_class_name</value>
                   </parameter>
                   <parameter>
                        <name>factory</name>
                        <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
                   </parameter>
                   <parameter>
                        <name>url</name>
                        <value>jdbc_connect_url_database_vendor_specific</value>
                   </parameter>
                   <parameter>
                        <name>maxActive</name>
                        <value>8</value>
                   </parameter>
                   <parameter>
                        <name>maxIdle</name>
                        <value>8</value>
                   </parameter>
              </ResourceParams>
    - Saish
    "My karma ran over your dogma." - Anon

  • Configuring a JNDI ressource in the web.xml file

    Hi,
    does someone know if there is a way to configure a JNDI ressource with its parameters only in the web.xml file ?
    In my case, the JNDI ressouce is an oracle database an its conenction paramters: driverClassName, username, password, etc...
    Actually, I put everything in the configuration file of Tomcat but I would like my war file to be 100% independent of the application server.
    Thanks in advance.
    Fred.

    I'm pretty sure you can't do it that way round. The logic of the thing is that database access URLs etc. tend to depend on the where the server is. The whole idea of these resources is to put the stuff that's specific to the server in server.xml and refer to it using names that should remain the same if you deploy your webapp on another server. Of, for example, you have test, stage and production servers running the same webapps but connecting to different databases.

  • Looking for tips on a OC4J/JNDI lookup problem

    Hello All,
    I am running into a situation where a user I have setup in Oracle Enterprise Manager 10G Instance Level Security is not able to access our JNDI resources. We have tried providing all the roles(including administrators) to this user, but to no success. For some reason it works in standalone though.
    Our exception is fired when deploying the application and the spring configuration tells the app to fetch the jms connection factory from JNDI.
    Caused by: javax.naming.NoPermissionException: Not allowed to look up jms/ConnectionFactory, check the namespace-access tag setting in orion-application.xml for details
    +     at com.evermind.server.rmi.RMIClientConnection.handleLookupResponse(RMIClientConnection.java:873)+
    +     at com.evermind.server.rmi.RMIClientConnection.handleOrmiCommandResponse(RMIClientConnection.java:337)+
    +     at com.evermind.server.rmi.RMIClientConnection.dispatchResponse(RMIClientConnection.java:296)+
    +     at com.evermind.server.rmi.RMIClientConnection.processReceivedCommand(RMIClientConnection.java:278)+
    +     at com.evermind.server.rmi.RMIConnection.handleCommand(RMIConnection.java:152)+
    +     at com.evermind.server.rmi.RMIConnection.listenForOrmiCommands(RMIConnection.java:127)+
    +     at com.evermind.server.rmi.RMIConnection.run(RMIConnection.java:107)+
    +     at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)+
    +     at java.lang.Thread.run(Thread.java:595)+
    +     at com.evermind.server.rmi.RMICall.warningExceptionOriginatesFromTheRemoteServer(RMICall.java:109)+
    +     at com.evermind.server.rmi.RMICall.throwRecordedException(RMICall.java:91)+
    +     at com.evermind.server.rmi.RMIClientConnection.waitForJndiResponse(RMIClientConnection.java:425)+
    +     at com.evermind.server.rmi.RMIClientConnection.lookup(RMIClientConnection.java:233)+
    +     at com.evermind.server.rmi.RMIClient.lookup(RMIClient.java:302)+
    +     at com.evermind.server.rmi.RMIClientContext.lookup(RMIClientContext.java:56)+
    +     ... 43 more+
    I wonder if there is a specific role that OC4J is looking for to allow the app to use JNDI? One thread I read earlier mentioned granting the user RMI permission. Any tips on where this could be configured?
    Our namespace section of the orion application xml file is below...
         <namespace-access>
              <read-access>
                   <namespace-resource root="">
                        <security-role-mapping name="&lt;jndi-user-role&gt;">
                             <group name="administrators" />
                        </security-role-mapping>
                   </namespace-resource>
              </read-access>
              <write-access>
                   <namespace-resource root="">
                        <security-role-mapping name="&lt;jndi-user-role&gt;">
                             <group name="administrators" />
                        </security-role-mapping>
                   </namespace-resource>
              </write-access>
         </namespace-access>
    Any thoughts or recommendations for isolating and troubleshooting the problem would be highly appreciated.
    Many Thanks in Advance Guys!

    What Mylenium said. Although, perhaps with Forge Freeform and a huge amount of work, you might be able to fake it.

  • JNDI lookup issue in weblogic 10 server

    Hi all,
    I have a serious problem in getting the datasource lookup. My application uses EJB3 and JPA and it is deployed in weblogic10. I configured datasource in the domain (ex:mydomain) using weblogic 10 admin console. Now when i try to call from a client program, it is giving me javax.naming.NameNotFoundException. I use eclipse IDE to deploy the application. From the IDE, i can start the oracle 10.3 server and it automatically deploys the application into the server in mydomain. The admin console shows that the application deployed fine. And i can see the webcontent WAR file and EJB jar deployed. Coming back to the issue.... I verified user_projects\domains\mydomain\config\jdbc\datasource-jdbc.xml and user_projects\domains\mydomain\config\config.xml file enteries. My entries are present in those files.
    When i start the server i am getting below error...
    << Stacktrace >>
    javax.naming.NameNotFoundException: While trying to look up jdbc in /app.; remaining name 'jdbc'
         at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(BasicNamingNode.java:1139)
         at weblogic.jndi.internal.ApplicationNamingNode.lookup(ApplicationNamingNode.java:144)
         at weblogic.jndi.internal.WLEventContextImpl.lookup(WLEventContextImpl.java:254)
         at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:380)
         at weblogic.deployment.PersistenceUnitInfoImpl.lookUpAppScopedDataSource(PersistenceUnitInfoImpl.java:529)
         at weblogic.deployment.PersistenceUnitInfoImpl.reconfig(PersistenceUnitInfoImpl.java:549)
         at weblogic.ejb.container.deployer.EJBModule.reconfigPersistenceUnits(EJBModule.java:529)
         at weblogic.ejb.container.deployer.EJBModule.activate(EJBModule.java:515)
         at weblogic.application.internal.flow.ModuleListenerInvoker.activate(ModuleListenerInvoker.java:107)
         at weblogic.application.internal.flow.DeploymentCallbackFlow$2.next(DeploymentCallbackFlow.java:411)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
         at weblogic.application.internal.flow.DeploymentCallbackFlow.activate(DeploymentCallbackFlow.java:74)
         at weblogic.application.internal.flow.DeploymentCallbackFlow.activate(DeploymentCallbackFlow.java:66)
         at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:635)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
         at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:212)
         at weblogic.application.internal.EarDeployment.activate(EarDeployment.java:16)
         at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:162)
         at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79)
         at weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:569)
         at weblogic.deploy.internal.targetserver.operations.ActivateOperation.activateDeployment(ActivateOperation.java:140)
         at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCommit(ActivateOperation.java:106)
         at weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:323)
         at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:820)
         at weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1227)
         at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:436)
         at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:163)
         at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliverer.java:181)
         at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$100(DeploymentReceiverCallbackDeliverer.java:12)
         at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$2.run(DeploymentReceiverCallbackDeliverer.java:67)
         at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:516)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    << Client program snippet >>
    Hashtable ht = new Hashtable();
                   ht.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
                   ht.put(Context.PROVIDER_URL, "t3://10.237.76.132:7001");
                   InitialContext ctx = null;
                   ctx = new InitialContext(ht);
                   Object obj = (Object)ctx.lookup(EmployeeBean.RemoteJNDIName);
                   EmployeeRemote empRemote = (EmployeeRemote)PortableRemoteObject.narrow(obj,com.acs.test.emp.EmployeeRemote.class);
                   List empList = empRemote.getEmployeeDetails(1);
                   System.out.println("SUCCESS"+empList.size());
    << Persistence.xml >>
    <?xml version="1.0" encoding="UTF-8"?>
    <!-- Persistence deployment descriptor for dev profile -->
    <persistence xmlns="http://java.sun.com/xml/ns/persistence"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
    version="1.0">
    <persistence-unit name="cmsepool">
    <jta-data-source>java:/mydatasource</jta-data-source>
              <class>com.acs.test.emp.EmployeeVO</class>
              <properties>
    <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
              <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.WeblogicTransactionManagerLookup"/>
    </properties>
    </persistence-unit>
    </persistence>

    Make sure that this Datasource you created is Targetted to Admin Server and full Cluster (incase of cluster domain). From Admin Console, select your datasource and check for the Targets tab. Since its JNDI lookup error, most probably it may not be deployed properly.
    HTH
    Ravi Jegga

  • Problem in JNDI Lookup of Deployable Proxy inside logon.par

    Hi,
    I have customized the Logon par file and have a functionality to call a webservice when the Password Reset happens.
    <b>from the ResetPassword.jsp , SAPMLogonLogic.java is getting called ,and there is a method called performResetPassword().</b>
    I am calling a Deployable Proxy in that method by using the below code,
    <b>Gateway objGateway=(SMSGateway)ctx.lookup("java:comp/env/MailProxy");
    MailGatewayViDocument objSMSGatewayViDocument=(MailGatewayViDocument )objGateway.getLogicalPort("wsPort_Document",MailGatewayViDocument.class);</b>
    objMailGatewayViDocument.sendMail(...);
    I am getting the Exception,
    <b>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/MailProxy.</b>
    I have deployed the Deployable Proxy in the J2EE Engine and add this API Jar as the External Library (Project >Properties>Java Build Path ---> Add External jars...Added the .jar file generated in the Proxy Project).
    Please let me know the possible solutions where i can call a deployable proxy inside the logon par file.
    Thanks and Regards,
    Sekar

    Hi Sekar!
      Try this:
    MailGateway objMailGateway=(MailGateway)ctx.lookup
    ("wsclients/proxies/sap.com/MailProxy/com.ms.sap.sms.MailProxy/wsPort_Document");
      I have understood you're deploying a par file... if you are doing this way, don't forget to put a reference to the webservice in portalApp.xml:
      <property name="PrivateSharingReference" value="SAPJ2EE::sap.com/com.ms.sap.sms.MailProxy"/>
      Hope this can work.
      Are you sure this destination is the one you are looking for?
    sap.com/CHEPSMSProxy/com.ms.sap.sms.SMSProxy/wsPort_Document
      It seems to be anther app. If this is the correct app then the JNDI should be:
       MailGateway objMailGateway=(MailGateway)ctx.lookup
    ("wsclients/proxies/sap.com/CHEPSMSProxy/com.ms.sap.sms.SMSProxy/wsPort_Document");
      If this fails and if you have have source code of the proxy app, check out the application.xml file, and look for Display name. Also look for the application-j2ee-engine.xml file, and look for the 'Vendor name', and post them please.
      Eneko
    Message was edited by:
            Eneko Rodriguez

  • Problem in loading Context.xml file

    Hi,
    I just tried to create datasource from context.xml. i did the following steps
    1. i added context.xml file in webapps/META-INF/
    2. I added the below values to that xml file.
    <?xml version="1.0" encoding="UTF-8"?>
    <Context antiJARLocking="true" path="/myApp" >
        <Resource name="jdbc/dbtest" type="javax.sql.DataSource" driverClassName="oracle.jdbc.driver.OracleDriver" password="test_dev" minIdle="1" maxIdle="1" maxActive="10" maxWait="5000" username="test_dev" url="jdbc:oracle:thin:@22.4.55.6:1521:TEST"/>
    </Context>3.
    public class TestDB {
         private static Logger log = Logger.getLogger(TestDB.class.getName());
         private final static String JNDI_PATH_DB            = "java:comp/env/jdbc/dbtest";
         public javax.sql.DataSource getCatalogDS() throws NamingException
              try
                   InitialContext initCtx = new InitialContext();
                   return (DataSource)initCtx.lookup(JNDI_PATH_DB);
              catch (NamingException ex)
                   log.info("NamingException: " + ex.getMessage());
                   throw ex;
         public Connection getConnection() throws Exception
              try
                  DataSource catalogDS = getCatalogDS();
                   return catalogDS.getConnection();
              catch(Exception ex)
                   log.info(ex.getMessage());
                   throw ex;
         public static void main (String args[]){
                   try {
                        TestDB obj = new TestDB();
                        System.out.println("before lookup");
                        System.out.println("Datasource is "+obj.getConnection());
                   } catch( NamingException ne ) {
                        throw new RuntimeException( "Unable to aquire data source", ne );
         catch (Exception e)
              String st = StringUtils.StackTraceToString( e );
    }4. i run this class to get connection.
    i am getting an error
    Exception in thread "main" java.lang.RuntimeException: Unable to aquire data source
         at it.sscenter.escape.admintools.TestDB.main(TestDB.java:51)
    Caused by: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file:  java.naming.factory.initial
         at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:645)
         at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
         at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:325)
         at javax.naming.InitialContext.lookup(InitialContext.java:392)
         at it.sscenter.escape.admintools.TestDB.getCatalogDS(TestDB.java:22)
         at it.sscenter.escape.admintools.TestDB.getConnection(TestDB.java:35)
         at it.sscenter.escape.admintools.TestDB.main(TestDB.java:49)Is that right way or do i need to configure the context file in somewhere OR do i need to create an properties file?
    Kindly help to resolve this issue.
    Thanks
    Jasmin

    EJP wrote:
    You need to give the InitialContext some properties, there's no magical way it'll configure itself (outside of a Java EE container).If you lookup a URL with a known protocol, e.g. ldap: or in this case java:, it will configure itself in any environment that has a factory for the protocol.Is this a recent change? Last time I was accessing Ldap, it did require me to specify the com.sun.jndi.ldap.LdapCtxFactory separately.

  • JNDI lookup for Crystal Reports at runtime

    How to run a rpt to fetch data from database connection defined in Tomcat's JNDI resources ? We are using JDBC(JNDI) Data source while designing the report in the Crystal Report designer and we want to use 'Connection Name' at runtime for jndi lookup to Tomcats JNDI resources.

    Hi,
    Thanks, this helped in resolving the JNDI lookup problem. But we are not having an issue in connecting to DS as it fails with error "Unsupported JNDI Object".
    Tried suggestions on this link: "http://www.theserverside.com/discussions/thread.tss?thread_id=37430", but no luck.
    Here are the configuration files:
    context.xml:
    <Context>
    <Resource name="jdbc/remedy" auth="Container" type="javax.sql.DataSource" driverClassName="oracle.jdbc.OracleDriver" url="jdbc:oracle:thin:@10.76.85.68:1521:dtv" maxActive="20" maxIdle="10" maxWait="-1" />
    </Context>
    web.xml:
    <resource-ref>
              <description>DB Connection</description>
              <res-ref-name>jdbc/remedy</res-ref-name>
              <res-type>javax.sql.DataSource</res-type>
              <res-auth>Container</res-auth>
    </resource-ref>
    Log:
    2009-10-30 06:38:05,804 DEBUG [com.crystaldecisions.reports.formatter.a.c] - Export Supervisor: number of destination exporters:1
    2009-10-30 06:38:05,804 DEBUG [com.crystaldecisions.reports.formatter.a.c] - Export Supervisor: number of format exporters:4
    2009-10-30 06:38:05,865 INFO [com.businessobjects.reports.sdk.JRCCommunicationAdapter] - JRCAgent1 received request: fetchReportPageRequest
    2009-10-30 06:38:05,865 INFO [com.businessobjects.reports.sdk.JRCCommunicationAdapter] - JRCAgent1 attempting to acquire license
    2009-10-30 06:38:05,865 INFO [com.businessobjects.reports.sdk.JRCCommunicationAdapter] - JRCAgent1 successfully acquired license
    2009-10-30 06:38:05,867 DEBUG [com.businessobjects.reports.sdk.JRCCommunicationAdapter] - Requesting page 1
    2009-10-30 06:38:05,879 INFO [com.crystaldecisions.reports.queryengine.driverImpl] - Logon: Connecting to database using local JNDI server ...
    2009-10-30 06:38:05,888 DEBUG [com.crystaldecisions.reports.reportdefinition.datainterface] - Failed to open connection (Connection:  databaseType=JDBC (JNDI)  serverName=jdbc:oracle:thin:@10.76.85.68:1521:dtv  state=closed  databaseDriverName=crdb_jdbc.dll).
    com.crystaldecisions.reports.queryengine.al: Unsupported JNDI Object (remedy)
         at com.crystaldecisions.reports.queryengine.driverImpl.o.if(Unknown Source)
         at com.crystaldecisions.reports.queryengine.av.new(Unknown Source)
         at com.crystaldecisions.reports.queryengine.av.byte(Unknown Source)
         at com.crystaldecisions.reports.reportdefinition.datainterface.b.a(Unknown Source)
         at com.crystaldecisions.reports.reportdefinition.datainterface.b.a(Unknown Source)
         at com.crystaldecisions.reports.reportdefinition.datainterface.b.a(Unknown Source)
         at com.crystaldecisions.reports.reportdefinition.datainterface.b.if(Unknown Source)
         at com.crystaldecisions.reports.reportdefinition.datainterface.j.a(Unknown Source)
         at com.businessobjects.reports.sdk.b.i.if(Unknown Source)
         at com.businessobjects.reports.sdk.b.i.a(Unknown Source)
         at com.businessobjects.reports.sdk.b.i.byte(Unknown Source)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.request(Unknown Source)
         at com.crystaldecisions.proxy.remoteagent.y.a(Unknown Source)
         at com.crystaldecisions.proxy.remoteagent.r.a(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.cf.a(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.ReportSource.a(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.ReportSource.getPage(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.AdvancedReportSource.getPage(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.NonDCPAdvancedReportSource.getPage(Unknown Source)
         at com.crystaldecisions.report.web.event.ac.a(Unknown Source)
         at com.crystaldecisions.report.web.event.ac.a(Unknown Source)
         at com.crystaldecisions.report.web.event.b2.a(Unknown Source)
         at com.crystaldecisions.report.web.event.b7.broadcast(Unknown Source)
         at com.crystaldecisions.report.web.event.av.a(Unknown Source)
         at com.crystaldecisions.report.web.WorkflowController.do(Unknown Source)
    Edited by: MuralidharS on Oct 30, 2009 8:46 AM

  • JNDI lookup help please-Bean to Bean callout locally in same oc4j container

    Hi - I'm fairly new to oc4j/ejb coding - I'm trying to get a simple application running to show that our code can be run in local mode - here is the scenario:
    - Bean A (our application bean) within Application A
    - Bean B (customer-developed bean) within Application B
    - Bean B calls Bean A
    - Bean A + Bean B are different application instances in the same oc4j container
    - Jsp (residing in ApplicationB) within the same oc4j container calling Bean B, which invokes Bean A
    ====
    I get the following exception (classes renamed to match scenario):
    javax.naming.NameNotFoundException: oracle.apps.applicationa.common.BeanA not found in anothercompany.applicationb.common.BeanB
    [java] at com.oracle.naming.J2EEContext.getSubContext(J2EEContext.java:93)
    [java] at com.oracle.naming.J2EEContext.lookup(J2EEContext.java:76)
    [java] at com.evermind.server.ApplicationContext.lookupJavaCompEnv(ApplicationContext.java:265)
    [java] at com.evermind.server.ApplicationContext.lookupJavaComp(ApplicationContext.java:132)
    [java] at com.evermind.server.ApplicationContext.lookup(ApplicationContext.java:306)
    [java] at com.evermind.server.ApplicationContext.lookup(ApplicationContext.java:120)
    [java] at javax.naming.InitialContext.lookup(InitialContext.java:347)
    - BeanA is part of application named "AppA" in server.xml
    - BeanB is part of application named "AppB" in server.xml
    - AppB has attribute 'parent="AppA"' in server.xml
    - If I change the Jsp file (residing in AppB) to call BeanA directly in the jsp code it works with no JNDI error, but changing the jsp code back to calling BeanB (which then calls BeanA) will throw the NameNotFoundException
    My Stateless Session Bean is very simple and I have tried not setting the context and setting the context. I'm thinking this is a very simple configuration issue, but have not been able to find the solution yet... I've tried playing with the setSessionContext method in the session bean but have had no luck and am not sure what to set the variables to or even if I'm in the correct method...
    public void setSessionContext(SessionContext ctx) {   
    if (verbose)
    System.out.println("setSessionContext called");
    Properties env = new Properties();
    // tried all three context factories...
    //env.put(Context.INITIAL_CONTEXT_FACTORY,"com.evermind.server.ApplicationInitalContextFactory");
    env.put(Context.INITIAL_CONTEXT_FACTORY,"com.evermind.server.ApplicationClientInitialContextFactory");
    //env.put(Context.INITIAL_CONTEXT_FACTORY,"com.evermind.server.rmi.RMIInitialContextFactory");
    // not sure what url to put, if any
    //env.put(Context.PROVIDER_URL, "ormi://localhost:23791/AppB");
    env.put(Context.PROVIDER_URL, "ormi://localhost/AppB");
    // tried with and without security principals... also tried sysadmin/sysadmin
    env.put(Context.SECURITY_PRINCIPAL, "guest");
    env.put(Context.SECURITY_CREDENTIALS, "welcome");
    // mProps is a local transient member var of type Properties
    mProps = env;
    // mCtx is a local transient member var of type SessionContext
    mCtx = ctx;
    (edit) additional info:
    - all beans/classes are in the same classes directory; there are no jar files, so in application.xml the specified classpath is "classes" which includes both appA and appB classes
    - I verified that if I point (appB) jsp directly to BeanA it works with the "parent" attribute set on appB in server.xml, and when I remove the "parent" attribute on appB in server.xml the jsp throws a NameNotFoundException
    edit #2:
    another interesting note is that the exception message says "oracle.apps.applicationa.common.BeanA not found in anothercompany.applicationb.common.BeanB"
    and usually the naming error I see is:
    "oracle.apps.applicationa.common.BeanA not found in appB"
    (as with the case when I use a jsp to access appA beans without setting the parent application of appB to appA)
    - also my j2ee/home/applications/appB/WEB-INF/web.xml includes the oracle.apps.applicationa.common.BeanA ejb-ref tag
    any help is appreciated - thanks!
    Message was edited by:
    oleon

    Hi Steve
    thanks for the reply - I currently have the parent attribute set in server.xml which is why the jsp connection works, but for some strange reason the bean cannot connect to other bean...
    my server.xml has something like...
    <application name="appA" location="appA" auto-start="true"/>
    <application name="appB" location="appB" parent="appA" auto-start="true"/>
    (ok, the tags might be off because I'm not in front of my workstation looking at the xml file...)
    on another interesting note, in the session bean for AppB I've tried searching for the ejb bean for app B (itself basically) with the default initial context and it cannot find its own bean within the same application... the message would be something like "NameNotFoundException: anothercompany.applicationb.common.BeanB not found in anothercompany.applicationb.common.BeanB"

  • Weblogic JNDI lookup in Applet

    Hi
    We are facing problem in JNDI lookup inside the applet
    here is the scenario
    We have two weblogic servers(port 7001)
    one server is main server where the Applet1 , weblogic.jar and app.htm
    are in C:\bea\wlserver6.0sp1\config\mydomain\applications\DefaultWebApp_myserver
    and another is proxy server where HTTPProxyServlet is running and one
    web.xml file ( wall these files are provided by weblogic and the port
    of proxy server is 448)
    Both the servers are running on different machines
    and when we run the client browser and put the folloing url
    http://proxyServer IP Address:448/app.htm
    we get the following exception
    Java(TM) Plug-in: Version 1.3.0-C
    Using JRE version 1.3.0 Java HotSpot(TM) Client VM
    User home directory = C:\Documents and Settings\kkumar
    Proxy Configuration: no proxy
    JAR cache enabled.
    In Init.1..:
    In Init.after ..doClassLoaderWorkaround
    In Init.after setText:
    In Init.before initjms:
    In initjms begin
    In initjms hostName...:10.1.10.211
    In initjms before initialcontext...:
    In initjms after initialcontext...:
    javax.naming.ConfigurationException. Root exception is
    java.rmi.MarshalException: failed to marshal public abstract
    java.lang.Object
    weblogic.jndi.internal.NamingNode.lookup(java.lang.String,java.util.Hashtable)
    throws javax.naming.NamingException,java.rmi.RemoteException; nested
    exception is:
    java.io.NotSerializableException: javax.naming.InitialContext
    java.io.NotSerializableException: javax.naming.InitialContext
    at java.io.ObjectOutputStream.outputObject(Unknown Source)
    at java.io.ObjectOutputStream.writeObject(Unknown Source)
    at java.io.ObjectOutputStream.outputClassFields(Unknown Source)
    at java.io.ObjectOutputStream.defaultWriteObject(Unknown Source)
    at java.io.ObjectOutputStream.outputObject(Unknown Source)
    at java.io.ObjectOutputStream.writeObject(Unknown Source)
    at java.util.Hashtable.writeObject(Unknown Source)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.io.ObjectOutputStream.invokeObjectWriter(Unknown Source)
    at java.io.ObjectOutputStream.outputObject(Unknown Source)
    at java.io.ObjectOutputStream.writeObject(Unknown Source)
    at
    weblogic.common.internal.ChunkedObjectOutputStream.writeObject(ChunkedObjectOutputStream.java:102)
    at
    weblogic.common.internal.ChunkedObjectOutputStream.writeObject(ChunkedObjectOutputStream.java:108)
    at weblogic.rmi.internal.ObjectIO.writeObject(ObjectIO.java:19)
    at
    weblogic.rmi.internal.BasicRemoteRef.marshalArgs(BasicRemoteRef.java:121)
    at
    weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:246)
    at
    weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:225)
    at
    weblogic.jndi.internal.ServerNamingNode_WLStub.lookup(ServerNamingNode_WLStub.java:121)
    at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:323)
    at javax.naming.InitialContext.lookup(Unknown Source)
    at Applet1.initJMS(Applet1.java:128)
    at Applet1.init(Applet1.java:46)
    at sun.applet.AppletPanel.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Initialization failed
    In Init.end of initjms:
    the files are here
    app.htm
                   <OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
                        width="650" height="300" align="baseline"
                        codebase="http://java.sun.com/products/plugin/1.2.2/jinstall-1_2_2-win.cab#Version=1,2,2,0"
    >
                   <PARAM NAME="code" VALUE="Applet1">
                   <PARAM NAME="codebase" VALUE=".">
                   <PARAM NAME="AppletName" VALUE="Applet1">
                   <PARAM NAME="archive" VALUE="weblogic.jar">
                   <PARAM NAME="MAYSCRIPT" VALUE="true">
                   <PARAM NAME="type"
    VALUE="application/x-java-applet;version=1.2.2">
                   <PARAM NAME="model" VALUE="models/HyaluronicAcid.xyz">
                   <PARAM NAME="scriptable" VALUE="true">
                   <!--
                   <COMMENT>
                        <EMBED type="application/x-java-applet;version=1.2.2" width="650"
    height="300" align="baseline"
                                  code="ANZPopupApplet.class" codebase="../"
    model="models/HyaluronicAcid.xyz"
                             pluginspage="http://java.sun.com/products/plugin/1.2/plugin-install.html"
    MAYSCRIPT="true">
                        <NOEMBED>
                   </COMMENT>
                   -->
                                  No JDK 1.2 support for APPLET!!
                        </NOEMBED>
                        </EMBED>
                   </OBJECT>
    </html>
    Applet1.java
    import java.awt.*;
    import java.applet.*;
    import java.net.*;
    import java.util.*;
    import javax.naming.*;
    import javax.jms.*;
    import java.lang.reflect.*;
    public class Applet1 extends Applet implements MessageListener {
    private boolean started = false;
    // JMS Stuff
    private InitialContext jmsContext = null;
    private QueueConnectionFactory jmsConnFactory = null;
    private QueueConnection jmsConnection = null;
    private Queue jmsQueue = null;
    private QueueSession jmsSession = null;
    private QueueSender jmsSender = null;
    private QueueReceiver jmsReceiver = null;
    // init - called to inform this applet that it has been
    // loaded into the system
    public void init() {
    //{{INIT_CONTROLS
    System.out.println("In Init.1..:");
         //doClassLoaderWorkaround();
    System.out.println("In Init.after ..doClassLoaderWorkaround");
    setLayout(null);
    setSize(426,266);
    jmslabel.setText("JMS Applet");
    System.out.println("In Init.after setText:");
    add(jmslabel);
    jmslabel.setBounds(144,12,148,24);
    textArea1.setEnabled(false);
    add(textArea1);
    textArea1.setBounds(24,36,375,100);
    jmsleaveButton.setLabel("Leave");
    add(jmsleaveButton);
    jmsleaveButton.setBackground(java.awt.Color.lightGray);
    jmsleaveButton.setBounds(312,240,78,20);
    add(jmsMessageField);
    jmsMessageField.setBounds(24,168,367,38);
    System.out.println("In Init.before initjms:");
    initJMS();
    System.out.println("In Init.end of initjms:");
    //{{DECLARE_CONTROLS
         java.awt.Label jmslabel = new java.awt.Label();
         java.awt.TextArea textArea1 = new java.awt.TextArea();
         java.awt.Button jmsleaveButton = new java.awt.Button();
         java.awt.TextField jmsMessageField = new java.awt.TextField();
    // getAppletInfo - Returns information about this applet.
    public String getAppletInfo() {
    return "JMS Applet\r\n";
    // destroy - called to inform this applet that it is being
    // reclaimed and that it should destroy any resources that
    // it has allocated.
    public void destroy() {
    try {
    if(started) {
    if (jmsConnection != null) {
    jmsConnection.stop();
    jmsConnection = null;
    started = false;
    stop();
    catch(Exception e) {
    // start - called to inform this applet that it should start its
    execution
    public void start() {
    if(!started) {
    started = true;
    // stop - Called to inform this applet that it should stop its
    execution
    public void stop() {
    textArea1.setEnabled(false);
    jmsMessageField.setEnabled(false);
    // action - handles entering message, Leave button clicked
    public boolean action(Event evt, Object obj) {
    System.out.println("In action begin:");
    if(evt.id == Event.ACTION_EVENT) {
    if(obj.equals(jmsMessageField.getText())) {
    System.out.println("In action before sendData:");
    sendData(jmsMessageField.getText());
    System.out.println("In action after sendData:");
    jmsMessageField.setText("");
    return true;
    if(obj.equals(jmsleaveButton.getLabel())) {
    destroy();
    return true;
    // initJMS - initialize all of the JMS stuff
    private void initJMS() {
    try {
    System.out.println("In initjms begin");
    String hostName = this.getCodeBase().getHost();
    System.out.println("In initjms hostName...:"+hostName);
    Hashtable env = new Hashtable();
    env.put(Context.APPLET,this);
    env.put(Context.PROVIDER_URL,
    "t3://" + hostName + ":448");
    env.put(Context.INITIAL_CONTEXT_FACTORY,
    "weblogic.jndi.WLInitialContextFactory");
    System.out.println("In initjms before initialcontext...:");
    jmsContext = new InitialContext(env);
    System.out.println("In initjms after initialcontext...:");
    jmsConnFactory
    =(QueueConnectionFactory)jmsContext.lookup("javax.jms.QueueConnectionFactory");
    System.out.println("In initjms after initialcontext..lookup.:");
    jmsConnection = jmsConnFactory.createQueueConnection();
    System.out.println("In initjms after initialcontext..lookup1.:");
    jmsSession = jmsConnection.createQueueSession(false,Session.AUTO_ACKNOWLEDGE);
    System.out.println("In initjms before lookup...:");
    jmsQueue =(Queue)jmsContext.lookup("jms.queue.TestQueue1");
    jmsConnection.start();
    jmsSender = jmsSession.createSender(jmsQueue);
    jmsReceiver = jmsSession.createReceiver(jmsQueue);
    jmsReceiver.setMessageListener(this);
    System.out.println("In initjms before setMessageListener...end of the
    const:");
    catch(Exception e) {
    e.printStackTrace();
    System.out.println("Initialization failed");
    // sendData - sends a message
    void sendData(String data) {
    try {
    System.out.println("In sendData before createTextMessage:");
    TextMessage message = jmsSession.createTextMessage();
    message.setText(data);
    jmsSender.send(message);
    System.out.println("In sendData end data:"+data);
    catch(Exception e) {
    System.out.println("Failed to send message");
    // onMessage - asynchronously receives a message
    public void onMessage(Message message) {
    String data;
    try {
    System.out.println("In onMessage:");
    data = ((TextMessage)message).getText();
    System.out.println("In onMessage data:"+data);
    textArea1.append(data + "\n");
    repaint();
    System.out.println("In onMessage end:");
    catch(Exception e) {
    System.out.println("Failed to receive message");
    private void doClassLoaderWorkaround(){
    boolean didit = false;
    // Get the ClassLoader of this applet:
    ClassLoader cloader = this.getClass().getClassLoader();
    if (cloader == null){
    System.out.println("### getClassLoader() returned null");
    else
    // We might call this handy utility routine:
    // boolean didit =
    Thread.currentThread().setContextClassLoader(cloader);
         Method setContextClassLoaderMeth = null;
         try {
              Method [] allMethods = Thread.class.getMethods();
              for ( int i = 0; i < allMethods.length; i++ ) {
                   if (allMethods.getName().equals("setContextClassLoader")) {
                        setContextClassLoaderMeth = allMethods[i];
                        break;
         catch(Exception e) {
              System.out.println("---Exception " + e);
    // but we don't because we need more visibility about what goes
    wrong.
    // Rather, reproduce that logic here, with extra error messages:
    //Method setContextClassLoaderMeth = null;
    try{
    // Class params = ClassLoader.class ;
    // setContextClassLoaderMeth =
    //Thread.class.getMethod("setContextClassLoader", params);
    catch (NoSuchMethodException ne) {
    setContextClassLoaderMeth = null;
    System.out.println("--- This java version does not have the
    method 'setContextClassLoader'. Not a problem.");
    return;
    catch (Exception ae){
    setContextClassLoaderMeth = null;
    System.out.println("### Thread.class.getMethod() threw
    unexpected exception: " + ae.getMessage());
    if (setContextClassLoaderMeth != null){
    Object[] args = { cloader };
    try{
    setContextClassLoaderMeth.invoke(Thread.currentThread(),
    args);
    didit = true;
    catch (InvocationTargetException ite){
    Throwable be = ite.getTargetException();
    System.out.println("### Thread.setContextClassLoader() failed:
    InvocationTargetException: " + be.getMessage());
    catch (Exception ie){
    System.out.println("### Thread.setContextClassLoader() threw
    unexpected exception: " + ie.getMessage());
    if (didit){
    System.out.println("--- Succeeded in setting the
    ContextClassLoader of this thread to be this applet's own
    ClassLoader");
    else{
    System.out.println("### Could not set ContextClassLoader,
    additional threads may not be able");
    System.out.println("### to get a JNDI Context in java 122 or
    greater.");
    any clue or thought. please help
    regards
    mohan

    It looks like the object that you have placed into the JNDO tree is not serializable or doesnt implement exernalizable!
    java.io.NotSerializableException
    0rrc
    On 26 Jul 2001 16:10:35 -0700, [email protected] (Mohan Raj) wrote:
    Hi
    We are facing problem in JNDI lookup inside the applet
    here is the scenario
    We have two weblogic servers(port 7001)
    one server is main server where the Applet1 , weblogic.jar and app.htm
    are in C:\bea\wlserver6.0sp1\config\mydomain\applications\DefaultWebApp_myserver
    and another is proxy server where HTTPProxyServlet is running and one
    web.xml file ( wall these files are provided by weblogic and the port
    of proxy server is 448)
    Both the servers are running on different machines
    and when we run the client browser and put the folloing url
    http://proxyServer IP Address:448/app.htm
    we get the following exception
    Java(TM) Plug-in: Version 1.3.0-C
    Using JRE version 1.3.0 Java HotSpot(TM) Client VM
    User home directory = C:\Documents and Settings\kkumar
    Proxy Configuration: no proxy
    JAR cache enabled.
    In Init.1..:
    In Init.after ..doClassLoaderWorkaround
    In Init.after setText:
    In Init.before initjms:
    In initjms begin
    In initjms hostName...:10.1.10.211
    In initjms before initialcontext...:
    In initjms after initialcontext...:
    javax.naming.ConfigurationException. Root exception is
    java.rmi.MarshalException: failed to marshal public abstract
    java.lang.Object
    weblogic.jndi.internal.NamingNode.lookup(java.lang.String,java.util.Hashtable)
    throws javax.naming.NamingException,java.rmi.RemoteException; nested
    exception is:
    java.io.NotSerializableException: javax.naming.InitialContext
    java.io.NotSerializableException: javax.naming.InitialContext
    at java.io.ObjectOutputStream.outputObject(Unknown Source)
    at java.io.ObjectOutputStream.writeObject(Unknown Source)
    at java.io.ObjectOutputStream.outputClassFields(Unknown Source)
    at java.io.ObjectOutputStream.defaultWriteObject(Unknown Source)
    at java.io.ObjectOutputStream.outputObject(Unknown Source)
    at java.io.ObjectOutputStream.writeObject(Unknown Source)
    at java.util.Hashtable.writeObject(Unknown Source)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.io.ObjectOutputStream.invokeObjectWriter(Unknown Source)
    at java.io.ObjectOutputStream.outputObject(Unknown Source)
    at java.io.ObjectOutputStream.writeObject(Unknown Source)
    at
    weblogic.common.internal.ChunkedObjectOutputStream.writeObject(ChunkedObjectOutputStream.java:102)
    at
    weblogic.common.internal.ChunkedObjectOutputStream.writeObject(ChunkedObjectOutputStream.java:108)
    at weblogic.rmi.internal.ObjectIO.writeObject(ObjectIO.java:19)
    at
    weblogic.rmi.internal.BasicRemoteRef.marshalArgs(BasicRemoteRef.java:121)
    at
    weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:246)
    at
    weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:225)
    at
    weblogic.jndi.internal.ServerNamingNode_WLStub.lookup(ServerNamingNode_WLStub.java:121)
    at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:323)
    at javax.naming.InitialContext.lookup(Unknown Source)
    at Applet1.initJMS(Applet1.java:128)
    at Applet1.init(Applet1.java:46)
    at sun.applet.AppletPanel.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Initialization failed
    In Init.end of initjms:
    the files are here
    app.htm
                   <OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
                        width="650" height="300" align="baseline"
                        codebase="http://java.sun.com/products/plugin/1.2.2/jinstall-1_2_2-win.cab#Version=1,2,2,0"
    >
                   <PARAM NAME="code" VALUE="Applet1">
                   <PARAM NAME="codebase" VALUE=".">
                   <PARAM NAME="AppletName" VALUE="Applet1">
                   <PARAM NAME="archive" VALUE="weblogic.jar">
                   <PARAM NAME="MAYSCRIPT" VALUE="true">
                   <PARAM NAME="type"
    VALUE="application/x-java-applet;version=1.2.2">
                   <PARAM NAME="model" VALUE="models/HyaluronicAcid.xyz">
                   <PARAM NAME="scriptable" VALUE="true">
                   <!--
                   <COMMENT>
                        <EMBED type="application/x-java-applet;version=1.2.2" width="650"
    height="300" align="baseline"
                                  code="ANZPopupApplet.class" codebase="../"
    model="models/HyaluronicAcid.xyz"
                             pluginspage="http://java.sun.com/products/plugin/1.2/plugin-install.html"
    MAYSCRIPT="true">
                        <NOEMBED>
                   </COMMENT>
                   -->
                                  No JDK 1.2 support for APPLET!!
                        </NOEMBED>
                        </EMBED>
                   </OBJECT>
    </html>
    Applet1.java
    import java.awt.*;
    import java.applet.*;
    import java.net.*;
    import java.util.*;
    import javax.naming.*;
    import javax.jms.*;
    import java.lang.reflect.*;
    public class Applet1 extends Applet implements MessageListener {
    private boolean started = false;
    // JMS Stuff
    private InitialContext jmsContext = null;
    private QueueConnectionFactory jmsConnFactory = null;
    private QueueConnection jmsConnection = null;
    private Queue jmsQueue = null;
    private QueueSession jmsSession = null;
    private QueueSender jmsSender = null;
    private QueueReceiver jmsReceiver = null;
    // init - called to inform this applet that it has been
    // loaded into the system
    public void init() {
    //{{INIT_CONTROLS
    System.out.println("In Init.1..:");
         //doClassLoaderWorkaround();
    System.out.println("In Init.after ..doClassLoaderWorkaround");
    setLayout(null);
    setSize(426,266);
    jmslabel.setText("JMS Applet");
    System.out.println("In Init.after setText:");
    add(jmslabel);
    jmslabel.setBounds(144,12,148,24);
    textArea1.setEnabled(false);
    add(textArea1);
    textArea1.setBounds(24,36,375,100);
    jmsleaveButton.setLabel("Leave");
    add(jmsleaveButton);
    jmsleaveButton.setBackground(java.awt.Color.lightGray);
    jmsleaveButton.setBounds(312,240,78,20);
    add(jmsMessageField);
    jmsMessageField.setBounds(24,168,367,38);
    System.out.println("In Init.before initjms:");
    initJMS();
    System.out.println("In Init.end of initjms:");
    //{{DECLARE_CONTROLS
         java.awt.Label jmslabel = new java.awt.Label();
         java.awt.TextArea textArea1 = new java.awt.TextArea();
         java.awt.Button jmsleaveButton = new java.awt.Button();
         java.awt.TextField jmsMessageField = new java.awt.TextField();
    // getAppletInfo - Returns information about this applet.
    public String getAppletInfo() {
    return "JMS Applet\r\n";
    // destroy - called to inform this applet that it is being
    // reclaimed and that it should destroy any resources that
    // it has allocated.
    public void destroy() {
    try {
    if(started) {
    if (jmsConnection != null) {
    jmsConnection.stop();
    jmsConnection = null;
    started = false;
    stop();
    catch(Exception e) {
    // start - called to inform this applet that it should start its
    execution
    public void start() {
    if(!started) {
    started = true;
    // stop - Called to inform this applet that it should stop its
    execution
    public void stop() {
    textArea1.setEnabled(false);
    jmsMessageField.setEnabled(false);
    // action - handles entering message, Leave button clicked
    public boolean action(Event evt, Object obj) {
    System.out.println("In action begin:");
    if(evt.id == Event.ACTION_EVENT) {
    if(obj.equals(jmsMessageField.getText())) {
    System.out.println("In action before sendData:");
    sendData(jmsMessageField.getText());
    System.out.println("In action after sendData:");
    jmsMessageField.setText("");
    return true;
    if(obj.equals(jmsleaveButton.getLabel())) {
    destroy();
    return true;
    // initJMS - initialize all of the JMS stuff
    private void initJMS() {
    try {
    System.out.println("In initjms begin");
    String hostName = this.getCodeBase().getHost();
    System.out.println("In initjms hostName...:"+hostName);
    Hashtable env = new Hashtable();
    env.put(Context.APPLET,this);
    env.put(Context.PROVIDER_URL,
    "t3://" + hostName + ":448");
    env.put(Context.INITIAL_CONTEXT_FACTORY,
    "weblogic.jndi.WLInitialContextFactory");
    System.out.println("In initjms before initialcontext...:");
    jmsContext = new InitialContext(env);
    System.out.println("In initjms after initialcontext...:");
    jmsConnFactory
    =(QueueConnectionFactory)jmsContext.lookup("javax.jms.QueueConnectionFactory");
    System.out.println("In initjms after initialcontext..lookup.:");
    jmsConnection = jmsConnFactory.createQueueConnection();
    System.out.println("In initjms after initialcontext..lookup1.:");
    jmsSession = jmsConnection.createQueueSession(false,Session.AUTO_ACKNOWLEDGE);
    System.out.println("In initjms before lookup...:");
    jmsQueue =(Queue)jmsContext.lookup("jms.queue.TestQueue1");
    jmsConnection.start();
    jmsSender = jmsSession.createSender(jmsQueue);
    jmsReceiver = jmsSession.createReceiver(jmsQueue);
    jmsReceiver.setMessageListener(this);
    System.out.println("In initjms before setMessageListener...end of the
    const:");
    catch(Exception e) {
    e.printStackTrace();
    System.out.println("Initialization failed");
    // sendData - sends a message
    void sendData(String data) {
    try {
    System.out.println("In sendData before createTextMessage:");
    TextMessage message = jmsSession.createTextMessage();
    message.setText(data);
    jmsSender.send(message);
    System.out.println("In sendData end data:"+data);
    catch(Exception e) {
    System.out.println("Failed to send message");
    // onMessage - asynchronously receives a message
    public void onMessage(Message message) {
    String data;
    try {
    System.out.println("In onMessage:");
    data = ((TextMessage)message).getText();
    System.out.println("In onMessage data:"+data);
    textArea1.append(data + "\n");
    repaint();
    System.out.println("In onMessage end:");
    catch(Exception e) {
    System.out.println("Failed to receive message");
    private void doClassLoaderWorkaround(){
    boolean didit = false;
    // Get the ClassLoader of this applet:
    ClassLoader cloader = this.getClass().getClassLoader();
    if (cloader == null){
    System.out.println("### getClassLoader() returned null");
    else
    // We might call this handy utility routine:
    // boolean didit =
    Thread.currentThread().setContextClassLoader(cloader);
         Method setContextClassLoaderMeth = null;
         try {
              Method [] allMethods = Thread.class.getMethods();
              for ( int i = 0; i < allMethods.length; i++ ) {
                   if (allMethods.getName().equals("setContextClassLoader")) {
                        setContextClassLoaderMeth = allMethods[i];
                        break;
         catch(Exception e) {
              System.out.println("---Exception " + e);
    // but we don't because we need more visibility about what goes
    wrong.
    // Rather, reproduce that logic here, with extra error messages:
    //Method setContextClassLoaderMeth = null;
    try{
    // Class params = ClassLoader.class ;
    // setContextClassLoaderMeth =
    //Thread.class.getMethod("setContextClassLoader", params);
    catch (NoSuchMethodException ne) {
    setContextClassLoaderMeth = null;
    System.out.println("--- This java version does not have the
    method 'setContextClassLoader'. Not a problem.");
    return;
    catch (Exception ae){
    setContextClassLoaderMeth = null;
    System.out.println("### Thread.class.getMethod() threw
    unexpected exception: " + ae.getMessage());
    if (setContextClassLoaderMeth != null){
    Object[] args = { cloader };
    try{
    setContextClassLoaderMeth.invoke(Thread.currentThread(),
    args);
    didit = true;
    catch (InvocationTargetException ite){
    Throwable be = ite.getTargetException();
    System.out.println("### Thread.setContextClassLoader() failed:
    InvocationTargetException: " + be.getMessage());
    catch (Exception ie){
    System.out.println("### Thread.setContextClassLoader() threw
    unexpected exception: " + ie.getMessage());
    if (didit){
    System.out.println("--- Succeeded in setting the
    ContextClassLoader of this thread to be this applet's own
    ClassLoader");
    else{
    System.out.println("### Could not set ContextClassLoader,
    additional threads may not be able");
    System.out.println("### to get a JNDI Context in java 122 or
    greater.");
    any clue or thought. please help
    regards
    mohan

  • Env-entry-mapping in orion-application-client not available in JNDI lookup

    I have an application client module in my EAR file that I've configured to auto-start.
    It has a few env-entry defined in it's application-client.xml.
    When I deploy the EAR file to OC4J 10.1.3, the application client module gets started and can access these env-entry properties from its JNDIContext.
    Now, comes the problem. During the deployment process, I edit the Deployment Plan, and change the env-entry property values, and then deploy the application.
    However, the application client module still gets the original values when it does the JNDI lookups of those env-entry names.
    I have checked to see that OC4J creates an orion-application-client.xml during deployment and it shows the env-entry-mapping elements with the updated values.
    Why is the JNDI lookup returning the values from application-client.xml and not the overriden values set in orion-application-client.xml?
    I have tried this on OC4J 10.1.3, as well as 10.1.3.1.0 - got same behavior.
    Is this a bug in OC4J? This seems to work fine with ejb modules, but not application client modules.
    Thanks,
    Kalpak

    Avi!
    Of course, I had tried it before I wrote the question. I put the modified xml file into the application area. After that AS restarts OC4J instance. And then I find my xml without any changes I made! I tried to do the same thing from the AS console. The same!
    Leonid

  • How dos the application will know the path of persistence.xml file

    Hi ,
    I am seeing examples for ConatierManaged EntityManager
    @PersistenceContext
    public class Test extends HttpServlet
    public void doGet()
    EntityManager em
    // JnDI Lookup code
    em = (EntityManager) ctx.lookup("java:comp/env/persistence/em");
    em.persist(Employee)
    }Inside web.xml file
    <web-app>
    <persistence-context-ref>
    <persistence-context-ref-name>persistence/em</persistence-context-ref-name>
      <persistence-unit-name>my-pu</persistence-unit-name>
    </persistence-context-ref>
    </web-app>Please tell me how the Application will know the path of persistence.xml file .
    Thank you for reading

    it is predefined; JPA always looks for the persistence.xml file in the META-INF folder.

  • JNDI Lookup Problem (General Problem)

    hi all,
    i am newbie on bea products, but i have some experience on java technologies, how i fount on bea documentations and forums many people has the same problem like this, can anybody help us (me)?
    problem: how is it possible to write simple client for j2ee server application? i found some posts about jndi lookup, and fount about j2ee client, but is there any doc or example how to write this j2ee client ???
    i worked with many application servers and i have no problem with them (JBoss, Sun App Server, IBM Websophere, Oracle AS etc.)
    some people told about jndi tree on Web Logic Server Administration console , i found this tree i my session beans looks like :
    Binding Name:
    TimestenExampleTimestenExample_jarInsertSubscriberBean_InsertSubscriber
    Class:     
    test.InsertSubscriberBean_o7jk9u_InsertSubscriberImpl_1000_WLStub
    why is so strange name for class or binding name ????
    my session bean name is : InsertSubscriber
    and it's implementation : InsertSubscriberBean
    how i can lookup from client ?????
    can anybody show me code snippet ???
    my client looks like :
    import java.util.Hashtable;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.naming.NameClassPair;
    import javax.naming.NamingEnumeration;
    import javax.naming.NamingException;
    import org.hibernate.property.Dom4jAccessor.ElementGetter;
    public class Client {
         public static void main(String[] args) {
              Context ctx = null;
              Hashtable ht = new Hashtable();
              ht.put(Context.INITIAL_CONTEXT_FACTORY,
                        "weblogic.jndi.WLInitialContextFactory");
              ht.put(Context.PROVIDER_URL, "t3://192.9.200.222:7001");
              try {
                   ctx = new InitialContext(ht);
                   InsertSubscriber usagefasade = (InsertSubscriber) ctx
                             .lookup("java:comp/InsertSubscriber");
              } catch (NamingException e) {
                   e.printStackTrace();
              } finally {
                   try {
                        ctx.close();
                   } catch (Exception e) {
                        e.printStackTrace();
    }can anybody show me what is there incorrect ????
    oo yes and i have weblogic.jar file into my client classpath.

    Hi,
    Your EJB client looks fine.
    You should use the JNDI name of your ejb while doing the lookup. i.e :
    InsertSubscriber usagefasade = (InsertSubscriber) ctx.lookup("..use JNDI name of EJB...");
    You can use the JNDI name of the EJB that you see in the JNDI tree of weblogic. [don't use Binding Name or Class name]. you can also specify the JNDI name by "jndi-name" attribute in weblogic-ejb-jar.xml.
    for more info:
    http://e-docs.bea.com/wls/docs81/ejb/ejb11.html
    Thanks,
    Qumar Hussain

Maybe you are looking for

  • IPhone 4S no longer integrates through USB with my 2008 Cadi CTS after iOS 7

    Before my installation of iOS7, my iPhone 4S with iOS6 connected perfectly to my 2008 Cadillac CTS.  After the "upgrade", now my car cannot recognize my USB device (my phone) and I can't play my music, Pandora, etc., not to mention I can't even use m

  • Database Polling in Jdev

    Hi, I have created BPEL process that continuously polling on View present on database at certain interval. here i am using logical delete operation while polling for new or changed records so that will update certrain field on table. but my view has

  • HT201210 Why can't i get my iphone 3gs out of recovery mode when i try to restore it?

    Hello People, My iPhone 3GS has gone into "Recovery Mode" and ive tried to restore it. When it reaches the firmware it stops and my iPhone restarts and i get an error message saying "The iPhone 'iPhone' could not be restored. An unknown error has occ

  • Does early '11 MBPs support 16GB ram?

    I have an early 2011 13-inch MacBook Pro. I was just wondring if it will support 16GB RAM? The apple website says it can only support up to 8GB but I read elsewhere that it is able to support 16GB. Specs: CPU: 2.3 GHz Intel Core i5 RAM: 4GB 1333MHz D

  • Update List of Protocols When Configuring a Class-map During IOS FW Configuration

    Hi Everyone. I am working on a 2911 router with IOS version 15.2 and I want to configure Zone Base Firewalls. I have a list of protocols I want to allow through the firewall but when I do match protocol ? after creating a class-map of type inspect, I