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

Similar Messages

  • 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.

  • Call an applications 'user exit' from a PL/SQL procedure

    My question is a technical PL/SQL question related to Oracle Applications. I need to call a standard applications 'user exit' from a stored PL/SQL procedure. Can anyone tell me if this is possible and how to do it?
    (i.e. I am attempting to call the AR user exit SALESTAX)
    Thanks,
    Michelle Dodge

    Hi,
    Read this thread, perhaps is there your response :
    Host...
    Nicolas.

  • Problem with servlet after migrating from OC4J to WebLogic 10.3

    I come across a problem when I was migrating from jDev 11g TP4 to production version in that step also server got changed from OC4J to webLogic.
    I am running java http servlet along other jspx pages. When everything was on OC4J there was no problem whit security on this servlet ( servlet was under same authorization automatically, and I was able to create new application module on this servlet by createRootApplicationModule
    ) but when I changed to WebLogic 10.3 I come across a numerous problems. First one is solved i managed to put the servlet under same authorization as jspx pages by
    *<servlet>*
    *<servlet-name>report</servlet-name>*
    *<servlet-class>path.to.class</servlet-class>*
    *<security-role-ref>*
    *<role-name>name</role-name>*
    *<role-link>valid-users</role-link>*
    *</security-role-ref>*
    *</servlet>*
    but when I trying to create new application module I get JBO-30003 error which is Caused by:
    oracle.adf.share.security.ADFSecurityAuthenticationException: JAAS login error.
    Invalid null input: name
    Has anybody any idea what I am doing wrong?
    Thank you for your help, Rok Kogovšek

    for example:
    web.xml
    <security-role>
    <role-name>yourrole</role-name>
    </security-role>
    weblogic.xml
    <security-role-assignment>
    <role-name>yourrole</role-name>
    <principal-name>wlsuser</principal-name > <!-- wlsuser is define at wls console-->
    </security-role-assignment>

  • How to terminate a java thread from c++ code?

    Hi,
    I made a screensaver which loads a jvm, forks a thread running a java class, wait until user's action(i.e. mouse move/click keyboard input), then terminate the java thread.
    However, I met a problem, How to terminate a running java thread from c++ code?
    Here is my code, but it does not work: (even after the terminate is called, jvm throws an error)
    JNIEnv* env;
    JavaVM* jvm;
    HANDLE hThread; //handle for the startThread
    unsigned __stdcall startThread(void *arg)
         jclass cls;
         jmethodID mainId;
         jint          res;
         int threadNum = (int)arg;
         res = jvm->AttachCurrentThread((void**)&env, NULL);
    cls = env->FindClass( MAIN_CLASS);
         mainId = env->GetStaticMethodID(cls, "main", "([Ljava/lang/String;)V");
         // setup the parameters to pass to main()
         jstring str;
         jobjectArray args;
         int i=0;
         args = env->NewObjectArray(1, env->FindClass("java/lang/String"), 0); //only one input parameters
         str = env->NewStringUTF("localhost");
         env->SetObjectArrayElement(args, 0, str);
         env->CallStaticVoidMethod(cls, mainId, args); // call main()      
         if (env->ExceptionOccurred()) {
                   env->ExceptionDescribe();
         return TRUE;
    Here is the main method:
    First create the jvm and load the thread. then tries to terminate the thread, but failed here
    switch (msg)
    { case WM_CREATE:
              JavaVMOption options[NUMBEROFOPTIONS];
              JavaVMInitArgs vmargs;     
              jint rc;
              vmargs.version = JNI_VERSION_1_4; /* version 1.4 */
              vmargs.options = options;
              vmargs.nOptions = NUMBEROFOPTIONS;
              vmargs.ignoreUnrecognized = JNI_FALSE;          
              rc=JNI_CreateJavaVM( &jvm, (void **)&env, &vmargs ); /* create JVM */
              /* We pass the thread number as the argument to the invoked thread */
              unsigned int threadId = -1;
              // to initialize a thread-safe C runtime library
              hThread = (HANDLE)_beginthreadex(NULL, 0, &startThread, NULL, 0, &threadId );
    } break;
    case (WM_DESTROY):
              CloseHandle( hThread );
              jvm->DestroyJavaVM(); /* kill JVM */
              Debug("Destroy Java Virtual Machine\n");
    }break;
    Note, after the thread "startThread" runs, it has an infinite loop and will not terminate, until the user clicks to terminate.(I didn't call jvm->DetachCurrentThread();_endthreadex(0); in the "startThread" because the java thread will not terminate by itself)
    Thus, the only way to terminate the thread is to call closehandle(hthread) in the main thread, which may cause jvm to throw an error.
    Do you know how to terminate a java thread safely???
    Thanks a lot

    Assuming that your java thread is in a loop of some kind. Such as
    int i=1; /* I tried using a boolean, I just could not get my C++ env, to change this value. So i decided to use an int */
    run {
    while(i)
    isdfjsdfj
    void seti()
    i=0
    So, B/4, i call destroyVM in my C++ code, i call this seti(). so the loop terminates, therefore my thread finishes executing and ends.
    Hope this helps
    tola.

  • Help with migrating user data from one account to another

    I am on a G5 with 10.4.11. I installed FCP studio 6 and everything works fine except compressor. I have had only one user account on this mac (i will call it account 1). I was told to create another account (account 2), log on and see if compressor works. It does. Basically there are files missing on account 1 and compressor won't run. I have installed 3 times and no change.
    Anyway I was told to migrate all my user data from account 1 to account 2. I have been looking at threads and want to make sure I am doing the right thing. I found a way to close. Please see if this works. IT may be from the tiger forum:
    pick a short user name for your new account. then run the following terminal commands
    sudo mkdir /users/newshortname
    sudo ditto ~ /users/newshortname
    You'll have to enter your admin password (which you won't see) after the first command. that's normal. This will copy your current home directory to /users/newshortname. Then go to system preferences->accounts and create a new account with the short name newshortname. You'll get a popup saying that a home directory by that name already exists and asking if you want to use it. say yes.
    Anyway, I would like to migrate everything from account 1 to 2 and have all preferences...everything. I would also like to be able to delete the old account...account 1 and rename account 2. Since this is a home MAC, I really don't need it PW protected. I would like this MAC to just use my new account 2 at start up.
    Please ask me any questions. This is my editing MAC, and I can't get around inside the OS. I know FCP like the back of my hand, but don't want to screw up this computer.
    Thanks in advance.
    Message was edited by: Nelson May

    Yeah, you should be able to move most of it by changing permissions.
    Network settings could be any/all of these though for instance...
    /Users/YourUserName/Library/Preferences/ByHost/com.apple.networkConnect.<12 digit number>.plist
    /Users/YourUserName/Library/Preferences/com.apple.internetconnect.plist
    /Library/Preferences/SystemConfiguration/preferences.plist
    /Users/YourUserName/Library/Preferences/com.apple.systempreferences.plist
    /Library/Preferences/SystemConfiguration/com.apple.airport.preferences.plist
    /Library/Preferences/com.apple.sharing.firewall.plist
    /Library/Preferences/SystemConfiguration/NetworkInterfaces.plist
    /Library/Preferences/com.apple.networkConfig.plist
    /Library/Preferences/SystemConfiguration/com.apple.nat.plist
    /Library/Preferences/com.apple.print.FaxPrefs.plist
    As well as the old Keychain & cookies from your Browser.

  • Jms upgrade from oc4j 10.1.2.2 to 10.1.3

    hello,
    I have recently upgraded from oc4j 10.1.2 to 10.1.3 - and everything works ok within my apps apart from JMS messaging.
    I have 2 apps within the same oc4j container, the first produces topic messages
    ObjectMessage message = session.createObjectMessage(obj);
    The second receives the messages - by implementing the MessageListener onMessage interface.
    Everything worked perfectly under oc4j 10.1.2 but although I find no errors under 10.1.3 - the receiver never gets the message.
    Can you help direct me how to debug this? - or provide probable areas of investigation?
    thank you

    Thanks Rocky. It was your thorough discussion that prompted me to look at my TopLink sessions.xml configuration more closely, since my existing config did not utilize the transport class you mentioned. As it turns out, I was utilizing the depricated cache coordination mechanism (<cache-synchronization-manager> instead of <remote-command>). With a new configuration as follows, everything is working well:
    <remote-command>
    <commands>
    <cache-sync>true</cache-sync>
    </commands>
    <transport xsi:type="jms-topic-transport">
    <topic-host-url>ormi://localhost:23791/ems</topic-host-url>
    <topic-connection-factory-name>jms/Topic/ToplinkCacheSyncConnectionFactory</topic-connection-factory-name>
    <topic-name>jms/Topic/ToplinkCacheSync</topic-name>
    <jndi-naming-service>
    <user-name>oc4jadmin</user-name>
    <password>oc4j</password>
    <initial-context-factory-name>com.evermind.server.rmi.RMIInitialContextFactory</initial-context-factory-name>
    </jndi-naming-service>
    </transport>
    </remote-command>
    Thanks for your contribution,
    --Todd                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Create Oracle USER Account from Third Party System

    Hi there
    We have requirment to create Oracle USER Account through third party system.
    How can we achive this?
    I know ORacle Provide FND_USER_PKG.CREATEUSER API to create user
    Is there any special thing we have to do to create Oracle USER from another system?
    Thanks
    ASIM

    Hi,
    Is there any special thing we have to do to create Oracle USER from another system?I believe you need to check the third party manual or contact the vendor for other considerations when creating user accounts from this system.
    For FND_USER_PKG, please see the links referenced in this thread.
    change password of EBS user
    Re: change password of EBS user
    Regards,
    Hussein

  • FlexibleUI - UICommands with Path KM and User KM from the context.

    I need to write one new Java Portal Class, for new KM Command. This command should do the following action:
    - get context information of KMC (specifically portal user and KM path)
    - call URL with this data. (Example: http://domain:port/service?userkm=valueuserkm&pathkm=valuepathkm )
    I have modify example of FlexibleUI - UICommands, and create a new class that call a URL, but can't find the class and method for get context and catch the user and path of KM user.
    this is the code for the class of UICommands:
    package com.sap.example.flexible.ui.command;
    import java.util.List;
    import com.sapportals.wcm.WcmException;
    import com.sapportals.wcm.rendering.base.IRenderingEvent;
    import com.sapportals.wcm.rendering.base.IScreenflowData;
    import com.sapportals.wcm.rendering.uicommand.AbstractCommand;
    import com.sapportals.wcm.rendering.uicommand.ICommand;
    import com.sapportals.wcm.rendering.uicommand.LinkAttributes;
    import com.sapportals.wcm.repository.IResourceContext;
    import com.sapportals.wcm.repository.IResource;
    * Copyright (c) 2005 by SAP AG. All Rights Reserved.
    * SAP, mySAP, mySAP.com and other SAP products and
    * services mentioned herein as well as their respective
    * logos are trademarks or registered trademarks of
    * SAP AG in Germany and in several other countries all
    * over the world. MarketSet and Enterprise Buyer are
    * jointly owned trademarks of SAP AG and Commerce One.
    * All other product and service names mentioned are
    * trademarks of their respective companies.
    * This class is a sample implementation for a
    * UICommand using external eventing.
    * @author Thilo Brandt, SAP AG
    * @version 1.0
    public class SimpleExternalCommand extends AbstractCommand {
         protected String getLabel() {
            return "myButtonLabelDURO";
                protected String getTooltip() {
                        return " myButtonTooltipDURO";
         public SimpleExternalCommand() {
              //super("SimpleExternalCommand", "SimpleExternalCommand");
              super("myButtonTextKey", "myTooltipTextKey");
         public ICommand getNewInstance() {
              return this.initNewInstance(new SimpleExternalCommand());
         public IRenderingEvent execute(IScreenflowData arg0) throws WcmException {
              return null;
         public String[] getTargetParameters() throws WcmException {
              return new String[0];
         //public void setTargetParameters(List arg0, IResourceContext arg1)
         public void setTargetParameters(List list, IResourceContext context)
              throws WcmException {
         public boolean isExecutable() {
              return true;
         public boolean raisesEvent() {
              return false;
    // Inicio de Modificación de Código para uso de Parámetros
            public LinkAttributes getLinkAttributes() {
              String Target = "_blank";
              String lURL1  = "http://www.google.com/search?hl=es&q=";
              String lURL2  = "PARAMETRO";
              String lURL3  = "&lr=";
    // Get User KM from context
    // lURL2 = UserKM;
    // Get path KM from context
            String lURL   = lURL1 + lURL2 + lURL3;
              return new LinkAttributes(lURL, Target);
    please helpme to get userKM and pathKM.
    thank in advance.
    Junior.

    Hi,
    To get the KM Path:
    String path = getResource().getRID().getPath();
    To get the present User:
    IPortalComponentRequest pcr =
                    (IPortalComponentRequest) getProxy().getDynamicPage().getPageContext().getRequest();
    pcr.getUser();
    To create URL call with datas when UICommand is clicked. You should modify your getLinkAttributes method.
    Check this for an example:
    https://forums.sdn.sap.com/thread.jspa?threadID=334529
    Greetings,
    Praveen Gudapati
    [Points are always welcome for helpful answers]

  • Starting new threads from a servlet

    Hi
    I read somewhere that starting new threads from a servlet is not supported in the future releases of J2EE .
    Any one aware of this.
    I have a listener program started as a new thread from the init method of a servlet which is set to load on startup.
    I have to think about another way to do this if this is not suppported in the future releases
    any comments

    Dr clap
    Actually I was getting some warning messages in my websphere server console when I tried to make JDBC connections from the thread I opened in the servlet.
    Everthing works fine but with the warning messages,
    Then someone from IBM answered me in one of the forums quote
    Cause: These messages are being produced due to an
    "unsupported" environment. When application is
    spinning its own threads from an EJB, spinning a
    thread and accessing a database is not supported (per
    the J2EE specification). One exception to this rule is
    if a Servlet is spinning its own threads and accessing
    a database. The J2EE specification is not clear on
    this, so WebSphere Application Server 5.0 must allow
    for it at this time. IBM is working with Sun to
    clarify this in the specification, so eventually (i.e.
    J2EE 1.4) spun threads from a Servlet accessing a
    database outside of a transaction will not be
    supported either.
    Since we don't want to promote the usage of these
    "naked" threads accessing databases, we are producing
    the warning messages. Although they may be filling up
    the logs, we feel that these are necessary to warn the
    user that they are doing something not in-line with
    the intended usage. Customer should consider changing
    their application to comply with the
    J2EE specification.
    """

  • Obtaining SAP User information from J2EE Application

    Hi All,
    I am using SAP NetWeaver Developer Studio to create a J2EE Application, which requires accessing user information from SAP coming from Windows Active Directory.
    My question is as follows;
    Is there a possibility in a J2EE application to use an API to obtain user information (ie. from com.sap.security.api.jar) just like in a regular WebDyn Pro Application?
    For Archive Build Info (compile time), do I need to import specific JARs? For runtime, do I need to load any project reference?
    Thanks in advance,
    Michael

    Yes, I have added 'Run time' as well as 'Build time' for the com.sap.security.api.sda DC as well as for com.sap.tc.Logging DC.
    I have also added the following references to application-j2ee-engine.xml file:
    <application-j2ee-engine>
         <reference
              reference-type="hard">
              <reference-target
                   provider-name="sap.com"
                   target-type="library">com.sap.security.api.sda</reference-target>
         </reference>
         <reference
              reference-type="hard">
              <reference-target
                   provider-name="sap.com"
                   target-type="library">com.sap.tc.Logging</reference-target>
         </reference>
         <provider-name>srl.com</provider-name>
         <fail-over-enable
              mode="disable"/>
    </application-j2ee-engine>
    I am still experiencing the same problem:
    java.lang.NoClassDefFoundError: com/sap/tc/logging/Location
         at com.sap.security.api.UMFactory.<clinit>(UMFactory.java:178)
         at srl.com.birthday.daemon.BirthdaysDaemon.loadEmployeesUser(BirthdaysDaemon.java:114)
         at srl.com.birthday.daemon.BirthdaysDaemon.run(BirthdaysDaemon.java:72)
         at java.lang.Thread.run(Thread.java:534)
    Is there any other JAR I forgot to add to my used DC? Is the security JAR dependant on something else?
    Thanks,
    Michael

  • Requesting help in extracting user comments from a forum ( HTML WEBSITE)

    hello experts,
    As i m new to java and i got this college project in hand which has to completed in few days i require some expert advise.
    Basically what my job is to extract all the user comments from a forum and make a text file.. for example this is one of the website http://www.gsmarena.com where user have posted many reviews and comments about mobile phones . ex : http://www.gsmarena.com/nokia_n97-reviews-2615p2.php .
    now looking at source code , all user comment are inside <P class="uopin"> tag under <DIV class="user-thread"> element.
    So i want to ask if there is any method in java that can extract all contents from class "uopin" directly ?
    i have no problem opening URL connection and reading the webpage but i m not able to extract that specific content . please enlighten me in this regard.
    Actually i m searching this forum since last 3 hours trying to find an answer and i found that i have to learn Regex , indexOf() subString() , HTMLEditorKit() etc.
    I ma planning to learn them in detail but as i have very less time ( 2 days to be specific) , i want help from you experts to solve this problem. plz guide me with some code snippets .
    Thankyou for your advises in advance :)

    ok.. sorry for asking that way.
    Here is my work till now....
    i wrote this code :
    import java.io.*;
    import java.io.Console;
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.net.URL;
    import java.util.regex.Matcher;
    import java.util.regex.Pattern;
    public class MyRobot3
         public static void main(String[] args) throws IOException
              BufferedReader in = new BufferedReader(new FileReader("MyRobot3.txt"));
              String inputLine , nextLine,kutta;
            FileOutputStream out; // declare a file output object
            PrintStream p; // declare a print stream object
              out = new FileOutputStream("myfile3.txt");
              p = new PrintStream( out );
                 while ((inputLine = in.readLine()) != null)
                             Pattern p1 = Pattern.compile("(<p\\sclass=\"uopin\">)(.*$)" );          
                        //     Pattern p1 = Pattern.compile("(<p\\sclass=\"uopin\">)(.*$\r\n.*$)" , Pattern.MULTILINE | Pattern.UNIX_LINES);    //not working
                        //Pattern p1 = Pattern.compile("(<p\\sclass=\"uopin\">)(.*\\s)" , Pattern.MULTILINE );
                             Matcher m1 = p1.matcher(inputLine);
                             boolean found = false;
                             while (m1.find())
                             p.println(m1.group(2));
    }I am testing with a little file MyRobot3.txt which contains
    <p class="uopin">Although they didn't announce any winner here. But to me the winner is <br/>
    N900. Then opera is in second position. (overall averare result)</p>And i am getting output in a file : myfile3.txt
    Although they didn't announce any winner here. But to me the winner is <br/>which is just the first line , but i need to match that line break also. i m not able to figure it out .please help me fixing this code so that it can match all the text and remove the <br> tag ..

  • Customizing a user logout from the desktop redirect to the anonymous user desktop

    I am trying to customize a user logout from the desktop redirect to the anonymous user desktop by coding as follwing:
    in menubar.html file. But this code could not work. Can anyone help me on this? Thank you.

    slec75,
    Check out this thread for some direction:
    http://www.adobeforums.com/webx/.3c05c6ec/1
    Shane

  • HT3529 How can I send a text thread from my iphone to my email?

    How can i send a text message thread from iphone to gmail?

    You can send a text message from your iPhone to Gmail by addressing the text to the email address.
    You can also Copy/Paste the a message from text to an email.
    See the iPhone User Guide for more info about copying and pasting.

Maybe you are looking for

  • How can I create multiple libraries on a windows 8 HP computer?

    I just got the newest generation Ipod Touch, and the itunes is not supported on my iMac G5. My parents have a Windows 8 HP computer. My dad's itunes account is on that computer. So what I want to do is use my external hardrive to sync it to my Window

  • Help with QT 360 Mov files.. (active X)

    I make 360 tours for realestate sites and now im getting this message that says "click to run an Acitive X control on this webpage" This pop up message is new. Is it a new security download from Microsoft? Please help on getting rid of this pop up me

  • Query Infoset not available in SQ01

    Hi all I have created an infoset in SQ02 and assigned it to a usergroup. If i look into the assigned Infosets in SQ03 or either from SQ02 itself, this infoset is being available in that assigned usergroup. But, when I go to SQ01 for creating a query

  • Portal content for STVN 2.1

    Hello! We have recently intalled Nakisa 2.1 on NW CE 7.1. Now we should import Portal Content in our Portal - accortding to Java Deployment Guide EPA file named com.nakisa.nakisa_portal_contents.epa is expected to be in folder PortalContent under ins

  • Do i need to reinstall windows again or when will gets release i will get as an upgrade?

    Hi all,  I am going to upgrade my windows 7 PC which is pre-installed by Lenovo to Windows 10 TP.But have some questions, when win10 gets release to the market in the near future will i able to upgrade it as i am going to do now by using windows upda