How to configure a JNDI resource

I'll try to make my question as simple as possible since I've never got an answer on these forums :(
I want to configure a JNDI resource in the Sun Java(TM) System Application Server Enterprise Edition 8.1 Admin Console so that webapplications can do basic ldap searches using JNDI.
The following code works for me:
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL, "ldap://the.ldap.server:389");
env.put(Context.SECURITY_AUTHENTICATION,"simple");
env.put(Context.SECURITY_PRINCIPAL,"thebinddn");
env.put(Context.SECURITY_CREDENTIALS,"thepassword");
try {
  LdapContext ctx = new InitialLdapContext(env, null);
  SearchControls cons = new SearchControls();
  cons.setSearchScope(SearchControls.SUBTREE_SCOPE); 
  NamingEnumeration results = ctx.search("ou=People,o=Temmellys,o=org", "uid=juhani2", cons);
  while (results != null && results.hasMore()) {
    /* doing something with the results */
  ctx.close();           
catch (Exception e) {
  e.printStackTrace(out);
}So my question is; How do I configure this resource with the same environment properties in the admin console? I want to name the resource ldap/test and access it in the following way (is this correct?):
InitialContext ctx0 = new InitialContext();
LdapContext ctx = (LdapContext)ctx0.lookup("ldap/test"); Do I configure a "Custom resource" or an "External resource" and how do I specify the properties?
See my original post for more information:
http://swforum.sun.com/jive/thread.jspa?threadID=62965&tstart=0
Even if this is basic rtfm stuff it would be nice if someone could help me out here. I am developing a portal for an organization running JES and my hands are tied on trying to get other things to work.

Problem solved in the original thread. If you are trying to do the same be sure to check it out (the SUN documentation is faulty):
http://swforum.sun.com/jive/thread.jspa?threadID=62965&tstart=0
I apologize for starting two threads on this.

Similar Messages

  • How to use tomcat JNDI  resource in eclipse

    hi all, In my project i am using JSF,Tomcat,eclipse... i am planing to implement annotaions as part of my application
    I want to use Jndi resource as part of my project by using java annotaions
    for this i configured my server.xml in tomcat as
    <Context docBase="ALWREPORTSNEW" path="/ALWREPORTSNEW"
    reloadable="true"
    source="org.eclipse.jst.jee.server:ALWREPORTSNEW" >
    <Resource auth="Container"
    driverClassName="com.mysql.jdbc.Driver" maxActive="10000"
    maxIdle="3000" maxWait="10000" name="jdbc/enrollmentschema"
    password="adminadmin" removeAbandoned="true"
    removeAbandonedTimeout="300" type="javax.sql.DataSource"
    url="jdbc:mysql://localhost:3306/enrollment_schema_old"
    username="root" />
    </Context>And i configured web.xml as
    <resource-ref>
    <description>Enrollment Schema Connection pooling</description>
    <res-ref-name>jdbc/enrollmentschema</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>And some where in my project i am using annotaion as follows. i am getting NULL when trying access that annotaion .
    @Resource(name = "jdbc/mobileEnrollProd") DataSource mobileds;
    @Resource(name = "jdbc/enrollmentschema")
    private DataSource enrollds;
    public String UploadBankWise() {
    System.out.println("--------- ds "+enrollds);// *i am getting NULL*
    }but same code working with Glassfish and net benas..
    can any body hint me where i did mistake
    thanks in advance

    Go to Window-Preferences-Java-Debug-Step Filtering. When the dialog opens, press F1 for help. Good luck!

  • 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

  • How to configure jdbc/jndi connection in crystal report 10

    Post Author: effy
    CA Forum: Data Connectivity and SQL
    i have tried to configure jdbc/jndi connection , i have both
    drivers  data base side and  crystal report side but i
    can't  configure it.  so please help if u know
    something. 

    Sorry, but I'm not on a home pc, I'm working on a virtualized pc with a long chain of permissions ... so I cannot simply download and run an utility...
    Instead... I think (I WAS thinking) someone from SAP can tell me this info ... Probably I'll buy a paid assistance ticket... But really it's a strange thing that a simply connection from a (so) paid software need a so difficult problem solving routine..
    I edited my environment variales: JAVA, PATH; CLASSPATH; JAVA_DIR, and a long list of others ... to ALL point to ALL of directory containing used jars...
    .. I asked my SysAdmin to edit CrConfig.xml and it's done ... classpath are rights, jdbc infos are also ok, ...
    .. but none ...

  • How to configure a JNDI URL resource

    I am trying to replicate the Websphere's URL Resource provider functionality in Tomcat, but haven't been really successful. So what I would like to do is access a properties file from a URL. This provides a convenient approach to modifying prop files as apposed to residing within WAR file. Anyway back to my question, I have taken a stab at this and below is how my meta-inf\context.xml, web.xml, and jndi code snippet looks.
    CONTEXT.XML
    code:
    <?xml version="1.0" encoding="UTF-8"?><Context> <Resource name="url/wfresource" auth="Container" type="java.net.URL" url="http://localhost:8080/ibi_html/wfresource.properties"/></Context>
    WEB.XML
    code:
    <resource-env-ref>     <description>Object factory for MyBean instances.</description>     <resource-env-ref-name>url/wfresource</resource-env-ref-name>     <resource-env-ref-type>java.net.URL</resource-env-ref-type>     </resource-env-ref>
    JNDI Lookup code snippet
    code:
    //Get a handle to the JNDI environment naming contextContext env = (Context)new InitialContext().lookup("java:comp/env");//Get a single valuejava.net.URL destURL = (java.net.URL)env.lookup("url/wfresource");
    Its throwing an exception.
    My question is if URL resource configuration is possible in Tomcat 5.5, and if so how.
    thanks

    Problem solved in the original thread. If you are trying to do the same be sure to check it out (the SUN documentation is faulty):
    http://swforum.sun.com/jive/thread.jspa?threadID=62965&tstart=0
    I apologize for starting two threads on this.

  • How to declare a JNDI resource which is not a datasource ?

    Hi,
    I'm looking for a way to create a jndi bound resource, as a jang.lang.String for instance, within oc4j enterprise console or maybe by editing config files.
    I'm trying to configure an application once for all, so that I can deploy a .ear which is identical for development, testing, validation, production, ... environments while being able to configure those instance independently.
    Can it be done with oc4j ? (it's intuitive to create a jndi bound resource if it's a datasource, but it seems to be the only kind of resource we can create) and if so, how ?
    thx in advance
    Olivier

    Hi Olivier,
    As far as I know, this is not possible. I see only three ways
    1. Add an OC4J startup class and bind the desired names into JNDI
    (not sure, whether this is really possible)
    2. If you need the bound JNDI objects only in a web application: just add them to your web.xml file
    3. Write your own provider and add it to the default application.xml or to your application's application.xml
    Best,
    Manfred

  • How to set the JNDI resources and params

    I am trying to connect my Crystal reports to my JSP page.
    I am using MySql DB and TomCat 4.1
    My web.xml is in the right place and contains the JNDI name (jdbc/MyDB)
    I was able to accomplish the following:
    1) Setting the connection pool and
    2) Able to specify the JDBC database option and was also able to generate the report in the designer using this JDBC option connectivity.
    However, when I try to run the report from the JSP page, it gives me the following error:
    javax.servlet.jsp.JspException: Report location is not specified in the configuration file     at
    com.crystaldecisions.report.web.viewer.taglib.ReportServerControlTag.doEndTag(Unknown Source)
         at org.apache.jsp.testing_jsp._jspx_meth_crviewer_viewer_0(testing_jsp.java:159)My CrystalReportEngine-config.xml resides in
    C:\Program Files\Apache Group\Tomcat 4.1\webapps\WebModule1\WEB-INF\classes
    and it contains the following
    <CrystalReportEngine-configuration>
      <reportlocation>../..</reportlocation>
      <timeout>10</timeout>
      <keycode>Azzzzzzzzzzzzzzzzzzzzzz</keycode> </CrystalReportEngine-configuration>
    My report that I am trying to execute resides in the root of my application (where it supposed to be).
    This lead me to believe that I probably need to specify a JNDI datasource.!! Do you agree? If so, how can I specify the
    JNDI Provider URL
    JNDI Username (is this the tomcat admin user name)?
    JNDI PWD
    Initial CONTEXTReally appreciate any help you can offer

    Can anyone tell me where to post the previouse message to get a solution, or may be a hint?
    If i am doing anything wrong to not get a response, please let me know so i can reward it or correct it.
    thanks

  • How to configure ftpadapter JNDI in server Console for oracle soa suite 11g

    Hi All,
    I need to configure a ftp adapter in one of my bpel process. Could any one guide me pleas ,how to do FTP adapter jndi configure in admin server console?
    Thank you.
    Regards,
    Satish

    http://www.oracle.com/technology/architect/soa-suite-series/dynamic_endpoints.html
    Configuring the End Point Properties for an Adapter through Oracle Enterprise Manager
    does that help ?

  • How do you use Default Resource Access Information?

    I have some 10g Forms & Reports that I want to use with SSO and they will all be connecting to the database with the same connection info. I know how to configure a Default Resource Access Information, but how do you use this with Forms & Reports?

    Douglas,
    the default Resource Access Infomation should be the connection information right? This is used in conjunction with SSO. You need to configure your F&R applications to delegate authentication to SSO by placing ssoMode=true in the config section of formsweb.cfg.
    The Forms Servlet will connect to OID retrieve the Resource Access Information (descriptor) for a given user and automatically log them into the application.
    Users will need a global identity in OID and SSO must be enabled to use resource access info with F&R
    regards,
    tt

  • Need Advice: Accessing JNDI resource which uses configuration file

    Currently I have a class which has a constructor which takes a path to a configuration file. If I wanted to use this class as a JNDI resource what would be your advice when working with a configuration file? If an application was to use a remote JNDI resource I could see how this would be a problem. I understand how to do it I'm just not sure of the right way to do it. I guess I'm looking for best practices advice.

    Hello,
    Yes, you can use the API RessourceBundle to read configuration informations.
    Just create a propertie file with your locale, and access it to read informations :
    for example :
    you create a file config_fr_FR.properties (i'm french).
    for accessing your information ( strValue1 = aValue) :
    String ressource = null;
    try {
    ressource = ResourceBundle.getBundle("config",new Locale("fr","FR")).getString("strValue1"); // better is to create a static Locale... here just for the example.
    } catch(Exception e) {
    // ooops...
    return ressource; // return aValue
    Hope this help.

  • How to configure resource bundle in facescontext.xml in JSF

    I have to take each label from the resource bundle in my web application, so how to configure resource bundle in JSF and how to use it, so please help me.....

    Follow the below mentioned steps ::
    1) make a properties file say mymessages.properties alongwith your java files. Put content like
    click=Click Me !!!
    #where click is the key and Click Me !!! is the actual value that needs to be displayed
    2) Add in faces-config.xml like this ::
    <application>
              <message-bundle>mymessages.mymessages</message-bundle>
         </application>     
    3) Use in your jsp page like this ::
    <f:view>
    <f:loadBundle basename="mymessages/mymessages" var="msg"/>
    hello :: <h:commandButton value="#{msg.click}" onclick="callJavaMethod()"></h:commandButton>
    </f:view>

  • How to configure Queue and QueueConnectionFactory for a MDB

    Hi *,
    I want to send some messages from a session bean to a message driven bean. Therefore I'll use the default Queue (sapDemoQueue) and QueueConnectionFactory.
    In the ServiceLocator of my SessionBean I do the lookup with following methods:
        public QueueConnectionFactory getQueueConnectionFactory() throws NamingException {
            if (queueConnectionFactory == null) {
                Object obj = ctx.lookup("jmsfactory/default/QueueConnectionFactory");
                queueConnectionFactory = (QueueConnectionFactory) obj;
            return queueConnectionFactory;
        public Queue getQueue() throws NamingException {
            if (queue == null) {
                Object obj = ctx.lookup("jmsqueues/default/sapDemoQueue");
                queue = (Queue) obj;
            return queue;
    My Message Driven Bean is configure as followed:
    ejb-jar.xml:
    <message-driven>
      <ejb-name>ExportBean</ejb-name>
      <ejb-class>de.test.ejb.abschluss.ExportBean</ejb-class>
      <transaction-type>Container</transaction-type>
      <message-driven-destination>
        <destination-type>javax.jms.Queue</destination-type>
      </message-driven-destination>
    </message-driven>
    ejb-j2ee-engine.xml:
    <enterprise-bean>
      <ejb-name>ExportBean</ejb-name>
      <message-props>
        <destination-name>jmsqueues/default/sapDemoQueue</destination-name>
        <connection-factory-name>jmsfactory/default/QueueConnectionFactory</connection-factory-name>
      </message-props>
    </enterprise-bean>
    I also create a jms-factories.xml and a jms-destination.xml.
    EAR-Project/META-INF/jms-factories.xml:
    <jms-factories>
      <connection-factory>
        <factory-name>jmsfactory/default/QueueConnectionFactory</factory-name>
        <context-factory-type>
          <link-factory-name>jmsfactory/default/QueueConnectionFactory</link-factory-name>
          <initial-context-factory>com.sap.engine.services.jndi.InitialContextFactoryImpl</initial-context-factory>
          <provider-url>localhost</provider-url>
          <security-principal>Administrator</security-principal>
        </context-factory-type>
        <client-id></client-id>
      </connection-factory>
    </jms-factories>
    EAR-Project/META-INF/jms-destination.xml:
    <jms-destinations>
      <destination>
        <connection-factory>jmsfactory/default/QueueConnectionFactory</connection-factory>
        <destination-name>jmsqueues/default/sapDemoQueue</destination-name>
      </destination>
    </jms-destinations>
    How to configure correctly?
    Does anybody an example how to configure?
    Where may I download the example of the SAP documentation at http://help.sap.com/saphelp_nw04/helpdata/en/3d/41bee546e94ad48537f2cf06a29818/frameset.htm
    Thank a lot,
    Juergen

    Hello Vesselin
    My deployment descriptors:
    ejb-jar.xml
              <session>
                   <ejb-name>MonatsabschlussBean</ejb-name>
                   <home>de.filiadata.leistungserfassung.ejb.abschluss.MonatsabschlussHome</home>
                   <remote>de.filiadata.leistungserfassung.ejb.abschluss.Monatsabschluss</remote>
                   <local-home>de.filiadata.leistungserfassung.ejb.abschluss.MonatsabschlussLocalHome</local-home>
                   <local>de.filiadata.leistungserfassung.ejb.abschluss.MonatsabschlussLocal</local>
                   <ejb-class>de.filiadata.leistungserfassung.ejb.abschluss.MonatsabschlussBean</ejb-class>
                   <session-type>Stateless</session-type>
                   <transaction-type>Container</transaction-type>
                   <resource-ref>
                        <res-ref-name>FdlbQueueConnectionFactory</res-ref-name>
                        <res-type>javax.jms.QueueConnectionFactory</res-type>
                        <res-auth>Container</res-auth>
                   </resource-ref>
                   <resource-env-ref>
                        <resource-env-ref-name>FdlbQueue</resource-env-ref-name>
                        <resource-env-ref-type>javax.jms.Queue</resource-env-ref-type>
                   </resource-env-ref>
              </session>
              <message-driven>
                   <ejb-name>ExportBean</ejb-name>
                   <ejb-class>de.filiadata.leistungserfassung.ejb.abschluss.ExportBean</ejb-class>
                   <transaction-type>Container</transaction-type>
                   <message-driven-destination>
                        <destination-type>javax.jms.Queue</destination-type>
                   </message-driven-destination>
                   <resource-ref>
                        <res-ref-name>FdlbQueueConnectionFactory</res-ref-name>
                        <res-type>javax.jms.QueueConnectionFactory</res-type>
                        <res-auth>Container</res-auth>
                   </resource-ref>
                   <resource-env-ref>
                        <resource-env-ref-name>FdlbQueue</resource-env-ref-name>
                        <resource-env-ref-type>javax.jms.Queue</resource-env-ref-type>
                   </resource-env-ref>
              </message-driven>
    ejb-j2ee-engine.xml
              <enterprise-bean>
                   <ejb-name>MonatsabschlussBean</ejb-name>
                   <session-props/>
              </enterprise-bean>
              <enterprise-bean>
                   <ejb-name>ExportBean</ejb-name>
                   <message-props>
                        <destination-name>FdlbQueue</destination-name>
                        <connection-factory-name>FdlbQueueConnectionFactory</connection-factory-name>
                   </message-props>
              </enterprise-bean>
    jms-factories.xml
    <jms-factories>
      <connection-factory>
        <factory-name>FdlbQueueConnectionFactory</factory-name>
        <context-factory-type>
          <link-factory-name>jmsfactory/default/XAQueueConnectionFactory</link-factory-name>
          <initial-context-factory>com.sap.engine.services.jndi.InitialContextFactoryImpl</initial-context-factory>
          <provider-url>localhost</provider-url>
          <security-principal>Administrator</security-principal>
          <security-credentials></security-credentials>
        </context-factory-type>
      </connection-factory>
    </jms-factories>
    jms-destinations.xml
    <jms-destinations>
      <destination>
        <connection-factory>FdlbQueueConnectionFactory</connection-factory>
        <destination-name>FdlbQueue</destination-name>
      </destination>
    </jms-destinations>
    And I'll put mit ServiceLocator:
        public QueueConnectionFactory getQueueConnectionFactory() throws NamingException {
            if (queueConnectionFactory == null) {
                Object obj = ctx.lookup("java:comp/env/FdlbQueueConnectionFactory");
                queueConnectionFactory = (QueueConnectionFactory) obj;
            return queueConnectionFactory;
        public Queue getQueue() throws NamingException {
            if (queue == null) {
                Object obj = ctx.lookup("java:comp/env/FdlbQueue");
                queue = (Queue) obj;
            return queue;
    Kind Regards,
    Juergen

  • How to configure for remote JMS client?

    I have my own Java JMS test program for performance measurements.
              I am using the JNDI and JMS provider functionality of the WebLogic 9.1 app-server but my test program is just pure JMS 1.02 sender/receiver clients - ie it is NOT part of, or deployed as a J2EE application.
              SINGLE MACHINE TEST
              ===================
              In a single machine environment I was able to
              - configure a JMSServer
              - configure a JMSSystemModule
              - configure resources for ConnectionFactories and Queue and Topics
              I then made what I believe to be a 'standalone' application module copied from some mysystemmodule-jms.xml and with that I somehow worked out how to deploy it using the weblogic.Deployer tool.
              The deployment apparently set up the JNDI and my JMS client could gain access to the administered objects and do what it does.
              Everything works.
              TWO MACHINE TEST
              ================
              I now have a second machine.
              I want to put my JMS sender client on this new machine and I want the JMS server and JMS receiver client to be unchanged from the SINGLE MACHINE TEST.
              But I really don't know quite how to proceed from here...
              Do I need to install the WebLogic app-server on the sender machine or is the weblogic.jar all I need?
              What is necessary configuration for JNDI access on the sender machine?
              Can I in fact use my original SINGLE MACHINE server unchanged as I am hoping?
              I don't think I want a "thin" client because I read that performance is impacted (and these are performance tests)
              Remember this is NOT a J2EE application. There is no MDB; no client-container; no descriptors etc. Maybe that makes it more complicated - I don't know.
              Sorry for such basic questions but if somebody can just point me to an appropriate example or tutorial it could save me days...
              Thankyou.

    Hi,
              My problem is on similar lines. I have an applet based UI working on RMI/t3 protocol.
              I am using weblogic 9.2 as my app server.
              When my applet is executed on JRE 1.5x it works fine.
              But when I use JRE1.4x it gives the following exception
              java.lang.NoClassDefFoundError: javax/management/InvalidAttributeValueException
              at weblogic.rmi.internal.Stub.<clinit>(Stub.java:21)
              at java.lang.Class.forName0(Native Method)
              at java.lang.Class.forName(Class.java:141)
              at weblogic.rmi.internal.StubInfo.class$(StubInfo.java:34)
              at weblogic.rmi.internal.StubInfo.<clinit>(StubInfo.java:34)
              at java.lang.Class.forName0(Native Method)
              I have analyzed the reason for this.
              the class javax/management/InvalidAttributeValueException was included in java 1.5 and above. So JRE 1.4 does not have it.
              In previous versions of weblogic this class was a part of their 'weblogic.jar' file and in weblogic 9.2 it is not a part of weblogic.jar file so when I am using JRE1.4 and weblogic 9.2 then it obviously does not find this class hence the above exception.
              I tried to put this all together and made custom made client jar file incliding the necessary classes. I was able to get throght this exception only land up in following exception.
              java.lang.VerifyError: class weblogic.utils.classloaders.GenericClassLoader overrides final method .
                   at java.lang.ClassLoader.defineClass0(Native Method)
                   at java.lang.ClassLoader.defineClass(Unknown Source)
                   at java.security.SecureClassLoader.defineClass(Unknown Source)
                   at sun.applet.AppletClassLoader.findClass(Unknown Source)
                   at java.lang.ClassLoader.loadClass(Unknown Source)
                   at sun.applet.AppletClassLoader.loadClass(Unknown Source)
                   at java.lang.ClassLoader.loadClass(Unknown Source)
                   at java.lang.ClassLoader.loadClassInternal(Unknown Source)
                   at weblogic.jndi.WLInitialContextFactoryDelegate.<clinit>(WLInitialContextFactoryDelegate.java:204)
                   at weblogic.jndi.spi.EnvironmentManager$DefaultFactoryMaker.<clinit>(EnvironmentManager.java:26)
                   at weblogic.jndi.spi.EnvironmentManager.getInstance(EnvironmentManager.java:48)
                   at weblogic.jndi.Environment.getContext(Environment.java:307)
                   at weblogic.jndi.Environment.getContext(Environment.java:277)
                   at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:117)
                   at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
                   at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
                   at javax.naming.InitialContext.init(Unknown Source)
                   at javax.naming.InitialContext.<init>(Unknown Source)
              I really need to support clients using Jre 1.4 and Jre 1.5
              I will really appreciate any help on this one.
              Please advise.
              Thank you all.

  • How to configure JMS-Server to use username and password

    Hi
    Maybe this is a real stupid question, but please help me, I'm not very experienced using JMS:
    I'm using JMS (provided by OC4J / Application Server 10.1.3). I configured a ConnectionFactory (without username and password) and a Queue and there is also a application, which successfully opens the JMS-Connections.
    This works well as long as I do not provide a username und password in the ConnectionFactory (EnterpriseManager: OC4J/Admin/Services/JMS-provider...). If I do this, my application terminates with the following stacktrace:
    javax.jms.JMSSecurityException: JMSServer[aplora2:12602]: failed to authenticate "myuser/mypassword", no such user.
         at com.evermind.server.jms.JMSUtils.make(JMSUtils.java:1034)
         at com.evermind.server.jms.JMSUtils.toJMSSecurityException(JMSUtils.java:1090)
         at com.evermind.server.jms.JMSServer.getJMSServer(JMSServer.java:1237)
         at com.evermind.server.jms.JMSServer.getJMSServer(JMSServer.java:1213)
         at com.evermind.server.jms.InContainerProxy.getJMSServer(InContainerProxy.java:93)
         at com.evermind.server.jms.EvermindConnection.<init>(EvermindConnection.java:103)
         at com.evermind.server.jms.EvermindQueueConnection.<init>(EvermindQueueConnection.java:62)
         at com.evermind.server.jms.EvermindQueueConnectionFactory.unprivileged_createQueueConnection(EvermindQueueConnectionFactory.java:98)
         at com.evermind.server.jms.EvermindQueueConnectionFactory.access$000(EvermindQueueConnectionFactory.java:42)
         at com.evermind.server.jms.EvermindQueueConnectionFactory$1.execute(EvermindQueueConnectionFactory.java:78)
         at com.evermind.server.jms.InContainerProxy.doSecureOp(InContainerProxy.java:157)
         at com.evermind.server.jms.EvermindQueueConnectionFactory.createQueueConnection(EvermindQueueConnectionFactory.java:75)
         at com.evermind.server.jms.EvermindQueueConnectionFactory.createQueueConnection(EvermindQueueConnectionFactory.java:66)
         at sam.model.messages.MessageManager.<init>(MessageManager.java:74)
    where "myuser" and "mypassword" are the username and password I entered in the ConnectionFactory. (My Application certainly uses the same username and password)
    I expected, that by entering username and password here I would configure my Queue to be protected by them. But obviously there are some very basic things I didn't understand. Can anyone give me a hint, how I can protect the (OC4J-) JMS-Server or the Queue by username and password?
    Thanks for your help
    Frank Brandstetter

    Hey Frank -
    Assuming you've set up users in the "Security Manager" for your application, you can specify what JNDI resources they can "read" (and thus also connect to) via the orion-application.xml file. Look at the following snippet from the orion-application.xml file:
         <namespace-access>
    <read-access>
    <namespace-resource root="jms/firstQueue">
    <security-role-mapping impliesAll="false" name="jmsSecurity">
    <user name="scooter"/>
    </security-role-mapping>
    </namespace-resource>
    </read-access>
    <read-access>
    <namespace-resource root="delme">
    <security-role-mapping impliesAll="false" name="jmsSecurity">
    <group name="messagingUsers"/>
    </security-role-mapping>
    </namespace-resource>
    </read-access>
    </namespace-access>
    This would say that only the user "scooter" that you've set up would have access to the Queue whose JNDI name begins with jms/firstQueue. Anyone you've set up and added to a messagingUsers group would have access to any Queues whose JNDI name begins with "delme". (I'm honestly not sure what exactly this line does: <security-role-mapping impliesAll="false" name="jmsSecurity">)
    This is the only way I've found to limit access to a particular Queue.
    HTH.
    Scott

  • Setting up JNDI resources in web.xml only

    Hi,
    I'm using Tomca 4.0 LE and JDK 1.4.0_01.
    I've been using a database connection pool on my local machine by editing the server.xml file and web.xml. However, I need to move the webapp onto a web hosting compaines server (same tomcat and jdk version). I cannot edit the server.xml file, so I need to set up my JNDI resource in web.xml only.
    I have done this (in web.xml):
    <resource-ref>
          <res-ref-name>jdbc/ocb_clients</res-ref-name>
          <res-type>javax.sql.DataSource</res-type>
          <res-auth>Container</res-auth>
      </resource-ref> Now, before when I had this all set up in web.xml, I had a list of <ResourceParams> within the <context> element:
    <ResourceParams name="jdbc/ocb_clients">
        <parameter>
          <name>factory</name>
          <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
        </parameter>
        <parameter>
         <name>username</name>
         <value>username_here</value>
        </parameter>
        <parameter>
         <name>password</name>
         <value>password_here</value>
        </parameter>          
        <parameter>
           <name>driverClassName</name>
           <value>org.gjt.mm.mysql.Driver</value>
        </parameter>       
        <parameter>
          <name>url</name>
          <value>jdbc:mysql://localhost:3306/ocb_clients</value>
        </parameter>
      </ResourceParams>These parameters are obviously needed for the datasource to work. How can I set these up just using web.xml?
    Also, this code is from a servlet that I have loading on tomcat startup. Will this still work with the new configuration?
    public void init() throws ServletException
         DataSource ds = null;       
         try
           //Set up the inital context
           Context ctx = new InitialContext();
           //Look up the database
           ds = (DataSource) ctx.lookup("java:comp/env/jdbc/ocb_clients");
         catch(NamingException nameE)
           System.err.println("Error looking up database: " + nameE);
         //Add the datasource to the application scope
         getServletContext().setAttribute("ocbDatabase", ds);
      }Any help is greatly appricated,
    Thanks, Mel.

    I am Having exactly the same problem with tomcat 5.0. I have tried to do everything mention as solutions at different fourums but I failed.
    BTW I am using MySQL
    Thanks
    Dibakar

Maybe you are looking for

  • IMac to flatscreen TV

    I want to connect an iMac to a flatscreen TV. As far as I can tell, I will need a mini DVI to DVI adapter and a DVI to HDMI adapter. I am getting confused with the different DVI plugs. Apparently there is DVI-D, DVI-I and a few more I think? Anybody

  • HT201317 Shared Photo Stream Using Memory

    Hello, Shared Photo Stream is using 1.3gb of memory on my devices.  Does anyone know why?

  • Cash Journal Printing -Consolidated Balance

    Hi All, While printing the cash journal for a particular week , The transactions are listed in the posting date order and is printed accordingly.My client requires the cash journal to be printed as opening balance , balances GLs listed and Closing ba

  • MRP/Forecast Profiles - Program RMMM0001

    Hi, anyone out there knows how to turn off the program RMMM0001? It will run whenever a MRP or Forecast Profile is changed or Deleted. In addition, can this auto-schedule be configured? That is, only run whenever change is done (even default value ch

  • Oracle Server Access through DSL Router

    Hi All, I have Oracle 9i server on Windows 2000 and working fine in Local Area Network. I have broadband connection with one static IP. Internet ISP has given a router. From outside office I can connect to Oracle through the static IP. I just have to