Queue JNDI lookup in a clustered environment

Hey all,
          I know in a 6.1 cluster, the queues/JMS servers can only reside on one
          server.
          How can i lookup a queue from internal code from one of the off servers? The
          JNDI lookup doesn't grab it, throws an object not found exception. Do I need
          to
          be using the createQueue() method in the QueueSession class?
          It's fairly critical to know this to get our app up on the cluster, so
          any help would
          be very appreciated!
          Thanks,
          Greg
          

          A dumb question - how do I specify JNDINameReplicated=false? I am using WLS 6.1
          SP3 and in my config.xml I have
          <JMSTopic Name="topicA" JNDIName="topicA" JNDINameReplicated="false" />
          but WebLogic does not like it.
          Eric Ma
          Tom Barnes <[email protected]> wrote:
          >The parameter name "JNDINameReplicated" parameter is only available in
          >a patch
          >on top
          >of SP2 or SP3, and is "true" by default. I doubt that you are using
          >it.
          >
          >Greg Kaestle wrote:
          >
          >> Thanks much,
          >> Where is this parameter set in config.xml?
          >>
          >> Greg
          >>
          >> "Shean-Guang Chang" <[email protected]> wrote in message
          >> news:[email protected]...
          >> > If you want the queue to be found from other server in the same cluster
          >> then
          >> > you should not set "JNDINameReplicated" to false. This
          >> > will make the JNDI name of the queue known to the local server which
          >is
          >> > hosting the JMS queue. The purpose to use "JNDINameReplicated=false"
          >> > is to have multiple queues with the same JNDI name and then use some
          >sort
          >> of
          >> > load balancer to spread load among different JMS servers in the cluster.
          >> >
          >> >
          >> > "Greg Kaestle" <[email protected]> wrote in message
          >> > news:[email protected]...
          >> > > Hey all,
          >> > >
          >> > > I know in a 6.1 cluster, the queues/JMS servers can only reside
          >on
          >> one
          >> > > server.
          >> > > How can i lookup a queue from internal code from one of the off
          >servers?
          >> > The
          >> > > JNDI lookup doesn't grab it, throws an object not found exception.
          >Do I
          >> > need
          >> > > to
          >> > > be using the createQueue() method in the QueueSession class?
          >> > >
          >> > > It's fairly critical to know this to get our app up on the cluster,
          >> so
          >> > > any help would
          >> > > be very appreciated!
          >> > >
          >> > > Thanks,
          >> > > Greg
          >> > >
          >> > >
          >> >
          >> >
          >
          

Similar Messages

  • JNDI lookup in a clustered environment

              Hi,
              I have deployed my application on a clustered environment containing one admin
              server and two managed servers. The application is deployed on the managed servers.
              We have a DNS for these two managed servers.
              Currently, I am using t3:localhost:portnumber to get an initial context for JNDI
              lookup.
              But this will not provide perfect load balancing, since each server side component
              (EJB) will lookup for a needed component on the same server itself.
              Is there any way to get the Initial Context by using the DNS name?
              I tried t3:DNSName (Our DNS is created till the port number. e.g. http://DNS points
              to http://Managedserver1:portnumber and http://Managedserver2:portnumber
              It works, but is random. Sometimes, it gives me the following exception:
              Root exception is java.net.ConnectException: t3://DNS Name: Destination not
              reachable using: 't3'
              Could someone help me figure out a way to do this in a better way?
              Thanks,
              Aparna
              

              If you don't want or have money to use external load balancers you should be using
              the DNS entry as t3://server1:port,server2:port (you indicated you are using http.
              Also make sure your network elements between the client and the servers allow
              t3 protocol if there is packet filtering).
              S
              "Aparna" <[email protected]> wrote:
              >
              >Hi,
              >
              >I have deployed my application on a clustered environment containing
              >one admin
              >server and two managed servers. The application is deployed on the managed
              >servers.
              >We have a DNS for these two managed servers.
              >
              >Currently, I am using t3:localhost:portnumber to get an initial context
              >for JNDI
              >lookup.
              >But this will not provide perfect load balancing, since each server side
              >component
              >(EJB) will lookup for a needed component on the same server itself.
              >
              >Is there any way to get the Initial Context by using the DNS name?
              >
              >I tried t3:DNSName (Our DNS is created till the port number. e.g. http://DNS
              >points
              >to http://Managedserver1:portnumber and http://Managedserver2:portnumber
              >
              >It works, but is random. Sometimes, it gives me the following exception:
              > Root exception is java.net.ConnectException: t3://DNS Name: Destination
              > not
              >reachable using: 't3'
              >
              >Could someone help me figure out a way to do this in a better way?
              >
              >Thanks,
              >Aparna
              

  • JNDI lookup in Multitired clustered architecture

    Hi alll,
    We are in the design phase of a multi tired clustered application.
    This application has jsp/servelet cluster and business application cluster. We are confused abt the JNDI lookup logic need to use in servlet cluster.
    Can anyone help me to find out an optimal solution for jndi which gives the complete advantage of load balancing and esp. fail over
    of clustering
    Thanks in advance
    gokul

    Hi,
              First of all, I would like to clear the point that load balancing can be done within a cluster not among the cluster.
              So if you have more than one cluster the load balancing
              would be at each cluster level.
              For JNDI lookup you have to provide cluster address i.e combination of Managed Server Address e.g:
              t3://localhost:7001,localhost:8001,localhost:9001...etc
              Thanks,
              Qumar

  • JMS Wrappers can't cache JNDI lookups when using secured queues

    Hi All!
    We are working on a jms client, inside a webapp(servlets), using Weblogic 9.2 and Weblogic 10.3.
    As we want to use secured queues and keep being efficient we tryed to use Weblogic JMS Wrappers, that should work according to the docs:
    Enhanced Support for Using WebLogic JMS with EJBs and Servlets
    http://download.oracle.com/docs/cd/E12840_01/wls/docs103/jms/j2ee.html
    But we are facing a problem:
    When we define a JMS Wrapper and try to cache JNDI lookups for the QueueConnectionFactory and Queue, as the docs recommend for efficiency, the connection to the queue is ignoring the user/pwd.
    The JMS Wrapper is using <res-auth>Application</res-auth>.
    We are creating the connection using createQueueConnection(user, pwd) from QueueConnectionFactory and after several tests it seems that the user and password are ingored unless a jndi lookup is made in the same thread, as if when there are not any thread credentials present user and password are ignored for the connection...
    so the question is:
    That behaviour goes against Weblogic JMS Wrapper documentation, doesn't it?
    Is there then any other way to access efficiently secured queues using a servlet as a client? (iit's not an option for us to use mdbs, or ejbs).
    If it helps, this seems related to this still opened spring-weblogic issue: SPR-2941 --> http://jira.springframework.org/browse/SPR-2941 and SPR-4720 --> http://jira.springframework.org/browse/SPR-4720
    Thanxs
    And here goes our DDs and code to reproduce:
    First in pretty format:
    web.xml --> http://pastebin.com/f5f85e8d4
    weblogic.xml --> http://pastebin.com/f2fbe10cc
    Client code --> http://pastebin.com/f586d32d9
    And now emmebded in the msg:
    web.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <weblogic-web-app
      xmlns="http://www.bea.com/ns/weblogic/90"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.bea.com/ns/weblogic/90
      http://www.bea.com/ns/weblogic/90/weblogic-web-app.xsd">
        <description>WebLogic Descriptor</description>
        <resource-description>
            <res-ref-name>jms/QCF</res-ref-name>
            <jndi-name>weblogic.jms.ConnectionFactory</jndi-name>
        </resource-description>
    </weblogic-web-app>weblogic.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
          <display-name> QCFWrapperCredentialsTest </display-name>
          <description> QCFWrapperCredentialsTest  </description>
          <servlet id="Servlet_1">
             <servlet-name>QCFWrapperCredentialsTest</servlet-name>
             <servlet-class>QCFWrapperCredentialsTest</servlet-class>
             <load-on-startup>1</load-on-startup>
          </servlet>
          <servlet-mapping id="ServletMapping_1">
             <servlet-name>QCFWrapperCredentialsTest</servlet-name>
             <url-pattern>/Test</url-pattern>
          </servlet-mapping>
         <resource-ref>
            <res-ref-name>jms/QCF</res-ref-name>
            <res-type>javax.jms.QueueConnectionFactory</res-type>
            <res-auth>Application</res-auth>
            <res-sharing-scope>Shareable</res-sharing-scope>
        </resource-ref>
    </web-app>And our test client:
    import java.io.*;
    import java.util.Properties;
    import javax.jms.*;
    import javax.naming.*;
    import javax.servlet.http.*;
    public class QCFWrapperCredentialsTest extends HttpServlet {
        QueueConnectionFactory factory = null;
        Queue queue = null;
        String jndiName = "java:comp/env/jms/QCF";
        String queueName= "jms/ColaEntradaConsultas";
        String user = "usuarioColas";
        String pwd = "12345678";
        String userjndi = "usuarioColas";
        String pwdjndi = "12345678";
        String serverT3URL="t3://127.0.0.1:7007";
        public void init() {
            setupJNDIResources();
        private void setupJNDIResources(){
            try {
                Properties props = new Properties();
                props.put("java.naming.factory.initial",
                        "weblogic.jndi.WLInitialContextFactory");
                props.put("java.naming.provider.url",serverT3URL );
                props.put("java.naming.security.principal", userjndi);// usr
                props.put("java.naming.security.credentials", pwdjndi);// pwd
                InitialContext ic = new InitialContext(props);
                factory = (QueueConnectionFactory) ic.lookup(jndiName);
                queue = (Queue) ic.lookup(queueName);
            } catch (NamingException e) {
                e.printStackTrace();
        public void service(HttpServletRequest req, HttpServletResponse res) {
            res.setContentType("text/html");
            Writer wr = null;
            try {
                wr = res.getWriter();
                //Comment this out, do a lookup for each request and it will work
                //setupJNDIResources();
                String user = this.user;
                String pwd = this.pwd;
                //read users and passwords from the request in case they are present
                if (req.getParameter("user") != null) {
                    user = req.getParameter("user");
                if (req.getParameter("pwd") != null) {
                    pwd = req.getParameter("pwd");
                wr.write("JNDI  User: *" + userjndi + "* y pwd: *" + pwdjndi + "*<p>");
                wr.write("Queue User: *" + user + "* y pwd: *" + pwd + "*<p>");
                //Obtain a connection using user/pwd
                QueueConnection conn = factory.createQueueConnection(user, pwd);
                QueueSession ses = conn.createQueueSession(true,
                        Session.SESSION_TRANSACTED);
                QueueSender sender = ses.createSender(queue);
                TextMessage msg = ses.createTextMessage();
                msg.setText("Hi there!");
                conn.start();
                sender.send(msg);
                ses.commit();
                sender.close();
                ses.close();
                conn.close();
            } catch (Exception e) {
                e.printStackTrace();
                try {
                    wr.write(e.toString());
                } catch (Exception e2) {
                    e2.printStackTrace();
            finally{
                try {
                    wr.close();
                } catch (IOException e) {
                    e.printStackTrace();
    }Edited by: user2525402 on Feb 9, 2010 7:14 PM

    Thanks Tom,
    Quite a useful response .-)
    Leaving aside the fact that weblogic behaviour with jms wrappers and secured queues seems to not be working as the docs says...
    Talking about workarounds:
    Both workarounds you suggest works, but as you already noted, creating a new JNDI context just to inject credentials into the threads is overkill when high performance is needed.
    I also found more information about the same issue here: http://sleeplessinslc.blogspot.com/2009/04/weblogic-jms-standalone-multi-threaded.html
    And he suggest the same workaround, injecting credentials
    So I tried the second approach, successfully, injecting credentials into the thread using the security API.
    This way, using JMS wrappers and injecting credentials into the thread we get the best performance available, caching resource using wrappers and using credentials in a somewhat efficient way.
    Now the test snippet looks like this:
    import java.io.*;
    import java.security.PrivilegedAction;
    import java.util.Properties;
    import javax.jms.*;
    import javax.naming.*;
    import javax.security.auth.Subject;
    import javax.security.auth.login.LoginException;
    import javax.servlet.http.*;
    import weblogic.jndi.Environment;
    import weblogic.security.auth.Authenticate;
    public class JMSWrapperCredentialsTest extends HttpServlet {
        QueueConnectionFactory factory = null;
        Queue queue = null;
        String jndiName = "java:comp/env/jms/QCF";
        String queueName= "jms/ColaEntradaConsultas";
        String user = "usuarioColas";
        String pwd = "12345678";
        String userjndi = "usuarioColas";
        String pwdjndi = "12345678";
        String serverT3URL="t3://127.0.0.1:7007";
        public void init() {
            setupJNDIResources();
        private void setupJNDIResources(){
            try {
                Properties props = new Properties();
                props.put("java.naming.factory.initial",
                        "weblogic.jndi.WLInitialContextFactory");
                props.put("java.naming.provider.url",serverT3URL );
                props.put("java.naming.security.principal", userjndi);// usr
                props.put("java.naming.security.credentials", pwdjndi);// pwd
                InitialContext ic = new InitialContext(props);
                factory = (QueueConnectionFactory) ic.lookup(jndiName);
                queue = (Queue) ic.lookup(queueName);
            } catch (NamingException e) {
                e.printStackTrace();
        public void service(HttpServletRequest req, HttpServletResponse res) {
            final HttpServletRequest fReq=req;
            final HttpServletResponse fRes=res;
            PrivilegedAction action = new java.security.PrivilegedAction() {
                public java.lang.Object run() {
                    performRequest(fReq,fRes);
                    return null;
            try {
                Subject subject=createSingleSubject(serverT3URL,user,pwd);
                weblogic.security.Security.runAs(subject, action);
            } catch (Exception e) {
                e.printStackTrace();
        public void performRequest(HttpServletRequest req, HttpServletResponse res) {
            res.setContentType("text/html");
            Writer wr = null;
            try {
                wr = res.getWriter();
                //Comment this out, do a lookup for each request and it will work
                //setupJNDIResources();
                String user = this.user;
                String pwd = this.pwd;
                //read users and passwords from the request in case they are present
                if (req.getParameter("user") != null) {
                    user = req.getParameter("user");
                if (req.getParameter("pwd") != null) {
                    pwd = req.getParameter("pwd");
                wr.write("JNDI  User: *" + userjndi + "* y pwd: *" + pwdjndi + "*<p>");
                wr.write("Queue User: *" + user + "* y pwd: *" + pwd + "*<p>");
                //Obtain a connection using user/pwd
                QueueConnection conn = factory.createQueueConnection(user, pwd);
                QueueSession ses = conn.createQueueSession(true,
                        Session.SESSION_TRANSACTED);
                QueueSender sender = ses.createSender(queue);
                TextMessage msg = ses.createTextMessage();
                msg.setText("Hi there!");
                conn.start();
                sender.send(msg);
                ses.commit();
                sender.close();
                ses.close();
                conn.close();
            } catch (Exception e) {
                e.printStackTrace();
                try {
                    wr.write(e.toString());
                } catch (Exception e2) {
                    e2.printStackTrace();
            finally{
                try {
                    wr.close();
                } catch (IOException e) {
                    e.printStackTrace();
        private Subject createSingleSubject(String providerUrl, String userName, String password) {
            Subject subject = new Subject();
            // Weblogic env class
            Environment env = new Environment();
            if(providerUrl!=null)
                env.setProviderUrl(providerUrl);
            env.setSecurityPrincipal(userName);
            env.setSecurityCredentials(password);
            try {
              // Weblogic Authenticate class will populate and Seal the subject
              Authenticate.authenticate(env, subject);
              return subject;
            catch (LoginException e) {
              throw new RuntimeException("Unable to Authenticate User", e);
            catch (Exception e) {
              throw new RuntimeException("Error authenticating user", e);
    }Thanks a lot for the help

  • Distributed Queue/JMX - JNDI lookup on startup fails

    Hi,
    I have a problem starting up Camel routes on a cluster via JMX. Although I have a NotificationListener registered that tries to startup the routes when the server sends a STATE=RUNNING lifecycle event, I cannot start the all Camel routes due to a "JMSException, Destination not found".
    But, when I remote debug the application and put a breakpoint in, wait let's say 5 secs, then the JNDI lookup works and everything is fine.
    I have unsuccessfully tried to play with the deployment order or my ear (by default the JMSServer is started with a priority of 1000), no luck. I have also put a poll method in, that waits until the JMSServer and the Destinations (=queues) are available, again no luck.
    Anyone able to assist with that issue?
    Best Regards,
    Sebastian

    I found the reason for the late binding. We are using "migratable target" in our cluster. When I remove the migratable target I have no issue whatsoever. Is there a way to either tweak the config or configure the Migratable targets in a way to by-pass this issue?
    Regards,
    Seb

  • JNDI lookup on clustered server

              I am very new to clustering Weblogic servers, and I'm lost. Here is what my config.xml
              file looks like:
              <?xml version="1.0" encoding="UTF-8"?>
              <Domain ConfigurationVersion="8.1.0.0" Name="mydomain">
              <Cluster MulticastAddress="237.0.0.1" MulticastPort="8035" Name="DomainCluster"/>
              <Server ListenAddress="" ListenPort="8031" Machine="Machine1"
              Name="DomainAdmin" NativeIOEnabled="true" ServerVersion="8.1.0.0" StdoutEnabled="false">
              <SSL Enabled="true" HostnameVerificationIgnored="false"
              IdentityAndTrustLocations="KeyStores" ListenPort="8032" Name="DomainAdmin"/>
              <Log FileCount="1" FileTimeSpan="72" Name="DomainAdmin"
              NumberOfFilesLimited="true" RotationType="byTime"/>
              </Server>
              <Server IIOPEnabled="false" ListenPort="80" Machine="Machine1"
              Name="DomainProxy" NativeIOEnabled="true" StdoutEnabled="false">
              <SSL Enabled="true" IdentityAndTrustLocations="KeyStores"
              ListenPort="443" Name="DomainProxy"/>
              <Log FileCount="1" FileTimeSpan="72" Name="DomainProxy"
              NumberOfFilesLimited="true" RotationType="byTime"/>
              <ExecuteQueue Name="weblogic.kernel.Default" ThreadCount="100"/>
              </Server>
              <Server Cluster="DomainCluster" DomainLogFilter="DomainLogFilter"
              IIOPEnabled="true" ListenPort="8035" Machine="Machine1"
              Name="DomainAppServer1a" NativeIOEnabled="true"
              ServerVersion="8.1.1.0" StdoutEnabled="false">
              <SSL Enabled="true" IdentityAndTrustLocations="KeyStores"
              ListenPort="8036" Name="DomainAppServer1a"/>
              <Log FileCount="1" FileTimeSpan="72" Name="DomainAppServer1a"
              NumberOfFilesLimited="true" RotationType="byTime"/>
              <ExecuteQueue Name="weblogic.kernel.Default" ThreadCount="50"/>
              </Server>
              <Server Cluster="DomainCluster" DomainLogFilter="DomainLogFilter"
              IIOPEnabled="false" ListenPort="8037" Machine="Machine1"
              Name="DomainAppServer1b" NativeIOEnabled="true" StdoutEnabled="false">
              <SSL Enabled="true" IdentityAndTrustLocations="KeyStores"
              ListenPort="8038" Name="DomainAppServer1b"/>
              <Log FileCount="1" FileTimeSpan="72" Name="DomainAppServer1b"
              NumberOfFilesLimited="true" RotationType="byTime"/>
              <ExecuteQueue Name="weblogic.kernel.Default" ThreadCount="50"/>
              </Server>
              <MigratableTarget Cluster="DomainCluster"
              Name="DomainAppServer1a (migratable)"
              Notes="This is a system generated default migratable target for a server.
              Do not delete manually." UserPreferredServer="DomainAppServer1a"/>
              <MigratableTarget Cluster="DomainCluster"
              Name="DomainAppServer1b (migratable)"
              Notes="This is a system generated default migratable target for a server.
              Do not delete manually." UserPreferredServer="DomainAppServer1b"/>
              <UnixMachine Name="Machine1" PostBindGID="domain"
              PostBindGIDEnabled="true" PostBindUID="DOMAIN" PostBindUIDEnabled="true">
              <NodeManager ListenAddress="" ListenPort="8033" Name="Machine1"/>
              </UnixMachine>
              <JMSServer Name="DomainJMSServer1a" Store="DomainJMSFileStore1a" Targets="DomainAppServer1a">
              <JMSTopic CreationTime="..."
              JNDIName="topic.someTopic" Name="someTopic" StoreEnabled="false"/>
              </JMSServer>
              <JMSServer Name="DomainJMSServer1b" Store="DomainJMSFileStore1b" Targets="DomainAppServer1b"/>
              <DomainLogFilter Name="DomainLogFilter" SeverityLevel="1"/>
              <Security Name="Domain" PasswordPolicy="wl_default_password_policy"
              Realm="wl_default_realm" RealmSetup="true"/>
              <EmbeddedLDAP
              Credential="..." Name="Domain"/>
              <SecurityConfiguration
              Credential="..."
              Name="Domain" RealmBootStrapVersion="1"/>
              <Realm FileRealm="wl_default_file_realm" Name="wl_default_realm"/>
              <FileRealm Name="wl_default_file_realm"/>
              <PasswordPolicy Name="wl_default_password_policy"/>
              <JDBCConnectionPool ConnectionCreationRetryFrequencySeconds="60"
              DriverName="oracle.jdbc.driver.OracleDriver" MaxCapacity="5"
              Name="domainPOOL" Password="..."
              Properties="..." ShrinkFrequencySeconds="18000"
              Targets="DomainCluster" TestConnectionsOnCreate="true"
              TestConnectionsOnRelease="true" TestConnectionsOnReserve="true"
              TestFrequencySeconds="300" TestTableName="DUAL" URL="..."/>
              <JDBCTxDataSource JNDIName="domainSource" Name="domainSource"
              PoolName="domainPOOL" Targets="DomainCluster"/>
              <Application Name="MyDomain" Path="domain.ear"
              StagingMode="nostage" TwoPhase="true">
              <EJBComponent Name="domainejb" Targets="DomainCluster" URI="domainEjb.jar"/>
              </Application>
              </Domain>
              As you can, I have two servers configured in my DomainCluster. My EJB, domainejb,
              is tied to
              this cluster. I can't seem to do a JNDI lookup of this EJB, or the JMS Topic
              that I've created.
              When I attempt to do the lookup (from a client on the local machine) using the
              URL
              t3://localhost:8031, I get a NameNotFound Exception. This makes sense, because
              the
              Admin server isn't a part of the cluster. However, when I do the lookup using
              t3://localhost:8035, I get an exception that states that it could not connect
              to a host. I have
              insured that the server at this port is running, and the EJB is located in it's
              JNDI tree.
              I am stumped and could really use someone's help. Please advice.
              Thanks, Joel
              

              Prasad Peddada <[email protected]> wrote:
              >Joel wrote:
              >> I am very new to clustering Weblogic servers, and I'm lost. Here is
              >what my config.xml
              >> file looks like:
              >>
              >> <?xml version="1.0" encoding="UTF-8"?>
              >> <Domain ConfigurationVersion="8.1.0.0" Name="mydomain">
              >> <Cluster MulticastAddress="237.0.0.1" MulticastPort="8035" Name="DomainCluster"/>
              >> <Server ListenAddress="" ListenPort="8031" Machine="Machine1"
              >> Name="DomainAdmin" NativeIOEnabled="true" ServerVersion="8.1.0.0"
              >StdoutEnabled="false">
              >> <SSL Enabled="true" HostnameVerificationIgnored="false"
              >> IdentityAndTrustLocations="KeyStores" ListenPort="8032"
              >Name="DomainAdmin"/>
              >> <Log FileCount="1" FileTimeSpan="72" Name="DomainAdmin"
              >> NumberOfFilesLimited="true" RotationType="byTime"/>
              >> </Server>
              >> <Server IIOPEnabled="false" ListenPort="80" Machine="Machine1"
              >> Name="DomainProxy" NativeIOEnabled="true" StdoutEnabled="false">
              >> <SSL Enabled="true" IdentityAndTrustLocations="KeyStores"
              >> ListenPort="443" Name="DomainProxy"/>
              >> <Log FileCount="1" FileTimeSpan="72" Name="DomainProxy"
              >> NumberOfFilesLimited="true" RotationType="byTime"/>
              >> <ExecuteQueue Name="weblogic.kernel.Default" ThreadCount="100"/>
              >> </Server>
              >> <Server Cluster="DomainCluster" DomainLogFilter="DomainLogFilter"
              >> IIOPEnabled="true" ListenPort="8035" Machine="Machine1"
              >> Name="DomainAppServer1a" NativeIOEnabled="true"
              >> ServerVersion="8.1.1.0" StdoutEnabled="false">
              >> <SSL Enabled="true" IdentityAndTrustLocations="KeyStores"
              >> ListenPort="8036" Name="DomainAppServer1a"/>
              >> <Log FileCount="1" FileTimeSpan="72" Name="DomainAppServer1a"
              >> NumberOfFilesLimited="true" RotationType="byTime"/>
              >> <ExecuteQueue Name="weblogic.kernel.Default" ThreadCount="50"/>
              >> </Server>
              >> <Server Cluster="DomainCluster" DomainLogFilter="DomainLogFilter"
              >> IIOPEnabled="false" ListenPort="8037" Machine="Machine1"
              >> Name="DomainAppServer1b" NativeIOEnabled="true" StdoutEnabled="false">
              >> <SSL Enabled="true" IdentityAndTrustLocations="KeyStores"
              >> ListenPort="8038" Name="DomainAppServer1b"/>
              >> <Log FileCount="1" FileTimeSpan="72" Name="DomainAppServer1b"
              >> NumberOfFilesLimited="true" RotationType="byTime"/>
              >> <ExecuteQueue Name="weblogic.kernel.Default" ThreadCount="50"/>
              >> </Server>
              >> <MigratableTarget Cluster="DomainCluster"
              >> Name="DomainAppServer1a (migratable)"
              >> Notes="This is a system generated default migratable target
              >for a server.
              >> Do not delete manually." UserPreferredServer="DomainAppServer1a"/>
              >> <MigratableTarget Cluster="DomainCluster"
              >> Name="DomainAppServer1b (migratable)"
              >> Notes="This is a system generated default migratable target
              >for a server.
              >> Do not delete manually." UserPreferredServer="DomainAppServer1b"/>
              >> <UnixMachine Name="Machine1" PostBindGID="domain"
              >> PostBindGIDEnabled="true" PostBindUID="DOMAIN" PostBindUIDEnabled="true">
              >> <NodeManager ListenAddress="" ListenPort="8033" Name="Machine1"/>
              >> </UnixMachine>
              >> <JMSServer Name="DomainJMSServer1a" Store="DomainJMSFileStore1a"
              >Targets="DomainAppServer1a">
              >> <JMSTopic CreationTime="..."
              >> JNDIName="topic.someTopic" Name="someTopic" StoreEnabled="false"/>
              >> </JMSServer>
              >> <JMSServer Name="DomainJMSServer1b" Store="DomainJMSFileStore1b"
              >Targets="DomainAppServer1b"/>
              >> <DomainLogFilter Name="DomainLogFilter" SeverityLevel="1"/>
              >> <Security Name="Domain" PasswordPolicy="wl_default_password_policy"
              >> Realm="wl_default_realm" RealmSetup="true"/>
              >> <EmbeddedLDAP
              >> Credential="..." Name="Domain"/>
              >> <SecurityConfiguration
              >> Credential="..."
              >> Name="Domain" RealmBootStrapVersion="1"/>
              >> <Realm FileRealm="wl_default_file_realm" Name="wl_default_realm"/>
              >> <FileRealm Name="wl_default_file_realm"/>
              >> <PasswordPolicy Name="wl_default_password_policy"/>
              >> <JDBCConnectionPool ConnectionCreationRetryFrequencySeconds="60"
              >> DriverName="oracle.jdbc.driver.OracleDriver" MaxCapacity="5"
              >> Name="domainPOOL" Password="..."
              >> Properties="..." ShrinkFrequencySeconds="18000"
              >> Targets="DomainCluster" TestConnectionsOnCreate="true"
              >> TestConnectionsOnRelease="true" TestConnectionsOnReserve="true"
              >> TestFrequencySeconds="300" TestTableName="DUAL" URL="..."/>
              >> <JDBCTxDataSource JNDIName="domainSource" Name="domainSource"
              >> PoolName="domainPOOL" Targets="DomainCluster"/>
              >> <Application Name="MyDomain" Path="domain.ear"
              >> StagingMode="nostage" TwoPhase="true">
              >> <EJBComponent Name="domainejb" Targets="DomainCluster" URI="domainEjb.jar"/>
              >> </Application>
              >> </Domain>
              >>
              >> As you can, I have two servers configured in my DomainCluster. My
              >EJB, domainejb,
              >> is tied to
              >> this cluster. I can't seem to do a JNDI lookup of this EJB, or the
              >JMS Topic
              >> that I've created.
              >> When I attempt to do the lookup (from a client on the local machine)
              >using the
              >> URL
              >> t3://localhost:8031, I get a NameNotFound Exception. This makes sense,
              >because
              >> the
              >> Admin server isn't a part of the cluster. However, when I do the lookup
              >using
              >>
              >> t3://localhost:8035, I get an exception that states that it could not
              >connect
              >> to a host. I have
              >> insured that the server at this port is running, and the EJB is located
              >in it's
              >> JNDI tree.
              >>
              >> I am stumped and could really use someone's help. Please advice.
              >>
              >> Thanks, Joel
              >
              >Trying setting a listen address to specific ip instead of localhost
              >address. Have you tried view the JNDI tree of Managed Servers from console.
              >
              >Cheers,
              >
              >-- Prasad
              >
              Though some problems still remained, having the client use the weblogic.jar rather
              than the thin
              client jars (wljmsclient.jar and wlclient.jar) seemed to cure many of the issues.
              

  • WLS/OSB DB Adapter - JNDI lookup failed

    Hello all.
    I've got a DB adapter service set up in a clustered environment, and it all works (and I've built proxy services, transformations etc around it), but I've just noticed that the log shows a warning regarding the JNDI lookup of the ConnectionFactory, as below.
    It's working, and the error is only a warning, but could this cause problems going forward, particularly with regards performance?
    Given that the ConnectionFactory name is 'com.whatever.myServiceDB', and the Endpoint URI of the service is 'jca://com.whatever.myServiceDB', what could be wrong? Has anyone seen/fixed this before? It's almost like the managed servers don't know about the JNDI name...but the DbAdapter deployent has 'All servers in the cluster' selected in its 'Targets' tab, so I'm not sure.
    Any pointers would be appreciated, I'm probably missing something obvious.
    Cheers.
    ####<Apr 15, 2010 10:53:10 AM BST> <Warning> <JCA_FRAMEWORK_AND_ADAPTER> <servername> <managed3_domainname> <[ACTIVE] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <> <1271325190453> <BEA-000000> <servicebus:/WSDL/MyProject/MyService [ MyService_ptt::merge(MessagesCollection) ] - JNDI lookup of 'com.whatever.myServiceDB' failed due to: String index out of range: -1>

    Thanks again.
    In case anyone runs into a similar problem and is wondering: a bit of mucking about reveals that the WLS ConnectionFactory config is fine with dots or slashes, and it seems to treat both the same when creating the JNDI tree.
    However, the WSDL (that you probably created in JDeveloper) has to have slashes for doing its lookup. So, for example, always use slashes rather than dots when setting your DB Adapter JNDI name in JDeveloper. I guess this is a bit different from usual class/package naming standards, so may catch someone else out too.
    Cheers.

  • Jms is not working properly in clustered environment

    Hi all,
    i am using the application server oc4j 10.1.3.1.0 enterprise edition . my application is standalone application(thick client)
    we are using the jndi.properties as follows ...
    java.naming.factory.initial=com.evermind.server.rmi.RMIInitialContextFactory
    java.naming.provider.url=opmn:ormi://172.16.1.38:6005:group/Security,opmn:ormi://172.16.1.38:6006:deceval_group/Security
    java.naming.security.principal=oc4juser
    java.naming.security.credentials=oc4juser
    oracle.j2ee.rmi.loadBalance=lookup
    we have two application servers in cluster topology as u can see above we have used one instance from one application server and one from another.
    i have seen that for every instance there one jms server. at runtime it is taking one application servers services
    say opmn port 6005 but when the application is connecting to the another application server say opmn 6006
    here jms is not working properly when i send message
    As we have clustered environment message must be propagated all the applications who use above jndi.properties.
    if i keep use only one application server opmn say
    java.naming.provider.url=opmn:ormi://172.16.1.38:6005:group/Security
    then its is working excellently
    please can u provide any solution ASAP
    thanks in advance
    Manu

    Dear Aravindth
      (.*?) means -> Select all contents from where you start and end,
    For Ex. <month>(.*?)</month> then Select for start <month> and end last </month> tag.
    (?) Match zero or one occurrences. Equivalent to {0,1}.
    (*) Match zero or more occurrences. Equivalent to {0,}.
    (+) Match one or more occurrences. Equivalent to {1,}.
    (.) (Dot). Match any character except newline or another Unicode line terminator.
    (.*?) means -> Zero or more times Match any character except newline or another Unicode line terminator + Match zero or more occurrences. Equivalent to {0,}.+Match zero or one occurrences. Equivalent to {0,1}.
    Could you please refere the below cite :
    http://www.javascriptkit.com/jsref/regexp.shtml
    Thanks & Regards
    T.R.Harihara SudhaN

  • Minimizing JNDI lookups

    Hi!
    We've implemented a simple EJBHome caching mechanism to reduce JNDI lookups. As many of you may know, a JNDI lookup is expensive in resource terms.
    Using the Oracle 9iAS JavaCache service is discarded because we need a vendor independant solution.
    Our implementation works fine in an OC4J standalone environment where each EJB is looked up and created in the same instance.
    But we don't know how it would perform in a clustered environment (Oracle 9iAS Enterprise) and we don't have an installation avalaible to try it and make the performance improvement announcement for our customers. (they are asking us to do it ASAP).
    So the key here is when the EJB load balance happens?, in the JNDI lookup or in the EJB create() method ?
    Thanks
    Franco Catrin L.
    TUXPAN

    I'm using a Singleton class to cache HomeInterfaces. The first time a
    HomeInterface is requested, the JNDI lookup is done, after that, all
    requests to that HomeInterface are handled by the cache. Works great, no
    problems. AFAIK there are no problems with storing the HomeInterface
    reference and reusing it.
    Hope that helps,
    Nils
    Tiffany wrote:
    >
    JNDI lookups are expensive timewise. Our question is ... would it be
    pratical to lookup all our EJB Home interfaces once at startup and store
    these references in a global class accessible to all clients? These home
    interfaces then become readily available factories for acquiring instances
    of remote interfaces. Is there anything wrong with this picture? Is this a
    problem because these home stubs are not reentrant and may be accessed
    concurrently by more than one client? Is there a problem with have one home
    reference create multiple remote references of an ejb?
    Any light that can be shed on this question wouls be appreciated.
    Thanks.
    tiffany
    San Diego--
    ============================
    [email protected]

  • JNDI lookup/properties

    Hi
    Is there anobody that has got this figured out totally. From all the question on Sun and Oracles forums it seemst that the Lookup with JNDI is a massive problem for everybody.
    Is there some utility written by someone that can actually be run agains OC4J to tell you what is available in the JNDI lookup tree? This will make it a lot easier to find answers to all these questions.
    I 'm now trying to get the MDB environment going but can't get the JSP from the messagelogger example to look up the queue. NameNotFound exception. a Utility that will tel you what is available and what not will make a stunning tool. Now I havent got any idea if the problem is in hte OC4J setup or the JSP.
    Tks
    Andre

    Hi
    Is there anobody that has got this figured out totally. From all the question on Sun and Oracles forums it seemst that the Lookup with JNDI is a massive problem for everybody.
    Is there some utility written by someone that can actually be run agains OC4J to tell you what is available in the JNDI lookup tree? This will make it a lot easier to find answers to all these questions.
    I 'm now trying to get the MDB environment going but can't get the JSP from the messagelogger example to look up the queue. NameNotFound exception. a Utility that will tel you what is available and what not will make a stunning tool. Now I havent got any idea if the problem is in hte OC4J setup or the JSP.
    Tks
    Andre

  • Data Caching in a Clustered Environment

              I want to cache read-only reference/code table data that will run in a clustered
              WLS6 environment. It's a JSP application and I am storing a complete HTML Select
              Control per reference/code table data in the cache. The question is where to
              cache it? I was going to put it in the ServletContext (JSP "application" implicit
              object), but the ServletContext is not replicated. I considered using JNDI, but
              there are problems with duplicate name errors when another server who doesn't
              originally bind the object tries to lookup, change and rebind the object. I guess
              JMS Multicasting is an option, but I don't want to implement JMS just for an application
              data cache.
              Any suggestions for a simple reference/code table read-only caching strategy that
              will work in a clustered WLS6 environment?
              

    If the data is strictly read-only, and you do not have to worry about cache
              integrity, then look at WebLogic JSP cachetag:
              http://www.weblogic.com/docs51/classdocs/API_jsp.html#cachetag
              You can use it to cache both the output and the calculations results
              (variables calculated inside the cache tag).
              The scenario will be exactly the same for non-clustered and clustered
              cases - using multicast to broadcast small invalidation messages (so the
              data can be refreshed from the database) is ok, but replicating application
              data is not (and you definitely do not want to use JNDI for this purpose).
              BTW, the initial CacheTag implementation in 5.1 (supposedly) had a 'cluster'
              scope and I assume it was multicasting fresh data after cache miss - there
              is no such scope in 6.0 implementation.
              If you still want replication you can look at javagroups:
              http://sourceforge.net/projects/javagroups/
              (distributedhashtable example).
              Olsen <[email protected]> wrote:
              > Cameron,
              > Thanks for the reply. However, as I stated below, I am not interested in
              > JMS, nor an EJB solution to the problem. It really is not that complicated of
              > a concept and I know a solution or two (ServletContext, JNDI), but none that works
              > in a WLS6 clustered environment.
              > Any other ideas???
              > Thanks...
              > "Cameron Purdy" <[email protected]> wrote:
              >>Dimitri had a clever (as ever) solution using JMS to maintain cache
              >>integrity:
              >>
              >>explanation at
              >>http://dima.dhs.org/misc/readOnlyUpdates.html
              >>
              >>d/l from
              >>http://dima.dhs.org/misc/readOnlyUpdates.jar
              >>
              >>--
              >>Cameron Purdy
              >>Tangosol, Inc.
              >>http://www.tangosol.com
              >>+1.617.623.5782
              >>WebLogic Consulting Available
              >>
              >>
              >>"Olsen" <[email protected]> wrote in message
              >>news:[email protected]...
              >>>
              >>> I want to cache read-only reference/code table data that will run in
              >>a
              >>clustered
              >>> WLS6 environment. It's a JSP application and I am storing a complete
              >>HTML
              >>Select
              >>> Control per reference/code table data in the cache. The question is
              >>where
              >>to
              >>> cache it? I was going to put it in the ServletContext (JSP "application"
              >>implicit
              >>> object), but the ServletContext is not replicated. I considered using
              >>JNDI, but
              >>> there are problems with duplicate name errors when another server who
              >>doesn't
              >>> originally bind the object tries to lookup, change and rebind the object.
              >>I guess
              >>> JMS Multicasting is an option, but I don't want to implement JMS just
              >>for
              >>an application
              >>> data cache.
              >>> Any suggestions for a simple reference/code table read-only caching
              >>strategy that
              >>> will work in a clustered WLS6 environment?
              >>
              >>
              Dimitri
              

  • JNDI Lookup in JSP fails for EJB 3.0

    I am new to Java technology. I read the EJB FAQ, NetBeans docs and may forum discussions and I am still confused with the error I am having.
    Background:
    I have developed a persistance bean and related sessions beans (similar to the customer-cmp-ear application in the Java App Server samples). Now I am trying to access this bean using a JSP. After deploying the war file in the App Server and try to access the page, I get the following error.
    javax.naming.NameNotFoundException: No object bound to name java:comp/env/ConsumerSessionLocal
    After reading many articles, I understood that I dont have to prepare any descriptors, or JAR files for EJB 3.0.
    Environment Details:
    Java App Server Ver 9.0
    NetBeans 5.5
    I normally build the war files using NetBeans.
    I use App Server Admin console to deploy the web applications using the above war file.
    EJB details:
    Persistance EJB : person.java
    Session Objects
    Consumer.java (this implements ConsumerSessionLocal, ConsumerSessionRemote). This Stateless bean accesses the methods in person.java.
    ConsumerSessionLocal.java - local interface
    ConsumerSessionRemote.java - remote interface
    SearchConsumer.jsp
    This JSP page is calling the ConsumerSessionLocal using the JNDI lookup through InitialContext.
    Here is the Code snippet:
    try {
    InitialContext ic = new InitialContext();
    Object o = ic.lookup("java:comp/env/ConsumerSessionLocal");
    ConsumerSessionLocal consSession = (ConsumerSessionLocal) o;
    I am able to see the jsp page in the browser, however, after a submit action, I get the Java Naming Exception error.
    javax.naming.NameNotFoundException: No object bound for java:comp/env/ConsumerSessionLocal
    I would appreciate your help/any of your thoughts.
    Thanks in advance.
    -Ram

    I did not really solve it. Instead I used some of the tutorials that used JNDI lookup and modified those as my way forward. I did not really find out exactly what I was doing wrong.
    /Anders

  • Error when calling BPEL from ESB in clustered environment

    Hi
    We have recently installed SOA Suite in a clustered environment and have a serious issue.
    I am not able to call BPEL processes from my ESB services via WSIF (by using the 'browse target operation' in JDeveloper). The exception i get at runtime is this.
    "javax.naming.NameNotFoundException: ejb/collaxa/system/DeliveryBean not found"
    When I instead call the BPEL process via SOAP (by using a SOAP invocation service i JDeveloper) it works fine.
    Everything works fine in development environment which not are clustered.
    Has anyone any excperience from using ESB in a clustered environment?
    Regards
    Kalle Viklund

    Hi
    ESB and BPEL resides in the same oc4j-instance. Though, esb-rt and orabpel are different applications in that oc4j-instance. And the lookup 'ejb/collaxa/system/DeliveryBean' only exists in the orabpel application.
    In the ESB Console I already have the same setting for the 'BPELSystem' as for the 'Defaultsystem'.
    Cluster name: esb_prod
    Virtual host: prod1.sth.nu
    Port: 80
    Topic location: ESBTopics/Topics/ESB_JAVA_DEFERRED
    Connection factory location: OracleOJMS/XATCF
    regards
    Kalle

  • JNDI Lookup of ConnectionFactory fails from inside Glassfish application

    This may very well end up being a glassfish specific question.
    I've got a stand-alone WAR using JSF, where I have a backing bean use some helper objects that will send a JMS message. When this WAR is running from inside of Glassfish, it fails to do the lookup of the ConnectionFactory.
    The application pulls the Queue JNDI and the Provider URL from a database, and uses a env Hashtable to do the JNDI InitialContext (which succeeds.) Using this Context, the ConnectionFactory lookup fails.
    The remote server in this instance is WebLogic 9.2 (the JNDI is publically available with no user authentication, verified with a JMS developer tool we use internally.)
    Here's the stacktrace...
    2007-10-15 19:48:04,514 ERROR [net.acadiasoft.shared.jms.util.JMSSenderHelper:130] NamingException: messageFactory not found
    javax.naming.NameNotFoundException: messageFactory not found
    at com.sun.enterprise.naming.TransientContext.doLookup(TransientContext.java:216)
    at com.sun.enterprise.naming.TransientContext.lookup(TransientContext.java:188)
    at com.sun.enterprise.naming.SerialContextProviderImpl.lookup(SerialContextProviderImpl.java:74)
    at com.sun.enterprise.naming.LocalSerialContextProviderImpl.lookup(LocalSerialContextProviderImpl.java:111)
    at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:339)
    at javax.naming.InitialContext.lookup(InitialContext.java:351)
    at net.acadiasoft.shared.jms.util.JMSSenderHelper.getConnectionFactory(JMSSenderHelper.java:128)
    at net.acadiasoft.shared.jms.util.JMSSenderHelper.init(JMSSenderHelper.java:58)
    at net.acadiasoft.shared.jms.util.JMSSenderHelper.<init>(JMSSenderHelper.java:36)
    at net.acadiasoft.web.shared.jms.util.AdminJmsHelper.<init>(AdminJmsHelper.java:19)
    at net.acadiasoft.web.server.pages.SchedulerBackingBean.deleteJobs(SchedulerBackingBean.java:75)

    I've found the problem, and it's something I simply overlooked. I don't know why I didnt realize, but i was setting the java.naming.factory.initial env variable to what Glassfish uses, not WebLogic.

  • 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

Maybe you are looking for

  • ICal wont sync from iPod to macbook pro.

    iPod and iPad sync iCal with each other flawlessly. When an event is added on one, it appears on the other. but this is not the case with the macbook pro. tried to sync numerous times through iTunes with no resolve.

  • System slow down after upgrade to 10.10.2

    Still have a slow down after updating to 10.10.2     Tried everything I can think of. Get spinning color wheel for a long time when opening even small files. Scrolling through folders, cursor hangs for a moment. opening and saving takes much longer.

  • Need BOR & event which triggers after vendor master change.

    Hi all.     Can you pls let me know the BOR & event which triggers after vendor master change. (Xk02). I used tcodes SWELS (evetn trace) , and SWEL and changed vendor adress using XK02. but I could not find any event or BOR in the trace. Pls help me

  • What is a lifetimer in a nokia phone

    recently i checked my nokia n70 lifetimer by pressing *#92702689#..then i found 000500:50 on screen what is its meaning....is that total incoming and outgoing calls i have made in hours..

  • X-Fi Mode Switching and XP File Permissi

    I have my file permissions locked down pretty tightly for all accounts except the Administrator. This is great for preventing major file system meltdowns whenever my wife picks up an email virus, but it can also make trouble now and then. The X-Fi ap