Passing Session to Other Java Application

Dear All,
We need to pass session of SAP BO to other java application.in short we need to make single sign on between these two without using third party authentication type.
by research , i could find out extension point API which supports to environment, through which it might be possible.
I need your help on this.
Environment:
SAP BO 4.1 Sp2
Any Help on this would be appreciated.
Best Regards,
Atulm

Hi all, i have one problem. I need to pass some
session to a java bean for processing.. Can i know are
there any possible ways of passing? thanks.if i understand you correctly, and you mean passing a session object
to a bean from a jsp page, do this:
have in your bean:
import javax.servlet.http.HttpSession;
private HttpSession session = null;
public void setSession (HttpSession sessionFromJsp) {
session = sessionFromJsp;
in your jsp:
beanname.setSession(session);
the variable named session is available is jsp pages,
it is an instance of the javax.servlet.http.HttpSession class,
and provides access to the client session information.
dave

Similar Messages

  • Spawning other Java applications

    I need to spawn other Java applications from a running Java app. The various applications should run independent of each other. I tried implementing this with threads, but the spawned threads are children of the first thread. If you exit the first app, all the threads are killed. I managed to get the calling app to wait for all the child threads to exit before it exists. The code I used looks something like this:
    try {
         //Find the specified class's constructor.
         Constructor[] cons = Class.forName(stClassname).getConstructors();
         //Instantiate the specified class.
         Object[] params = new Object[3];
         params[0] = this;
         params[1] = new Integer(characterEncoding);
         params[2] = sock;
         try {
              Thread thr = (Thread)cons[0].newInstance(params);
              thr.setContextClassLoader(Runtime.getRuntime().getClass().getClassLoader());
              r.start();
         catch (IllegalAccessException iaexc) {
              g.setMessage("Access to the specified class is denied.");
              turn -1;
         catch (InstantiationException instexc) {
              g.setMessage("The specified class object cannot be instantiated because it is an interface or is an abstract class.");
              return -1;
         } catch (InvocationTargetException invtgtexc) {
              msg.setMessage("An exception was thrown while instantiate the specified class.");
              return -1;
    } catch (ClassNotFoundException cnfexc) {
         msg.setMessage("The specified class is invalid. The class is not found.");
         return -1;
    In the preceding code I pass it the class�s name I want to instantiate. I would actually like to run another application, and not threads. How can I accomplish this in Java without having to use the Runtime.exec() method?

    You have to find a way to call System.exit() only when there is no more running applications.
    I would try this. Each of your applications should first register itself in some kind of app manager, and unregister itself when done. The app manager is a singleton. When the app manager is empty (no more running apps) it calls System.exit()
    class AppManager {
    //... code to make it a singleton
    public void register(Object myApp) {
    // add myApp to a List
    public void unregister(Object myApp) {
    // remove myApp from the List
    // if List is empty, call System.exit()
    In your application :
    // app starts here
    AppManager.getInstance().register(this);
    // ... application code
    // app ends here
    AppManager.getInstance().unregister(this);
    Hope this helps.
    JCG

  • How java application can access other java application

    Hi everyone,
    Please help me, I need to know how I can make my java program,
    specifically a servlet, access other java application continuously running a single instance in java virtual machine, and vice-versa.
    thanks in advance

    A java application is just a bunch of classes with one designated as a main class. You can simply ensure the classes are available to the server's jvm and then load and run the "external" program as part of the servlet process.
    If you have full access, and which external program is to be run, you can simply import it in your source.
    If your don't have the details at run time use the java.reflect.* stuff to load and run the class dynamically.

  • How to track session in Webdynpro Java application

    Hi All,
    How to get the session reference of any Webdynpro Java Application . My purpose is that thr is one WD application is getting launched , now if suppose user didn't perform any action on it and session for that application got expired . After the session got expired i have to update the table with the status . So to track that i need the session reference of WD application which i m looking for .
    How could i get the same . Kindly help me on this .
    Thanks & Regards,
    Mitul.

    Hi ,
    HttpSession session = request.getSession(false); //get the current session, if there is no session yet, return null
    if (session == null) //forward to first page
    else //do normal work
    Then u can update ur session right ,
    Regards ,
    Venkat

  • How to open JSP session from a java application or an applet?

    Hi,
    My problem is a bit challenging (at least for me) and its not about JSP but it is about a web application..
    I couldnt find a better place to post this question I am sorry if this is not the right place to post it..
    I need to enable users log into my website by checking username and password and reading and checking the data from a usb device located in client computer.
    I can read from the device thorough JNI using the third party DLL file for the device... I have no problem with that..
    Since I need to make native calls I am planning to develop a java application so I let the users open the application using web start.. Once my application is running on client side after reading the device and getting login password information (assuming login information correct), How can I open a web session for the that spesific user and a web browser and let the user browse the web site on his/her own session?
    I would appreciate any guidance..
    Thanks..

    add the values in the header using...
    response.addHeader("userNmae","XXXX");use it in all ur pages like say..
    if(!request.getHeader("userName")!=null && request.getParameter("userName").equlas(""))
    String username=request.getParameter("userName");
    }

  • Pass return code from Java application to a .bat file.

    I have a .bat file which will execute a Java application. I want to pass the return code from the java application to the ".bat" file.
    Could you please let me know, how can I accomplish this.

    I tried that, but it doesn't return the value...
    In my Java app, I had System.exit(returnCode) and in the '.bat' file
    I have
    @echo off
    java <myApp>
    set returnCd=%?%
    echo %returnCd
    and it didn't return any value. What should I specify in set returnCd=%?% instead of ?

  • How can i run Java class form  other java application.

    Hi ,
    I have problem to run java class from my java application,
    I am using the class ClassLoader in order to launched the Java class , it�s work fine whenever, the class exist in the same folder , however , when i am trying to run class that is not in the current folder ,
    i got error (see below),
    Do you have any idea what is wrong?
    java.lang.ClassNotFoundException
         at SimpleClassLoader.loadClass(SimpleClassLoader.java:110)
         at SimpleClassLoader.loadClass(SimpleClassLoader.java:53)
         at Run.main(Run.java:31)

    What does "run an class" mean? You don't run classes. They're not executables.
    I bet your problem is the classpath. You are aware that the classloader looks only there? Unless it's an UrlClassLoader.

  • Starting Java application from other Java application..

    Hi all,
    I was wondering if it is possible to start a Java program from an other Java program.
    In Java program 1, I have this code to execute the other application:
    try {
        Process p = Runtime.getRuntime().exec("cmd /c java -cp JavaApp2.jar com.test.TestFrame");
    } catch (IOException e) {
    }I tried this code, but unfortunately I couldn't opened the other (JavaApp2.jar) Java Application. Is there a way to open the other application anyways?
    I really hope someone can help me. Help would be greatly appreciated! Thanks in advance.
    Tongue78.

    What if there is no JAR file?Then you can make it out of the .class files. And to anticipate your next question, if there are no .class files there is no application at all, so you can't exec() it or call the main() method directly. Your point?
    And JAR isn't part of the Java language.It is a major part of the Java platform.
    This means you can only get access to a JAR file via the OS. Wrong again. CLASSPATH. URLClassLoader.
    In short you cannot just shout main() in a Java program and hope some other Java program will hear you and start.Absolute rubbish. If the required classes are on the CLASSPATH you just call com.company2.app2.main(args) and off you go. Or you can load the main class and invoke its main() reflectively.
    No source code required, or 'source code merge' either.

  • IFS1.1 and Other Java Applications

    We have a swiftly growing set of Java web-based applications
    that we use for project execution. We also want to use the IFS
    and incorporate the strengths of both into the user experience.
    The question:
    When we have a document in our custom app system and want to
    then pass it to IFS for storage and retrieval (and set all of
    the folder, category and attribute values, etc.), how do we
    interface with the IFS system?
    I assume there must be some way to pass the document to IFS and
    set all of that information.
    Can anyone help??

    You might want to look at the
    [url=http://otn.oracle.com/docs/products/ifs/doc_library/901/Deve
    loper%20Reference/Output/toc.htm]Developer Reference.
    The URL is:
    http://otn.oracle.com/docs/products/ifs/doc_library/901/Developer
    %20Reference/Output/toc.htm
    Regards,
    -rh

  • Java applications won't work

    On my iMac, Java applications won't work.  I tried opening minecraft, and several other Java applications.  All of them have a message that pops up saying, "Not compatible version of Java 1.5+ is available."  I tried updating it but their is no update for Java it says on my updater.  Running 10.6.8

    Dakota97 wrote:
    I tried openning it but it said it couldn't open because it requires java to run it.
    I don't understand that becuase 10.6.8 should already have Java installed.  It optional in 10.7.x.  It will be interesting to see if the java update even works under these conditions.

  • I want to run a java application once only.Pl help.

    i want to run a java application once only.
    i.e. if some application is running on Win NT OS then that
    particular appliaction again should not run,but other java application can run.
    Pl help with some sample code.
    Thanx.

    Hi,
    I if understood your question then your requirement is to run the application when the system is on.If this is the case then you can configure your OS schdular to do the job an let the OS do it.You can
    write the java code for this but that will require to run on the OS layer,so better to configure the schedular setting.....But then for some other requirement it cannot be useful....
    think...
    regards vicky

  • JCO-Java application unable to open a Frontend GUI session

    Hello,
    <P>
    I am having a problem opening a GUI session on a client PC through the JCo java call. It works on some PC's when I am logged in, but not on my PC. But other persons who login on my PC do not have a problem with the application opening a GUI session. I am at a loss. I have had a basis consultant look into this and he could not find a reason for the problem. I have submitted a customer message to SAP and am being told to file this issue in the forum, so here it is. If this is the wrong forum, please let me know which forum would be the correct one.
    </P>
    <P>
    Problem:</br>
    For test purposes, I have created a Java application using the SAP standalone SAPJCO3 vers. 3.0.1. The R/3 backend is 4.6C. The SAPGui version is 7.1 patch level 13 installed on a Windows XP Pro client PC. The application is supposed to start a Frontend GUI session as part of the initial process. This is not working on all PCu2019s for all users. The following are scenarios for two different users on two different PCu2019s, logged on and executing the Java application. The parameters for the Java application are: User, Password, and System Id in this order on the command line after the Java applicationu2019s name. The system Id in our example is PRP in uppercase. This problem happens while connecting to any of our R/3 instances.
    </P>
    <P>
    Testing of the issue:</br>
    Scenario 1:</br>
    User gmcghie: This user is the primary user of his/her PC. This PC has not had its registry entries cleaned up for a long time. Starting the Java application from the Windows command line with the supplied parameters, the program is executed and makes the initial connection with the R/3 backend. When the R/3 system sends back a request to start the GUI session, the SAP Logon is executed and opens on the PC. Nothing seems to happen after this.
    <P>
    Here is the JCO exception from the log file:
    JCoException eDest: (136)com.sap.conn.jco.JCoException: (136) JCO_ERROR_ILLEGAL_STATE: Launching SAP GUI failed, though it was requested (error message: Communication with SAPGUI timed out)
    </P>
    <P>
    When you right click on the SAP Logon icon that is in the Windows System Tray on the PC you see an entry that shows a session for Client 000. This is the wrong client being called by the application. The client being called is 600 in this particular scenario.
    </P>
    <P>
    Here is the connection string sent to backend for scenario 1:</br>
    TYPE=A DEST=PRP USER="gmcghie" PASSWD=********** CLIENT=600 LANG=E ASHOST=10.212.120.53 SYSNR=00 TRACE=1 PCS=1 USE_SAPGUI=2
    </P>
    <P>
    Scenario 2:</br>
    User mshin: This user is the primary user of his/her PC. This PC has had the OS re-installed on it within the last few years, hence the registry is likely more clean. Starting the Java application from the Windows command line with the supplied parameters, the program is executed and makes the initial connection with the R/3 backend. When the R/3 system sends back a request to start the GUI session, the SAP Logon is executed and opens on the PC. The connection is made to Client 600 and the process ends. The screens that appear above for the other scenario are not present when the connection is successful. The log file is not included for this as it was empty because it succeeded.
    </P>
    <P>
    Here is the connection string sent to backend for scenario 2:</br>
    TYPE=A DEST=PRP USER="mshin" PASSWD=********** CLIENT=600 LANG=E ASHOST=10.212.120.53 SYSNR=00 TRACE=1 PCS=1 USE_SAPGUI=2
    </P>
    I have the same issue on my PC as the first scenario.
    <P>The steps I took to try to get this to work are as follows.</br>
    1. Un-installed and re-installed the SAPGui, several times with no change.</br>
    2. Compared the registry settings of SAPGui between working and non-working PCu2019s. These were essentially the same.</br>
    3. Compared the system variables between working and non-working PCu2019s. These were essentially the same.</P>
    It should also be noted that if user u2018gmcghieu2019 from scenario #1 logs into another PC, the program executes correctly (for most other PCs but not all). Finally, if user u2018mshinu2019 from scenario #2 (certain other users as well) logs into Windows on the primary PC for user u2018gmcghieu2019 from scenario #1, and user u2018gmcghieu2019 is used to connect to SAP using the Java program, the program executes correctly. It seems that this would indicate some problem with the useru2019s Windows account on certain PCs.</P>
    Why is the connection information being dropped? How is the process of opening the SAPGui on the frontend done?</P>
    Any help with this issue is greatly appreciated.</P>
    Thanks,</br>
    Mark Shirkey

    Created Customer Message and got answer. There were settings in Windows Registry for starting the SAP Logon Launch Pad which had to have a value of 1.

  • How to check if a user session is active in Java application server

    Hi Experts,
          We have a online scenario with a third party system by which a portal user will launch the third party application in a new window from portal. The SSO will work at the third party web application with the dynamic key that is generated by calling a webservice for that user. Now, as the user works on the launched screen, they will have to check whether the user (logged in portal) session is still active. ie., they will be periodically calling a service hosted by SAP java application server to find out whether the corresponding user who launched the session is still logged in or logged out.
    So, my question is, how can i find out programatically whether a user/user's session is still logged in/active in SAP Netweaver Java AS? We are in version 7.3.
    Kindly help me in this regard.
    Regards
    Vijay.K

    Hi Vijay,
    Could you check below links
    Tracing Single User Sessions - Administration - SAP Library
    Display and Manage User Sessions (SAP Library - Tools for Monitoring the System)
    Hope this helps.
    Regards,
    Deepak Kori

  • A Java application how to pass Microsoft OEM Ready program?

    Hello,
    I have a Java application that needs to pass OEM Ready program, but it fails on AppVerifier item. The error messages are:
    "Freeing memory block inside current thread's stack address range."
    "First chance access violation for current stack trace."
    These errors are occurred by JVM. Anybody understands a Java application how to pass AppVerifier? Thanks in
    advance.
    p.s. The Java application is only a simple "Hello World" program.
    p.s. I also test many popular Java applications (such as JBuilder/NetBeans), they
    also cannot pass AppVerifier.
    p.s. The OEM Ready Program web site: http://msdn.microsoft.com/en-us/windowsvista/cc315067.aspx

    One small update. These errors are reported by AppVerifier tool. But the origin of the errors seems to be coming from JNI Calls. Basically AppVerifier is a runtime verification tool and helps in monitoring an application's interaction with OS, the registry, the file system,heap, handles, locks, and more and reports the errors found.
    And when I check my application ( which interacts with few .jar files using JNI calls ) with AppVerifier, it is reporting the errors, upon debugging I found the source of the errors to be the JNI calls. Any idea about the reasons and fix for these errors.
    I thank you in advance.

  • Pass a table from my webdynpro JAVA application to an RFC in R/3

    Hi All,
    I need to Pass a table from my webdynpro JAVA application to an RFC in R/3. How can I do that?
    Regards
    Sarath

    Hi,
    Please have a look at this thread,
    Pass Table as Input to Adaptive RFC
    Regards,
    Saravanan K

Maybe you are looking for