Using JNDI to keep a independent session

Hi. I want to design a hashtable of session attributes connected in the JNDI tree in a J2EE application.
My motivation is to instead of using the Session object provided by the servlet to store user dada, use an object acessible anywhere in the application (there are places where I can't pass the session object).
I'm using JBoss but I want to make a solution that works for other proprietary servers without changing the code.
Well, in my first test when I bind an object to JNDI it's accessible by everyone, independent of the Principal. My first idea was to use the Principal to identify each user properties.
But there is a problem: a session may not be identified, I may have users connected to the public area of the system (Principal is null).
Does exist an user area in the JNDI that I can use to store session data ony visible to a particular user OR there is a way to identify the user request in the JNDI ?
Thanks

I can't see where can i find help !!!
which provider url can i use (or which protocol to use) : RMI, Ldap, file system... ?

Similar Messages

  • Could not access Local Session Bean using JNDI lookup

    Hi EJB Guru,
    I am quite new to EJB 3.0 but have had a good deal of success including using JNDI to lookup Remote Stateless Session Bean in EJB 3.0. However, looking up local Stateless Session Bean prove more challenging with I had anticipated.
    Here is my code
    as follows:
    public interface Calculator {
        public int add(int x, int y);
        public int subtract(int x, int y);
    import javax.ejb.Remote;
    @Remote
    public interface CalculatorRemote extends Calculator {
    import javax.ejb.Local;
    @Local
    public interface CalculatorLocal extends Calculator {
    import javax.ejb.Local;
    import javax.ejb.Remote;
    import javax.ejb.Stateless;
    import bean.CalculatorLocal;
    import bean.CalculatorRemote;
    @Stateless
    public class CalculatorBean implements CalculatorRemote, CalculatorLocal {
        public int add(int x, int y) {
            return x + y;
        public int subtract(int x, int y) {
            return x - y;
    import bean.*;
    import bean.Calculator;
    import bean.CalculatorLocal;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    public class ClientAccessLocalCalculator {
        public static void main(String[] args) throws NamingException {
            InitialContext ctx = new InitialContext();
            CalculatorLocal calculator = (CalculatorLocal) ctx.lookup("CalculatorBean/local");
            System.out.println("1 + 1 = " + calculator.add(1, 1));
            System.out.println("1 - 1 = " + calculator.subtract(1, 1));    }
    import bean.Calculator;
    import bean.CalculatorRemote;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    public class ClientAccessRemoteCalculator {
        public static void main(String[] args) throws NamingException {
            InitialContext ctx = new InitialContext();
            CalculatorRemote calculator = (CalculatorRemote) ctx.lookup("CalculatorBean/remote");
            System.out.println("1 + 1 = " + calculator.add(1, 1));
            System.out.println("1 - 1 = " + calculator.subtract(1, 1));    }
    }Output when running ClientAccessRemoteCalculator gives
    1 + 1 = 2
    1 - 1 = 0
    Output when running ClientAccessLocalCalculator on JBoss AS 4.0.5 gives:
    Exception in thread "main" javax.ejb.EJBException: Invalid invocation of local interface (null container)
    at org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalProxy.java:75)
    at $Proxy0.add(Unknown Source) at ClientAccessLocalCalculator.main(ClientAccessLocalCalculator.java:14)
    JNDIView in JMX-Console in JBoss:
    +- CalculatorBean (class: org.jnp.interfaces.NamingContext)
    | +- local (proxy: $Proxy84 implements interface bean.CalculatorLocal,interface org.jboss.ejb3.JBossProxy,interface javax.ejb.EJBLocalObject)
    | +- remote (proxy: $Proxy83 implements interface bean.CalculatorRemote,interface org.jboss.ejb3.JBossProxy,interface javax.ejb.EJBObject)
    Output when running ClientAccessLocalCalculator on SJSAS 9.0 gives:
    Exception in thread "main" javax.naming.NameNotFoundException: bean.CalculatorLocal not found
    C:\>asadmin
    Use "exit" to exit and "help" for online help.
    asadmin> list-jndi-entries
    Jndi Entries for server within root context:
    bean.CalculatorRemote: javax.naming.Reference
    jbi: com.sun.enterprise.naming.TransientContext
    jdbc: com.sun.enterprise.naming.TransientContext
    UserTransaction: com.sun.enterprise.distributedtx.UserTransactionImpl
    bean.CalculatorRemote__3_x_Internal_RemoteBusinessHome__: javax.naming.Reference
    bean.CalculatorRemote#bean.CalculatorRemote: javax.naming.Reference
    ejb: com.sun.enterprise.naming.TransientContext
    Command list-jndi-entries executed successfully.
    asadmin>I am using Application Client to lookup these Session Beans on Netbeans 5.5, JBoss AS 4.0.5 (EJB3 installer)/SJSAS
    9.0, SDK 1.5.0_11 on Windows XP platform.
    Any assistance would be much appreciated.
    Many thanks,
    Henry

    Hi Henry,
    Any direct global JNDI lookup is not portable. It works in some cases but not in others, which
    is why we recommend using the portable Java EE approach of declaring an ejb dependency
    and looking up that dependency via the bean's component environment (java:comp/env).
    This is true whether you're dealing with Remote or Local ejb dependencies.
    Local ejbs are not supported in the Application Client tier at all. In the server tier, there is no
    guarantee that a Local EJB even is assigned a global JNDI name since there's no requirement
    that it be available outside of the application in which the ejb is defined.
    You can find more information on these ejb access topics in our EJB FAQ :
    https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html

  • Clafirication on Login Detials  when using JNDI in Toplink

    Hi,
    I am using Toplink in my application for connecting to Database using JNDI ,which is specified in session.xml ,given below
    <toplink-configuration>
    <session>
    <name>default</name>
    <project-xml>META-INF/toplinkMapping.xml</project-xml>
    <session-type>
    <server-session/>
    </session-type>
    <login>
    <datasource>jdbc/PROD</datasource>
    </login>
    </session>
    </toplink-configuration>
    but in the toplinkMapping.xml mapping file i also have an entry for Login Credentials .
    The partial xml mapping file for Login details is given below.
    <toplink:login xsi:type="toplink:database-login">
    <toplink:platform-class>oracle.toplink.platform.database.oracle.Oracle10Platform</toplink:platform-class>
    <toplink:user-name>stage</toplink:user-name>
    <toplink:password>0186BD6F6439FA38D570EB1C6286D1EB41782C546151871A</toplink:password>
    <toplink:driver-class>oracle.jdbc.OracleDriver</toplink:driver-class>
    <toplink:connection-url>jdbc:oracle:thin:@localhost:1522:DEV</toplink:connection-url>
    </toplink:login>
    Can anyone please explain why the login details are required here in the mapping file ,while iam connecting DataBase through JNDI using DataSources in the Session.xml
    Thanks in advance

    Hi Jeremy,
    I've tried adding:
    php_value upload_max_filesize 30M
    to the .htaccess file but I get a 500 Internal Server Error
    Seems like using .htaccess files has been deactivated by your host.
    Please try with adding...
    ...on line 1 of the script which needs that, and see if that works -- if even this doesn´t work, I fear I can´t provide any other suggestion than transferring your site to a hosting provider which handles stuff the standard way and doesn´t force you to use such odd workarounds, which I have never heard of.
    Sorry, needed to get that off my chest, but some hosting companies out there are really strange :-)
    The problem is that I use the php.ini files to override the server setting
    I suspect (can be wrong though) that the php.ini file placed in whatever directory will start "from scratch" everytime a document in that folder is "triggered", and that´s why the session of page A are getting destroyed on page B
    Cheers,
    Günter Schenk
    Adobe Community Expert, Dreamweaver

  • HFM Web Sever Configuration--Keep Alive and Session Time Out Optimal Config

    We recently implemented an HFM 9.3.1 environment. We are using Windows 2003 Enterprise SP2 servers with IIS6. We have two HFM Web servers connecting to an application cluster with two application servers in the cluster. We were getting some errors when trying to unlock HFM cells in Workspace, but we were able to perform the functions fine on the application using the WIN32 client.
    I opened a ticket with support and they recommended modifying the subcontext.properties file located in %HYPERION_HOME%\deployments\WebLogic9\servers\Workspace\webapps\workspace\conf. They recommended changing the following settings:
    #KeepAliveInterval=30
    #SessionTimeout=60
    From what I understand, these settings are for the communication between the HFM Web Servers and the application cluster servers. I'm wondering how changing these settings may affect our environment. Are there negative effects and/or trade-offs for changing these settings? Is there a recommended threshold or maximum value?

    Hi Dinesh,
    This cannot be achieved without development enhancements to some standard SAP framework component, to introduce a "keep-alive" concept. If you are using a CMS for CTI or email integration, you need to ensure it supports keeping the communications session alive also.
    Sincerely,
    Glenn
    Glenn Abel
    Covington Creative
    www.covingtoncreative.com

  • How to use JNDI lookup

    Hi ,
    I am creating a POC for my project.Its using ATG and spring frameworks using RAD 6.first I have created ATG sample project in that same EAR file i created sample Spring project.Both are running in the same EAR.
    I want to use spring classes from ATG components to use those methods.that is i should pass parameters to spring project methods and i should get the return value after executing those methods.
    I heard that using JNDI look up I can get spring project class objects using that I can invoke spring project methods.
    My requirement is two projects will be running in the same EAR.But one project will not be having information about other projects.both are independent from other.Using JNDI look up i need to invoke Spring project methods.
    Please anyone help me how to do this.
    I used java:comp/env/com/dao/EmpDAO to get instance of my class EmpDAO.But i am getting naming exception.Can anyone help me how to do this
    Thanks in advance.

    If Tomcat is your servlet/JSP engine, they have a nice bit about how to do it:
    http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-howto.html
    MOD

  • How to Use Transient View Objects to Store Session-level Global Variables

    hi
    Please consider section "40.8.5 How to Use Transient View Objects to Store Session-level Global Variables"
    at http://download.oracle.com/docs/cd/E14571_01/web.1111/b31974/bcstatemgmt.htm#ADFFD19610
    Based on this documentation I created the example application
    at http://www.consideringred.com/files/oracle/2010/ProgrammaticalViewObjectAndRollbackApp-v0.01.zip
    It behaves as show in the screencast at http://screencast.com/t/qDvSQCgpvYdd
    Its Application Module has a Transient View Object instance "MyEmployeesContextVOVI", as master for the child View Object instance "EmpInCtxJobVI".
    On rollback the Transient View Object instance keeps its row and attribute values.
    Also when passivation and activation is forced (using jbo.ampool.doampooling=false ) the Transient View Object instance seems to keep its row and attribute values.
    questions:
    - (q1) Why does the expression #{bindings.MyEmployeesContextVOVIIterator.dataControl.transactionDirty} evaluate as true when a Transient View Object instance attribute value is changed (as shown in screencast at http://screencast.com/t/qDvSQCgpvYdd )?
    - (q2) What would be a robust approach to make a Transient View Object instance more self-contained, and manage itself to have only one single row (per instance) at all times (and as such removing the dependency on the Application Module prepareSession() as documented in "5. Create an empty row in the view object when a new user begins using the application module.")?
    many thanks
    Jan Vervecken

    Thanks for your reply Frank.
    q1) Does sample 90 help ? http://blogs.oracle.com/smuenchadf/examples/
    Yes, the sample from Steve Muench does help, "90. Avoiding Dirtying the ADF Model Transaction When Transient Attributes are Set [10.1.3] "
    at http://blogs.oracle.com/smuenchadf/examples/#90
    It does point out a difference in marking transactions dirty by different layers of the framework, "... When any attribute's value is changed through an ADFM binding, the ADFM-layer transaction is marked as dirty. ...".
    This can be illustrate with a small change in the example application
    at http://www.consideringred.com/files/oracle/2010/ProgrammaticalViewObjectAndRollbackApp-v0.02.zip
    It now shows the result of both these expressions on the page ...
    #{bindings.MyEmployeesContextVOVIIterator.dataControl.transactionDirty}
    #{bindings.MyEmployeesContextVOVIIterator.dataControl.dataProvider.transaction.dirty}... where one can be true and the other false respectively.
    See also the screencast at http://screencast.com/t/k8vgNqdKgD
    Similar to the sample from Steve Muench, another modification to the example application introduces MyCustomADFBCDataControl
    at http://www.consideringred.com/files/oracle/2010/ProgrammaticalViewObjectAndRollbackApp-v0.03.zip
    public class MyCustomADFBCDataControl
      extends JUApplication
      @Override
      public void setTransactionModified()
        ApplicationModule vApplicationModule = (ApplicationModule)getDataProvider();
        Transaction vTransaction = vApplicationModule.getTransaction();
        if (vTransaction.isDirty())
          super.setTransactionModified();
    }Resulting in what seems to be more consistent/expected transaction (dirty) information,
    see also the screencast at http://screencast.com/t/756yCs1L1
    Any feedback on why the ADF Model layer is so eager to mark a transaction dirty is always welcome.
    Currently, question (q2) remains.
    regards
    Jan

  • I am trying to manage my media from the computer but it keeps saying my session has timed out and I've tried it so many times. How can I successfully manage my media?

    I am trying to manage my media from the computer but it keeps saying my session has timed out and I've tried it so many times. How can I successfully manage my media?

        Hi Valeria07,
    We want managing your media to be easy! It saddens me to hear that this is not occuring. Do you receive a specific error message when the browser times out? Have you tried using a different browser?
    Thanks,
    PamelaF_VZW
    Tweet us @vzwsupport

  • How to keep alive a session in Web Services?

    I have to do my project, that will be including some following features:
    1. Login to Application through Web Services method. For example:
    http://mydomain.com/web-services/Login?WSDL
    2. After logging in, use mySms method to send message to Cellphone through Web Services! For example:
    http://mydomain.com/web-services/mySms?WSDL
    My questions are:
    1. How can I keep alive the session after logging in the application in Web Services? In Web, I can use "Session".
    2. If someone has not logged in the Application, he/she could not use mySms method for sending Sms. How can I do that?
    3. I know, when I invoke a Web Services, one JavaBean has been called, and this bean is persistence with his own states. It means, if I set value to parameters of this bean, these values are persistence for invoked methods by other persons.
    For example:
    mySms bean has a private field "jid" inited with NULL value.
    Person A invoked mySms.
    Then, A set jid of mySms to value "A".
    Person B invoked mySms. B got jid value. He receive the result value is "A".
    The question is, how can I set mySms bean so that mySms bean is not persistence?
    Thanks many!

    Hi,
    I can right away answer your FIRST Question.
    Since WebServices are PURELY Based on SOAP which is in tern based on HTTP, they rely on a Stateless protocol.
    I am sure you know that the HTTP is the STATELESS Protocol and so you can not maintain Session and so EACH Http REQUEST is considered as a SEPERATE REQUEST.
    Now, still you want to maintain the Session in WebServices,
    The simple answer is PASSING PARAMETERS.
    Just Maintain your Session on Client (If you are using JSPs or Servlets to CAll WEBSERVICES then maintain Session through your HTTPSession) and each time you Invoke WebService PASS ON REQUIRED Parameters.
    This Approach is Exactly like your URL REWriting OR your Parameters Passing through QUERY STRINGS.
    I hope you got what I am saying!
    Take care,
    Himanshu/

  • AuthenticationFailedException when using JNDI and JavaMail with SMTP auth

    Hi all - I've been banging my head on this one for awhile now - hopefully someone else has done this.
    We are working in a servlet container (tomcat), and need obtain a mail session from JNDI. We do this as follows:
                   Context initCtx = new InitialContext();
                   Context envCtx = (Context) initCtx.lookup("java:comp/env");
                   Session mailSession=(Session) envCtx.lookup("mailSession/trumpetinc");so far so good. The jndi entry for the mail session is configured in server.xml as follows:
              <Resource name="mailSession/trumpetinc" scope="Shareable" type="javax.mail.Session"/>
              <ResourceParams name="mailSession/trumpetinc">
                <parameter>
                  <name>mail.smtp.host</name>
                  <value>mail.server.com</value>
                </parameter>
                <parameter>
                  <name>mail.smtp.password</name>
                  <value>ABCDEFG</value>
                </parameter>
                <parameter>
                  <name>mail.smtp.user</name>
                  <value>trumpet_kevin</value>
                </parameter>
             <parameter>
               <name>mail.smtp.auth</name>
               <value>true</value>
             </parameter>
              </ResourceParams>With the above, whenever we hit Transport.send(msg), we got an AuthenticationFailedException thrown. I have run into this before with SMTP authentication, so I decided to try using the transport.sendMessage() method instead.
    So, I get the transport:
    Transport trans = mailSession.getTransport("smtp");
    trans.connect();Then I send my message using:
    msg.saveChanges();
    trans.sendMessage(msg, msg.getAllRecipients());and finally, I close the transport:
    trans.close();Unfortunately, I'm still getting the exception. Is it possible that my connect() method is not picking up the JNDI properties set in the server.xml file (this seems likely)? If so, what's the best way for me to get those properties so I can set them explicitly in the connect() method?
    Thanks in advance,
    - Kevin

    Hi,
    I have faced the same problem and after some googling and trying I have discovered what causes the AuthenticationFailedException exception. I just wanted to share the knowedge maybe it will be helpfull to others.
    Here it is what the API says:
    To use SMTP authentication you'll need to set the mail.smtp.auth property (see below) and provide the SMTP Transport with a username and password when connecting to the SMTP server. You can do this using one of the following approaches:
    1.Provide an Authenticator object when creating your mail Session and provide the username and password information during the Authenticator callback.
    Note that the mail.smtp.user property can be set to provide a default username for the callback, but the password will still need to be supplied explicitly.
    This approach allows you to use the static Transport send method to send messages.
    2.Call the Transport connect method explicitly with username and password arguments.
    This approach requires you to explicitly manage a Transport object and use the Transport sendMessage method to send the message. The transport.java demo program demonstrates how to manage a Transport object. The following is roughly equivalent to the static Transport send method, but supplies the needed username and password:
    Using the Transport.connect makes the JNDI not very helpfull for configuration.
    It seems that using just the mail.smtp.user and mail.smtp.pass is not sufficient for the authentication.
    so, the solution is :
    just place these to lines in the JNDI configuration:
              username="test"
              password="test1"
    so it should looks as follows:
              <Resource name="mail/Session" auth="Container"
              type="javax.mail.Session"
              username="test"
              password="test1"
              mail.transport.protocol="smtp"
              mail.smtp.auth="true"     
              mail.smtp.host="localhost"
              mail.smtp.port="25"
              mail.smtp.user="test"
              mail.smtp.password="test1"
    />
    where test and test1 are the user's credentials
    Regards,
    Kiril
    Message was edited by:
    Kireto
    Message was edited by:
    Kireto

  • Keeping an application session open

    Internet Sales (ISA) integrated in the portal.
    The problem we're currently facing is the following:
    We integrated the ISA application into the portal, we are using the SSO and this works just fine. We're trying to maintain or basket contenence even when we are clicking on another link in the portal.
    This would effectively mean, according to me, to keep the ISA session open and when we click on the link to the ISA again not to open a new session but work on in the current one.
    We've tried to put the variable in web.xml for re-enabling cookies to true but this was not the solution.
    Ideas anyone?

    Hi Allan,
    Well navigating away from the page will invoke the DSM terminator and the portal will try to close the session to the ISA server. Is opening the shop in another window an option for you? This might be a good work around in your scenario?
    cheers,
    Shantanu Garg

  • Keep alive a session in CRM

    Dear CRM folks -
    I am calling CRM using BAPIs. The BAPIs are published as Web Services.
    I would like that the session between 2 BAPI calls is maintained in an optimized way so I don't make specific calls to the DB to store my session info.
    Anyone knows a way of keeping alive a session in the CRM between 2 BAPI calls?
    Thanks !

    BAPIs are just basically function modules.  Two function modules which are in the same function group are able to share information while the session is open.
    If your two BAPIs are not in the same function group(you didn't mention the names or I could have checked) then you can create a wrapper function module which has it's own variables to store the information.  Unfortunately once the RFC session/ICM Web Session is closed then you'll lose that in-memory information.
    I assume that you're making the two BAPI calls at different times which is why you're having this problem.  Like one to get user information and then one more to get some other detailed info once the user inputs something.
    Without knowing much about what you are really trying to do, my quick idea is to create a Stateful BSP in CRM which accepts all your requests.  The BSP can simply call the BAPIs(eliminate the need for the web service - unless you have some reason you need it) and then between the first and second BAPI call, the BSP will keep the state of the BAPI results in-memory.
    If you give more info, might be easier to answer your question.

  • Syncing contacts between 2 different computers while keeping both independent of each other?

    Hi,
    I'm wondering if there is a way to have my calendars and contacts from 2 different computers running Mountain Lion sync to my iPad retina while keeping the 2 computers from merging the calendars and contacts? I do have a separate apple ID set up on each computer, and each computer does connect to iCloud.
    The reason is one is my work machine, the other my personal home machine. The home machine keeps my wife and me connected by sharing the contacts and calendars which has been working well. I don't want to clutter up that by mixing in calendars and contacts from my work computer and don't want my wife to have access to them either.
    The only way I can figure to have both reside on my iPad while keeping them independant of each other is to physically connect my iPad to my work machine and not have the contacts in iCloud. That way when I transfer them to the iPad via iTunes, it will be under the category On My Mac rather than iCloud contacts.
    The only problem with that is then I'm always having to connect and sync my iPad to my work machine.
    Is there a better way to do this?

    dcharlot wrote:
    I really just have no idea what machine name/ip address i am supposed to put in. when i put an asterik for any it just goes to localhost so that doesn't help me.
    Sorry, you lost me right there. Where exactly did you try to put an asterix????
    Which example program are you trying to use?
    Typically, you would enter the IP address of the server in the client program.
    LabVIEW Champion . Do more with less code and in less time .

  • How to keep track of sessions ?

    Hi,
    Recently at an interview I was asked that how do you keep track of n number of user sessions in JSP ?
    Can somebody help me with the answer that I should have given ?
    Thanks.

    You would have to extend the session handling system using the various listeners for Session events. Check out the package javax.servlet.http.
    SessionListener: responds to sessionCreated/sessionDestroyed - so you can keep track of sessions as they come/go.
    You then also keep in memory (either a singleton, or in application scope) a permanent map of all the sessions. That way you knoe exactly how many sessions there are, and can get at the data for any or all of them.
    (Note this is a potential security risk, which is why the functionality was removed from the servlet framework)
    Another approach would be to use a SessionBindingListener, on a user object. This listener fires events when the object is bound/removed from a session
    Assuming it is an Intranet, where a user logs in, and after login, a "User" object is placed into session. This will let the user object fire an event whenever it is bound - ie when you log in. Thus you can keep track of who is logged in, and if they are logged in multiple times.
    Hope this helps some,
    evnafets

  • UserTransaction -  Scope using JNDI lookup from jspInit() method

    Howdy,
    I'm using JSP's with JavaBeans accessing a DataSource and some other enviroment variables using JNDI lookups. I've read that JNDI lookups can take a fair amount of time and should be limited whenever possible. My previous configuration had the JNDI lookups inside the constructors of the JavaBeans but I've recently decided to move them to the jspInit() method of the calling JSP. This way the lookup only needs to be performed once and then I pass the values to the JavaBean in a method called setContextVariables. Two of the references to objects that i'm sending are the UserTransaction and DataSource objects. Within the Javabeans I have userTran.begin() and commit() statements. So far it's running great but i'm starting to wonder about the thread safety of this method. My question lies in the actual delagation of the UserTransaction object to the calling client method. It seems that i'm passing the same transaction to every Javabean (or am I?) Is the transaction actually issued when the begin() method is called, or at the time of the JNDI lookup? To test everything out, I opened two sessions and put a breakpoint inside one of the transactions. When I stopped at the breakpoint I ran another thread (also using a transaction retrieved from the same JSP). Then I went back and resumed the first thread and everything seemed to work ok. So... this seems completely fantabulastic so far (definitely noticable response time increases) but I'm still a little skeptical. If anyone is using a process similar to this I would appreciate some feedback. Thanks.

    Hi,
    The EJB bean will use the client transaction when the following attributes are specified in descriptor.
    1) Required
    2) Mandatory
    3) Supports
    In Required case, if the client is associated with Transaction, then the EJB bean will use the same transaction. This is achieved by Transaction context. The EJB bean will use the same transaction context set by client. if the client doesn't have any transaction, then the container will create new transaction context for EJB bean and completes the transaction.
    In Mandatory case, the client must be associated with Transaction so that EJB bean will use the same transaction. If the client doesn't associate with transaction, then container will throw TransactionRequiredException for EJB bean.
    In Supports case, it works similar to Required case except that if the client doesn't associate with transaction, then there won't be any transaction in EJB bean.
    hope this helps.

  • Create base dn using JNDI...

    Hi
    I want to create the base dn for OpenDJ LDAP using JNDI below is the code i am using for the same but it is thorwing me the error could any body help me to tell me where exactly i am doing wrong .
    public static String ldapUri = "ldap://169.144.104.75:389";
         public static String admindn = "cn=Directory Manager";
         public static String admincred = "redhat";
         public static void main(String args[]){
              Hashtable env = new Hashtable();
              env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
              env.put(Context.PROVIDER_URL, ldapUri);
              env.put( Context.SECURITY_PRINCIPAL, admindn );
              env.put( Context.SECURITY_CREDENTIALS, admincred );
              try {
              DirContext ctx = new InitialDirContext(env);
              Attributes attrs = new BasicAttributes(true);
              Attribute objclass = new BasicAttribute("objectclass");
              objclass.add("top");
              objclass.add("domain");
              objclass.add("ds-cfg-branch");
              attrs.put(objclass);
              attrs.put("dn","ds-cfg-backend-id=userRoot,cn=Backends,cn=config");
              ctx.createSubcontext("dc=naren1,dc=naren1",attrs);
              ctx.close();
    The error is am getting is
    javax.naming.NameNotFoundException: [LDAP: error code 32 - The provided entry dc=naren1,dc=naren1 cannot be added because its suffix is not defined as one of the suffixes within the Directory Server]; remaining name 'dc=naren1,dc=naren1'
         at com.sun.jndi.ldap.LdapCtx.mapErrorCode(LdapCtx.java:3057)
         at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2978)

    I want to create the base dn on the OpenDJ and i have used the above mentioned code to create the basedn .
    I am the confing file where this entry should be created
    dn: ds-cfg-backend-id=userRoot,cn=Backends,cn=config
    objectClass: ds-cfg-backend
    objectClass: top
    objectClass: ds-cfg-local-db-backend
    ds-cfg-preload-time-limit: 0 seconds
    ds-cfg-compact-encoding: true
    ds-cfg-db-checkpointer-bytes-interval: 20 megabytes
    ds-cfg-db-logging-level: CONFIG
    ds-cfg-db-checkpointer-wakeup-interval: 30 seconds
    ds-cfg-disk-full-threshold: 20 megabytes
    ds-cfg-db-evictor-keep-alive: 600 seconds
    ds-cfg-disk-low-threshold: 100 megabytes
    ds-cfg-db-directory: db
    ds-cfg-base-dn: dc=com
    ds-cfg-base-dn: dc=ex,dc=com1
    ds-cfg-base-dn: dc=exam,dc=com2
    I have also read one artical on the same http://stackoverflow.com/questions/8977946/how-to-create-new-base-dn-using-jndi
    But unable to find the error . If any body can help who had worked on to create the base dn on LDAP.

Maybe you are looking for

  • I deleted all my thumbs and originals...

    really need help!!!! I was trying to label all my photos and everything, and i put the originals and thumbs files in the trash. When i went to iphoto to view my photos, it shows all the thumbs, but when i go to view the pictures full screen, nothing

  • My iPod has files "in use by another application"?

    Ever since the new iTunes version came out, my iPod classic says this. It erased everything on it and now will not let me sync it. Is there anyway I can fix this by myself or is this something I have to take it in for? I've repeatedly restored it wit

  • Consolidated Customer Invoice

    Hi Dina, My client's requirement is to generate AR invoices such that all projects belonging to one customer be grouped as a single consolidated invoice with lines representing each project and its corresponding amount. We are on 11.5.10.2. I have th

  • Report Designer black background

    Hello, I have issue with report designer. When I open a report designer,  and insert a BI query into report designer all cells are comming with black background. When I click on each cell I'm able to see the content. I have installed the latest sapgu

  • I can't download any music from itunes, says there is not enough memory to support the download

    I can not download any music from itunes, little box pops up and says there is not enough memeory to download?