JNDI, users & Threads

We are getting a random application Error,
javax.naming.NoPermissionException: User <anonymous> does not have permission
on ... to perform lookup operation.
Again, this happens very rarely. I was going through the WL Documentation about
JNDI users and threads
http://e-docs.bea.com/wls/docs81/jndi/jndi.html#478033
The documentation talks about "threads" - are they talking about the WL Execute
threads? We are not closing any of the JNDI contexts in our application, could
this potentially result in context users being used incorrectly?
Thanks, Krish

http://e-docs.bea.com/wls/docs81/jndi/jndi.html#478033
The documentation talks about "threads" - are they
talking about the WL Execute
threads? We are not closing any of the JNDI contexts
in our application, could
this potentially result in context users being used
incorrectly?Its talking about client threads. If you have a swing app you have different threads and you need to be careful about correct association between the user and the thread.

Similar Messages

  • JMS adapter : Where is JNDI user administered ?

    Hi all, we are testing a JMS adapter in a PI7.1 (no eHp).
    The JMS adapter needs a JNDI user and
    password for JNDI lookups by remote clients.
    I'm puzzled about the administration of this JNDI user.
    My question :
    can this user-ID be just any userID in the system ?
    or is it a user ID that is indicated in the Visual Admin ? if so, where ?
    if it can be any user, what rights does it need for a JNDI lookup ?
    Or (shudder...) should I really start editing XML property files ??
    Regards,
    Ronald van Aalst
    TNT Post

    Hello,
    You can see the explanation per sap note below:
    #856346 - J2EE JMS Adapter: Frequently Asked Questions (FAQ)
    2.6) I am connecting to a JMS provider using JNDI mode. How do I add pass an extra name,value property pair while setting up the JNDI initial context?
    Answer: Assuming that your property value is a string, please add the following name, value pair in "JMS Additional properties" table of your channel configuration:
    JNDI.InitialContext.property.X=java.lang.String propertyName,
    java.lang.String propertyValue
    where X is a number, the LHS part needs to be put in the name column and the RHS part in the value column of the table respectively.
    BR,
    Franklin

  • User threads in OC4J 10.1.2

    I have a servlet running in an OC4J container that kicks off a daemon thread. It looks like the thread ends when the OC4J instance is restarted...
    Can anyone confirm this?
    Also, does adding the -userThreads switch to the OC4J startup offer any advantage other than allowing user Threads to access the OC4J context?

    ... just in case you don't get an answer on this forum. There is a J2EE forum and Oracle Application Server forum which might be the better source to ask this question.
    Frank

  • Creating AppModule in a background user thread (NPE)

    Hello!
    The application uses a user thread (OC4J is running with -userThreads option) which used for perform some background tasks.
    We want the thread creates an application module, fires some methods, releases the module and exit.
    So, we have a code fragment like this in run() method:
    service =
    (AppModule)Configuration.createRootApplicationModule(SERVICE, SERVICE_CONFIG, null);
    service.doSomething();
    Ihe following error is occurring:
    06/12/12 20:44:06 java.lang.NullPointerException
    06/12/12 20:44:06      at com.evermind.server.http.EvermindHttpServletRequest.unprivileged_getSession(EvermindHttpServletRequest.java:2609)
    06/12/12 20:44:06      at com.evermind.server.http.EvermindHttpServletRequest.getSession(EvermindHttpServletRequest.java:2592)
    06/12/12 20:44:06      at oracle.jbo.http.HttpSessionCookieHelperImpl.generateSessionId(HttpSessionCookieHelperImpl.java:175)
    06/12/12 20:44:06      at oracle.jbo.http.HttpSessionCookieFactory.createSessionCookie(HttpSessionCookieFactory.java:113)
    06/12/12 20:44:06      at oracle.jbo.common.ampool.ApplicationPoolImpl.createSessionCookie(ApplicationPoolImpl.java:452)
    06/12/12 20:44:06      at oracle.jbo.client.Configuration.getApplicationModule(Configuration.java:1540)
    06/12/12 20:44:06      at oracle.jbo.client.Configuration.createRootApplicationModule(Configuration.java:1504)
    06/12/12 20:44:06      at ut.ThreadWorker.run(ThreadWorker.java:48)
    06/12/12 20:44:06      at java.lang.Thread.run(Thread.java:595)
    Please, anybody have access to sources, what you can say about this trace or do you have another ideas how to launch module from user thread?
    Thanks in advance!
    Ilya.

    Repost.
    Now I am trying to solve this issue by investigating, why module is running without errors if launched from console. In this case ApplicationPoolImpl.createSessionCookie is also fired, but don't try to obtain HttpSession from web container. When module is launched from background thread the pool ans session factory trying to do it (and error in EvermindHttpServletRequest.java occurs because there is no any requests).
    Ilya.

  • Javax.security.auth.login.LoginException : unable to locate JNDI user provi

    i'm facing a problem regarding the jndiloginmodule.
    even before connecting to the ldap server it says unable to locate jndi user provider. i have given the user.provider.url and also group.provider.url in the config file, but the (map)options is not recogonizing it.
    sample {
    com.sun.security.auth.module.JndiLoginModule required
    user.provider.url = "ldap://localhost:389/cn=Manager,o=stooges"
    group.provider.url = "ldap://localhost/cn=Manager,o=stooges" debug=true;
    this is the config file
    userProvider = (String)options.get(USER_PROVIDER);
         groupProvider = (String)options.get(GROUP_PROVIDER);
    these are the lines that should retrieve the userProvider, and the groupProvider but they are not. they are receiving null.
    can any please help me.
    thanx in advance
    shan

    i found what the problem was,
    in JndiLoginModule.java
    there is no need to declare a variable USER_PROVIDER and provide it as an argument to (map) options for getting the user.provider.url.
    just replace USER_PROVIDER with "user.provider.url" and same with group provider also.
    thats it.
    thanx

  • User Threads for concurrent processing

    Is it adviasble to create threads inside Session beans. I want to query 2 different
    database/dataservers concurrently. These are huge quries. I have heard that creating
    user threads are not advisable and against J2EE. What are other ways of doing
    concurrent processing in EJB.

    Rajesh wrote:
    Rob,
    We need to build a session bean which would basically query 2 different
    data base. This seesion bean then collects the result from these queries to come
    back so that we can post it on the web.
    We can use JMS and callback interface but the problem here is these queries
    bring back large data. With JMS we would be basically using double the memory.
    One for storing data in the JMS and then in the session bean. With threads we
    can make these threads write to the same memory/datastructure. You don't need to store the data in JMS. Just use JMS to do the async
    work and the notification when the work is done. Your code that picks
    up the response/data can still consult your datastructure.
    -- Rob
    >
    >
    >
    Rob Woollen <[email protected]> wrote:
    Right, it's generally not recommended that you create threads.
    What are your desired semantics? JMS is a nice way to do asynchronous
    work.
    Should the session bean wait for the queries to return, or is there some
    callback interface?
    -- Rob
    hsejar wrote:
    Is it adviasble to create threads inside Session beans. I want to query2 different
    database/dataservers concurrently. These are huge quries. I have heardthat creating
    user threads are not advisable and against J2EE. What are other waysof doing
    concurrent processing in EJB.

  • Risk, if any, of closing ServletOutputStream using a user thread?

    Hello All,
    What is the risk of writing/flushing/closing ServletOutputStream using a user thread other than the HTTP thread associated with the request?
    I want to do that to implement client request timeouts. Currently in our application, for every request received we are creating a new thread to make the HTTP thread timeout after a configurable amount of time is elapsed. Though creating a new thread is doing the job just fine but that approach is creating another problem that the servers are not scaling to the load we receive. We frequently get "unable to create threads due to unavailable memory" errors. At any point in time, any of our servers receive ~200 requests, which means that server has to create/handle 400+ threads. If the servers are slow due to external systems, then a lot more threads will be accumulated in the server. When the thread count reaches 500+ it fails to accept any further requests. So as a possible alternative to current approach, I am thinking of running few threads (may be a couple of threads) in the background and timeout the requests by closing the associated ServletOutputStream with TimeoutException.
    Note: I know that as another possible solution, I can go for few more servers in the cluster but before that I want to check if the above approach is a possible solution because it is less complex and saves money on the hardware.
    Thanks,
    Srinivas

    Hello Kaj,
    Sorry for the cross-post. Actually, I couldn't decide if I should post it as a concurrency, Java Servlet or as a design question.
    Maxideon,
    Sure, it can be done with single thread also. I said a couple of threads because a single thread may not get sufficient CPU time to handle all timeouts. But otherwise yes, we can try it with single thread also.
    ejp,
    We do not own the client application. We are a web services application and there are many clients who consume our services.
    The standard solution to handle timeouts in the server is by creating an additional thread, which is what we have followed. Now, that design is posing a new problem to us.
    No. A custom TimeoutException.
    I want to use 2 or 3 user threads to timeout the request if needed. That way I do not have to create 1 thread for each request. In the current approach server creates/handles 400 threads for 200 requests. With the alternative solution I can make it to create/handle 202 or 203 threads for 200 requests.
    dubwai,
    Here I am answering to your reply to my same question in the other forum.
    The current design is working just fine for timeouts. But sometimes it is failing to scale to the load we receive. In the current design we have created 1 thread for each request to timeout HTTP thread, which means that for 200 requests we will have 400 threads (200 HTTP threads and 200 user threads) in the server. For some reason, if the load increases to 250 requests or if external systems are slow then more threads accumulate in the server and it fails to accept incoming requests when thread count reaches ~500. That is the problem we are having.
    In the alternative design I proposed that we will create just a couple (may be 2 or 3) of threads running in the background, instead of 1 thread for each request. These background threads monitor HTTP threads and timeout the request if needed by writing and closing ServlerOutputStream. This way server will have to create/handle only ~200 HTTP threads plus a couple of user threads. For this approach to work I have to close ServletOutputStream using background threads instead of HTTP thread and want to know what is the rick of doing that?
    To All,
    Here is a rough implementation of user thread. The HTTP thread registers itself in threadMap variable with its starttime and in threadResponse variable with its associated HttpServletResponse. This user thread uses these values to find request timeout (10 seconds) and close response if needed.
    public class TimeoutMonitor implements Runnable {
        public static Map<Thread, Long> threadMap = new HashMap<Thread, Long>();
        public static Map<Thread, HttpServletResponse> threadResponse =
            new HashMap<Thread, HttpServletResponse>();
         @Override
         public void run() {
             while(true) {
              try {
                  wait(1000);
                  Set<Thread> keys = threadMap.keySet();
                  Iterator<Thread> threads = keys.iterator();
                  while(threads.hasNext()) {
                      Thread thread = threads.next();
                      Long startTime = threadMap.get(thread);
                   if((System.currentTimeMillis() - startTime) > 10000) {
                       HttpServletResponse response =
                                    threadResponse.get(thread);
                       try {
                        PrintWriter writer = response.getWriter();
                        writer.write("Timeout Exception");
                        writer.flush();
                        writer.close();
                        threadMap.remove(thread);
                        threadResponse.remove(thread);
                       } catch (IOException e) {
                        e.printStackTrace();
              } catch (InterruptedException e1) {
                  // TODO Auto-generated catch block
                  e1.printStackTrace();
        }I have test run this program in tomcat and seem to be working fine. Please note that here response/writer are closed by user thread and not HTTP thread. My questions is, do you see any problem in doing that?
    Thanks,
    Srinivas

  • User threads can't access server context?

    Hi,
    I have centralized-file called Jndi that
    is used to access/lookup local interface for my bean.
    It seems to work fine on Jboss,
    but when I switched to OC4J it gave me this message:
    javax.naming.NamingException: Not in an application scope - start Orion with the -userThreads switch if using user-created threads
    I've already put this in Project Setting->Runner:
    -Doc4j.userThreads=true for the VM Option,
    But still didn't work.
    Any comment/suggestion?
    Thx.A.lot
    Sorry to bother you all
    ~Irfan

    Hi
    You should call:
    java -jar oc4j.jar -userThreads

  • User Thread from OC4J

    Hi,
    I am trying to start a new thread from within my web application.
    but every time it gives me an error -
    javax.naming.NamingException - Not in application scope - start OC4J with the -userThreads switch if using user created threads.
    Can anyone suggest what changes in the server setting do i need to make to the Oracle application server ? I am using 10g version.

    Hi,
    use Enterprise Manager to get to the application server, select your OC4J container, select administration, go to server attributes and put the switch -userThreads to the OC4J options. Restart the container.
    That should do it.
    Timo

  • Oracle Weblogic 12c F5 - Clear User Thread

    One user log into our financial system and entered a function to enter data. Did not logout, went to machine B and then log in and performed same function.
    I can see in the logs what happened, the first thread is on server01 and then on machine b she gets thread on server05.
    Unable to save on server05, so how would I clear her threads on the server....
    Thanks

    I am having the exact same issue with Weblogic 12c on Windows Server 2003 SP1 on Intel Itanium processor with Java SE 1.6u29 and JDeveloper 11.1.2.1.0.
    Please advise!
    Thanks in advance.
    P.S.
    Unfortunately, problem also confirmed on Windows 7 64bit and JRockit-jdk1.6.0_29-R28.2.0-4.1.0 and JDeveloper 11.1.2.1.0.
    LOG
    WARNING: Failed to save farm keystore. Reason {0}
    Dec 12, 2011 10:51:29 PM oracle.security.jps.internal.keystore.file.FileKeyStore
    Manager createKeyStore
    WARNING: Failed to save farm keystore. Reason {0}
    oracle.security.jps.service.keystore.KeyStoreServiceException: JPS-06513: Failed to save farm keystore. Reason at oracle.security.jps.internal.keystore.file.FileKeyStoreManager.create KeyStore(FileKeyStoreManager.java:309)
    Edited by: rade.radenkovic on Dec 12, 2011 1:53 PM

  • What the result while a user thread holding pidlock to sleep?

    I know pidlock is used to protect process create/exit/swap and so on. When a user kernel thread sleeps holding pidlock, the dispatcher doesn't work or system will hang? So what the real function of pidlock?
    Thanks?

    Hi, can't be sure out here, but it sounds that perhaps there may have been a hidden folder behind those other ones? Did you drag select?
    If it isn't that then perhaps som Disk/OS maintenance is in order.

  • Are those Oracle threads "user threads" or "kernel threads"?

    Hi,
    As you know Oracle's architecture under windows OS is different from Unix/Linux and there is only one process (oracle.exe) and DBWr,LGWr and other pieces of instance implemented by threads whitin that process.
    I want to know if these threads are user mode threads or kernel mode threads?
    -Thanks

    varun81 wrote:
    OK you have said don't even think of updating these tables directly... May i know why are you saying that.Among other reasons, Oracle disallows updates to the data dictionary and you render your database unsupported as soon as you try. Plus, a lot of what needs to be updated are memory structures that Oracle happens to expose read-only views of. And the set of objects that are affected will potentially change across releases/ patches/ etc.
    Beyond that, what possible reason could you have for wanting to update dozens of objects to add a user? The CREATE USER statement is a far better interface for your application.
    Justin

  • JNDI  user name and password

    Case 1, for a NON-JNDI based database connection:
    Connection conn = DriverManager.getConnection(url, "username", "password");
    Case 2, for a JNDI based database connection:
    Context context = new InitialContext();
    DataSource dataSource = (DataSource) context.lookup("java:comp/env/jdbc/test");
    Connection conn = dataSource.getConnection();
    Notice that for NON-JNDI based database connection, the username and password are specified. But for the
    JNDI based database connection, there is no username and password specified. How come? If I want to specify the username and password for JNDI based connection, how can I do it?
    Thanks
    Scott

    scottjsn wrote:
    Though your example shows using a jndi file, you user name is actually hard coded.There's no such thing as a "jndi file". The username is not hard coded because that's not code, it's a configuration file.
    I believe my original question is how to use JNDI with the user name and password.The username and password are always the same. You have one set of those for the database, for all the users in your application. The only situation where that might differ is for example a testing server or development server having a different username and password.
    They would have their own configuration files then.
    The user name and password can be dynamically retireved and set for each authorized user on the fly.Authorization is a different beast. This (your code) is about getting database connections through a DataSource object.

  • How to terminate/destroy a user thread running in background?

    Hi All!
    I m using t.destroy() to stop a background running thread, as t.stop() is depricated in Java 2. I implement Runnable in the background thread. On calling t.destroy() NoSuchMethodException; don't know whats the problem there?

    I still don't see any solutions to the issues with performing a Runtime.exec, or stopping a thread from the outside.
    Here's my situation - I have need to make a framework that processes "work" asynchronously. Work is an abstract concept that is realized (an interface is implemented) by other classes. Work comes into the system and is persisted. A seperate mechanism gets the work and processes the work when possible.
    Processing "work" is an abstract concept that is realized (interface is implemented) by other classes.
    All the threading/asynchronous behavoir is in the framework.
    Thus I can't control how work processing occurs within the framework. At certain points I do have to be able to interrupt the work from the outside. Thus the framework threads are busy doing "work" (defined in a class not "known" to the framework) - but the framework has to shutdown.
    So I'm left with thread.stop
    Yes - the framework threads are designed around a volitile "continueProcessing" flag.
    Yes - some of the tasks can perform their work in piecemeal and use this flag.
    No - not all the work can be done in a piecemeal way.
    This whole framework is a solution to situations where multiple high-CPU, high-memory, asynchronous tasks get flooded into the app-server (we don't control the clients - they are outside this business).
    So we persist the request, and have a framework polling for more work. That way even if 10000 requests hit us as the same time (it has happened); we don't get floored.
    We tried sevlet and JMS processing, but those both have back-log limitations. We could poll for work, then send the request to a seperate JMS queue that terminates in a MDB but this exposes an entry point into work processing. And the whole point of this is to control the amount of processing occurring at any given time, without losing any of the requests.

  • User threads and local entity beans

    I have started a background thread to handle transferring large files via ftp. This thread needs to be able to access the entity beans via a local interface (to log its progress). I have started oc4j with -userThreads (debugger -Doc4j.userThreads=true) and I get the NameNotFoundException when trying to find the beans via a local home interface.
    The code looks like this:
    <code>
    InitialContext context = new InitialContext();
    JobLocalHome home = (JobLocalHome)context.lookup(JOB);
    JobLocal job = home.findByPrimaryKey("java:comp/env/ejb/JobLocal");
    </code>
    This code works perfectly when called from the context of another bean, but not from the background thread. Can background threads use local interfaces? Or do I have to have remote interfaces on these beans just to allow the background thread to operate?

    Hi - Resolved this one
    The Target for the compiler was set wrong in Jdeveloper!!!
    Set to "default" resolved this
    Tks

Maybe you are looking for

  • Is it possible to install an OCZ 60gig sata3 ssd in my late 2006 macbook?

    Hi, im a novice mac user and I just picked up a late 2006 macbook off ebay and I couldn't help but wonder if there is some way to remove the 120gig 5400rpm sata2 drive it came with for a nice modern OCZ vertex III 60gig sata3 SSD WITHOUT rendering th

  • Windows 8 compatibility list

    I am involved in a modernisation project at an academic intitute, we are on the verge of getting site licenses for  Multisim, Labview and also Elvis II hardware complete with the FPGA boards for our digital electronics courses. However we have hit a

  • Webdynpro DC not found when referencing in visual composer

    Hi guys, I am following the Investment Approval Process tutorial and webminars available on SDN. I have created a BPM and setting some technical configuration into my application by referencing webdynpro UI DC to each BPM step, as it is shown in Inve

  • Remove language from 'set language' portlet

    Hello We installed 4 languages with our portal. In one page group I did the translation for 3 of the 4 languages. Now, if I add the 'set language' portlet to one of the portal pages of that page group, all the 4 languages (not only the 3 of the trans

  • Problem with Beekeeper

    I am with a problem with Beekeeper. I access the address http://myserver:7778/bkpr and when I try to make login the page return a error. I verified the logs and return me this: [2011-07-27T13:50:58.667-03:00] [ocs] [ERROR] [] [web.admin.ctrl.common.E