Session management in swing

HI,
How to create sessions in swing.
Is there any technique to create session in swing,
Help me,
Thanks in advance

"How can i get request object in swing"
You can't really, as the previous response implied. A swing app with run in a separate JVM from the web server. You could pass a session id or other needed information like so
<jnlp codebase="">
<argument sessionid="1099"> </argument>
</jnlp>
or similar for <applet> tag.
Then retrieve that value(as argument or parameter) in your swing code.

Similar Messages

  • Session management thru SOAP services

              Hi I am trying to deploy our application in a clsutered environment. Previsouly
              I had some problems with http session replication. That problems were solved but
              now I have another problem.
              Our application has multiple clients, some are browser based and some are swing
              based that use our SOAP services.
              all browser based clients use httpsession for session management, since weblogic
              replicates the httpsession, we have no problem clustering http webapps. But SOAP
              services has no access to httpsession.
              We have implemented our own session management (we cache the app specific session
              objects) so that SOAP services works fine (SOAP services doesn't have access to
              httpsession, so we could not use httpsession for session management). Each method
              in our soap services takes a sessionid and we get the session objects (not http
              session objects but our app specific session objects) based on the sessionid.
              But now that our application is clustered, the session cache mechanism doesn't
              work since its not replicated thru out the clusters.
              I thought I could use stateful session beans to cache the sessions, but how do
              I cache the SFSB thru out the session w/o sending any references to the SFSB to
              the client. I know I can send the Handle reference to the client but We cannot
              change the SOAP API now. The only information client has is the session id.
              My question is: How do I use SFSB w/o changing my soap services method paramaters.
              My SOAP method looks like methodName(String sessionid, ..............)
              I could use a clustered cache but we can't buy anything in the current situation.
              Any help would be appreciated.
              Praveen
              

    Well, does the DSM log have any details? (see [Note 529924|https://service.sap.com/sap/support/notes/529924] on how to view the logs)
    My guess is that you are using different protocols between the dispatcher and a backend system: they both have to use HTTP or both use HTTPS (as described in the same note). That would also explain why the URL for the direct connection to the portal  doesn't present the error, if that URL has the same protocol as the backend.
    Regards,
    Sean

  • JMStudio Error  "Can not create session manager"

    Hi,
    I'm trying to transmit an mpg file through a simple pc to pc network, using the transmission wizard in the JMStudio, and everytime it causes a "can not create session manager" error, even when I try to transmit .mp3 file
    I'm using an ip like 100.100.0.1 for the sender machine, and 100.100.0.2 for the receiver machine, and I don't know where is the problem
    thanks in advance

    Um,maybe the port that you use for transmission is already occupied.
    Make sure that you are not using JMStudio to transmit streams while trying to receive streams from the same port.

  • What is new with MAX 2.0 and is it compatible with Session Manager?

    We added non-IVI instrument information in, basically the same structure as for IVI instruments,
    into the ivi.ini file to keep all instrument information in the same place. Using MAX Version 1.1 caused no problems whatsoever and the system worked fine. With the advent of MAX 2.0 you seem to use ivi.ini as well as config.mxs to store instrument information. What we have found now is that given a working ivi.ini file from MAX 1.1, we end up with 2 or 3 copies of all the devices in the IVI Instruments->Devices section! When the duplicate entries are deleted and the application exited, the
    ivi.ini file is updated minus the [Hardware->] sections which contain the resource descriptors that our appl
    ications look for. As an added complication, under MAX 2.1 (From an evaluation of the Switch Executive) It behaves the same, except that it almost always crashes with one of the following errors. 'OLEChannelWnd Fatal Error', or 'Error#26 window.cpp line 10028 Labview Version 6.0.2' Once opened and closed MAX 2.1 will not open again! (Note we do not have LabVIEW on the system.) What is the relationship between the config.mxs and ivi.ini now? Also, your Session Manager application (for use with TestStand) extracts information from ivi.ini and may expect entries to be manually entered into ivi.ini (e.g. NISessionManager_Reset = True) i.e. Is the TestStand Session Manager compatible with MAX 2.0?

    Brian,
    The primary difference between MAX 1.1 and 2.x is that there is a new internal architecture. MAX 2.x synchronizes data between the config.mxs and the ivi.ini. The reason you're having trouble is that user-editing of the ivi.ini file is not supported with MAX 2.x.
    Some better solutions to accomplish what you want:
    1. Do as Mark Ireton suggested in his answer
    2. Use the IVI Run-Time Configuration functions. They will allow you to dynamically configure your Logical Names, Virtual Instruments, Instrument Drivers, and Devices. You can then use your own format for storing and retrieving that information, and use the relevant pieces for each execution. You can find information on these functions in the IVI CVI Help file located in Start >> National I
    nstruments >> IVI Driver Toolset folder. Go to the chapter on Run-time Initialization Configuration.
    I strongly suggest #2, because those functions will continue to be supported in the future, while other mechanisms may not be.
    --Bankim
    Bankim Tejani
    National Instruments

  • Session management problems with SSO

    Hi all-
    I've been getting an Apex app tied to SSO as a partner app (per http://www.oracle.com/technology/products/database/application_express/howtos/sso_partner_app.html). So far, it sort of works. If I go to my apex app, it redirects me to SSO, where I authenticate and end up back in the apex app. Great. Here are two problems I've run into:
    1. If I am already authenticated to SSO, and I go to my apex app (url like: http://host/pls/apex/f?p=101:1), my browser goes into an infinite redirect (url like: http://host/pls/apex/f?p=101:1:::::FSP_AFTER_LOGIN_URL:\f? p=101|1|||||FSP_AFTER_LOGIN_URL|\f?p=101|1|||||FSP_AFTER_LOGIN_URL|\f? p=101|1|||||FSP_AFTER_LOGIN_URL|\f?p=101|1|||||FSP_AFTER_LOGIN_URL|\f? p=101|1|||||FSP_AFTER_LOGIN_URL|\f?p=101|1|||||FSP_AFTER_LOGIN_URL|\f? p=101|1|||||FSP_AFTER_LOGIN_URL|\f?p=101|1|||||FSP_AFTER_LOGIN_URL|\f? p=101|1|||||FSP_AFTER_LOGIN_URL|\f?p=101|1|||||FSP_AFTER_LOGIN_URL|\f? p=101|1|||||FSP_AFTER_LOGIN_URL|\f?p=101|1|||||FSP_AFTER_LOGIN_URL|\f? p=101|1|||||FSP_AFTER_LOGIN_URL|\f?p=101|1|||||FSP_AFTER_LOGIN_URL|\f? p=101|1|||||FSP_AFTER_LOGIN_URL|\f?p=101|1|||||FSP_AFTER_LOGIN_URL|\f? p=101|1|||||FSP_AFTER_LOGIN_URL|\f?p=101|1|||||FSP_AFTER_LOGIN_URL|\f? p=101|1|\\\\\\\\\\\\\\\\\\\). To resolve, I have to clear cookies.
    2. If I am using my apex app, then log out of SSO (in another browser window), I can still click around in my apex app (i.e., apex thinks I'm still authenticated).
    Anyone have any thoughts? I'm wondering if I need to do something in page session management (under authentication schemes) to fix #2, but I have no clue about #1.
    Thanks
    Rob

    Hi Scott-
    Thanks for the info on #2 - I'll work on that after I get #1 sorted out, since it's the more dire problem. Here's some more info:
    Apex version = 3.0.1.00.08
    SSO SDK = ssosdk902.zip
    I set it up as "My Application as Partner App." I used "MY_PARTNER_NAME" as SSO Partner Application Name. In the list of SSO Partner Apps on the SSO Admin page, my partner app name is also MY_PARTNER_NAME. It gives the following info:
    Login URL:      https://sso_host/pls/orasso/orasso.wwsso_app_admin.ls_login
    Single Sign-Off URL:      https://sso_host/pls/orasso/orasso.wwsso_app_admin.ls_logout
    Home URL: http://apex_host/pls/apex
    Success URL: http://apex_host/pls/apex/RBLICK.YOUR_PACKAGE.PROCESS_SUCCESS
    Logout URL: http://apex_host/pls/apex
    RBLICK is the schema owning the apex app. In there, I created a package called YOUR_PACKAGE:
    create package YOUR_PACKAGE as
    procedure process_success(urlc in varchar2);
    end YOUR_PACKAGE;
    CREATE PACKAGE BODY YOUR_PACKAGE AS
    procedure process_success(urlc in varchar2) as
    begin
    wwv_flow_custom_auth_sso.process_success(
    urlc=>urlc,
    p_partner_app_name=>'MY_PARTNER_NAME');
    end process_success;
    END YOUR_PACKAGE;
    Anything look obviously wrong to you?
    Thanks!
    Rob

  • What is the difference between Session timeout and Short Session timeout Under Excel Service Application -- session management?

    Under Excel Service Application --> session management; what is the difference between Session timeout and Short Session timeout?

    Any call made from the API will automatically be set to the “Session Timeout” period, no matter
    what. Calls made from EWA (Excel Web Access) will get the “Short Session Timeout” period assigned to it initially.
    Short Session Timeout and Session Timeout in Excel Services
    Short Session Timeout and Session Timeout in Excel Services - Part 2
    Sessions and session time-outs in Excel Services
    above links are from old version but still applies to all.
    Please remember to mark your question as answered &Vote helpful,if this solves/helps your problem. ****************************************************************************************** Thanks -WS MCITP(SharePoint 2010, 2013) Blog: http://wscheema.com/blog

  • Session management and java Web Service

    Hi ,
    Can I have two web services one based on Session bean and other on Simple java class, packaged into single ear file? Does NetWeaver supports web service session management/tracking? How can I get an handle to HttpRequest in my Web Service?
    Any help will be appreciated.
    Thanks in advance
    regards,
    rajinder

    Container Managed Authentication. Does everything you need.

  • Hello, I have a big problem with Firefox: Session Manager & Undo Closed Tab addons are not working, Sync Is not working. History is working. How to fix this?

    Firefox remembers history but doesn't remember closed tabs, sessions.
    It happened after updating Fox to v. 19.0.2 on one computer.
    In Firefox Options is set Use Custom Settings For History, everything is checked except Always Use Private Browsing Mode. So I am not in private browsing.
    When I press on Undo Closed Button nothing happens & in session manager Save Session Button is greyed out. I've tried installing other add-ons that can remember tabs. tried to disable/reinstall these 2 add-ons. Did't help. On my 2nd computer I have same add-ons, same settings and they are working normally. on 3rd computer undo closed tabs works also. How to fix this? I decided to ask before doing Firefox Reset...
    Sync is a separate problem. It works, but quite often it logs me out of Sync account. Then I can log in only using long recovery key and password (choosing option I don't have device with me because it does not accept keys for pairing device.)
    Thanks for reading.

    I have exactly the same settings in Options (in both computers)
    for history, these 2 add-ons and all other stuff in Options. The only difference is that on 1 pc sessions can be saved and closed tabs can be reopened, on other main pc they stopped to work. + no any other add-on that does similar things works on this pc.
    It is also interesting that I can reopen closed visited sites from History Panel, but not by pressing the Button. For now I only manually bookmark links to a temporary folder.
    Recently (some 2 month ago) I pressed x and Firefox closed all tabs without saving them without displaying save & quit pop up.
    so I changed 4 settings in about.config
    browser.tabs.warn on close true
    browser.warn on quit true
    browser.warn on restart true
    browser.show.quit warning true
    but the problem with sessions appeared only 1 week ago.
    So I guess the problem is not with the History settings or other settings. Seems that something responsible for button or for storing info about tabs/sessions got corrupted. :(

  • Session management in Info View with two different logins using single sign

    There is a form with 2 user logins UserA and User B to redirect to infoview with sso in my application. I am able to go to each of the Infoview pages successfully but have the following problem.
    User A logs in and infoview opens in a new IE window and sees his/her folders based on permissions and is able to do his/her work for the first time.
    User B logs in andand infoview opens in a new IE window sees his/her folders based on permissions and is able to do his/her work for the first time.
    <b>After a while when User A tries to access the InfoView in the previously opened IE Window, he/she gets an error message. An error has occurred: The object with ID 2519 does not exist in the CMS or you don't have the right to access it.
    User B is able to continue his/her work. Who ever logs in the last, he/she is able to continue his/her work but the other one gets an error.</b>
    <b>Please let me know on how to address this issue . I added logonToken and tried everything at my hand but no success. Is this session controlled by business objects or by the jsp page. What more changes are required for my jsp page to fix the error. Attached below are the form and the applogon.jsp snippets.</b>
    <B> applogon.jsp</B>
        IEnterpriseSession enterpriseSession = null;
        Exception failure = null;
        boolean loggedIn = true;
         String redirectURL = null;
         // If no session already exists, logon using the specified parameters.
        if (enterpriseSession == null){
            try{
                // Attempt logon. Create an Enterprise session manager object.
                ISessionMgr sm = CrystalEnterprise.getSessionMgr();
                // Log on to BusinessObjects Enterprise
                enterpriseSession = sm.logon(username, password, "cms", "secEnterprise");
            }catch (Exception error){
                loggedIn = false;
                failure = error;
            if (!loggedIn){
                // If the login failed, redirect the user to the start page.
                return;
            }else{
                // Store the IEnterpriseSession object in the session.
                session.setAttribute("EnterpriseSession", enterpriseSession);
                // Create the IInfoStore object.
                IInfoStore iStore = (IInfoStore) enterpriseSession.getService("InfoStore");
                // Store the IInfoStore object in the session using the helper functions.
                session.setAttribute("InfoStore", iStore);
                // Store the CMS name for later use.
                session.setAttribute("CMS", "CMS");
                   // Create the IReportSourceFactory object.
                   IReportAppFactory reportAppFactory =(IReportAppFactory)enterpriseSession.getService("RASReportService");
                   // Store the IReportSourceFactory object in the session using the helper functions.
                   session.setAttribute("ReportAppFactory", reportAppFactory);
                // Retrieve the logon token manager.
                ILogonTokenMgr logonTokenMgr = enterpriseSession.getLogonTokenMgr();
                   String logonToken = logonTokenMgr.createLogonToken("", 60, 100);
                   String infoViewURL = null;
                   String tokenParam = null;
                   infoViewURL = "/businessobjects/enterprise115/desktoplaunch/InfoView/logon/logon.do";
                   tokenParam = "token=" + logonToken;
                   redirectURL = infoViewURL + "?" + tokenParam;
                // Retrieve a logon token and store it in the user's cookie
                // file for use later.
                Cookie cookie = new Cookie("LogonToken", logonTokenMgr.createLogonToken("", 60, 100));
                response.addCookie(cookie);
                // Store the logon token for later use.
                session.setAttribute("token", enterpriseSession.getLogonTokenMgr().getDefaultToken());
         // Redirect the user to the relevant tutorial page.
         out.println("You have been logged on to Enterprise.");
         response.sendRedirect (redirectURL);
    Thank You for your help

    // Retrieve the parameters that the user entered into the logon fields.
    <b> user name and password come from here from the above html form into the jsp here. Ted Is this what you are asking for where does the username and password come from
        String username = request.getParameter("user");
        String password = request.getParameter("pass");
    </b>
        IEnterpriseSession enterpriseSession = null;
        Exception failure = null;
        boolean loggedIn = true;
         String redirectURL = null;
         ISessionMgr sessionMgr = null;
         // If no session already exists, logon using the specified parameters.
        if (enterpriseSession == null){
            try{
                // Attempt logon. Create an Enterprise session manager object.
                sessionMgr = CrystalEnterprise.getSessionMgr();
                // Log on to BusinessObjects Enterprise
                enterpriseSession = sessionMgr.logon(username, password, "appserver.abc.com", "secEnterprise");
                   System.out.println("line61");
            }catch (Exception error){
                loggedIn = false;
                failure = error;
            if (!loggedIn){
                // If the login failed, redirect the user to the start page.
                return;
            }else{ this code is in my first post

  • Issue in session management

    Hi All,
    I have a problem regarding java session management.
    i have created one web application in which i want if user login from one browser instance and opens another instance of same browser and logs in from that then user should be logged out from previous instance. I am using Mozzila 5.0.
    Here is what i am doing while creating session in LoginServlet.java
    session = request.getSession(false); //return session if already exists
    System.out.println("Session object: "+session);
    if(session != null)
    System.out.println("Session ID Old: "+session.getId());
    session.invalidate(); //invalidate the session if already exists
    session = request.getSession(true); //Create new session
    System.out.println("Session ID New: "+session.getId());
    Second and third System.out.println() statements giving the same session id.
    This way only the information stored in session when user was logged in from first instance of browser is replaced with the new information stored when the user logged in from second instance of browser, but the user is not logged out from the first browser instance.
    Please help me out how i can log the user out from first instance if he logs in from second instance.
    Thanks in advance...

    Since user in logging again from the same machine so i think invalidating the previous session won't work.
    Suppose user opens first instance of the mozilla browser and login as say 'ashok' whose role is normal user now he opens another instance of mozilla by clicking on executable and login as 'mitch' whose role is admin then after successful login of 'mitch' on first window mitch's menus items are getting displayed instead of ashok's.
    What i am doing is,
    While creating new session on login i first check is any existing session available in above case its true
    session = request.getSession(false); //return session if already exists
    System.out.println("Session object: "+session);
    if(session != null)
    System.out.println("Session ID Old: "+session.getId());
    session.invalidate(); //invalidate the session if already exists
    session = request.getSession(true); //Create new session
    System.out.println("Session ID New: "+session.getId());
    so control will go inside the if block, here i first invalidate the existing session (this is not destroying the session but only unbinding the information that was stored in the session) and create new session (this is returning the same session which was already exists) and save mitch's information. Since the previous instance was using the same session that will now get the mitch's information so now both instances will show the mitch's information.
    I am not getting any way to destroy the existing session so next time new session id will get generated.

  • Session in java swing??

    Hi friends,
    I need to create session in java swing...
    I have a client running in swing and can access resources in multi-threaded server. I need to validate user using session. But i don't know how to use session.
    User has to login with username & password (authentication verified at server using socket communication).
    If successful the login frame vanishes and other options are displayed. user has a feature that he can send files to other
    user. so i need to use session for security purpose.
    Anyone help me with code
    Edited by: sathya_vn on Apr 20, 2008 5:41 PM

    Anyone help me with the code-----> u got tat wrong..
    I need to know how to use session with java swing. I requested if anyone has such code....
    This is a part of my project .
    Am using MySQL Database to store username and password.
    Cleint side interface has a frame (first frame--frame1) requesting client to provide login information. The login details <username and password> are sent to server. server validates whether the login info are correct or not and return true or false .
    If false the frame1 will show a JOptionPane ... message stating that wrong username or password specified.
    If true i need to create a session and other operations are done after session validation. I am using ssl socket.
    If u want the code then i have post around 300 or more lines..

  • Coherence integration with oracle weblogic portal for Session management

    Could you please let me know how to configure coherence integration with oracle weblogic portal for Session management. Its very urgent. please help.

    Please take a look at the following web page -
    http://coherence.oracle.com/display/COH35UG/Coherence*Web+Session+Management+Module
    -Luk

  • Firefox 5 on Win7: All my plugin buttons have gone from the toolbar. They are not in the customise pane. Session manager offers the correct sessions but opens with last session instead. I've re-installed % and reset toolbars. Help!

    Win 7
    Firefox 5
    Problem with high memory use.
    restarted
    Plugin buttons gone from toolbar/
    Missing plugins still show in plugin manager but buttons missing from toolbar add buttons pane.
    Tried reset toolbars - no difference.
    Tried re-instal of Firefox 5 - no difference except:
    Session manager offers correct session on startup but starts with last session

    In case you are using "Clear history when Firefox closes":
    *do not clear the Browsing History
    *Firefox > Preferences > Privacy > Firefox will: "Use custom settings for history": [X] "Clear history when Firefox closes" > Settings
    *https://support.mozilla.org/kb/remove-browsing-search-and-download-history
    Note that clearing "Site Preferences" clears all exceptions for cookies, images, pop-up windows, software installation, passwords, and other website specific data.
    You can check for problems with the sessionstore.js and sessionstore.bak files in the Firefox profile folder that store session data.
    *Help > Troubleshooting Information > Profile Directory: Show Folder (Linux: Open Directory; Mac: Show in Finder)
    *http://kb.mozillazine.org/Profile_folder_-_Firefox
    *http://kb.mozillazine.org/Multiple_profile_files_created
    Deleting sessionstore.js will cause App Tabs and Tab Groups and open and closed (undo) tabs to get lost and you will have to recreate them (make a note or bookmark them if possible).

  • Bug in session manager. If you work for Sun, please take a look.

    While evaluating what it would take to transition from Iplanet 6 to Sun Webserver 6.1, I found a problem with the Sun Webserver's s1ws60 session managers. If the page is not explicitly flushed before ending, the session cookie JSESSIONID is never sent. So as long as the user continues to visit small pages, they keep getting new sessions (because they are never sent a session id, so the session manager creates a new one every time they visit). The session cookie is sent if larger pages are visited (the buffer is automatically flushes). The session cookie is also sent if out.flushBuffer() is explicitly called within the JSP. This problem was not present in IWS6.0.
    The problem has been tracked down to a combination of the code in com.iplanet.server.http.session.IWSSessionManager (found in the "plugins" directory) and the JSP's Java code generated by a component of the webserver (Catalina?). Under Iplanet, the code generated in the finally{} section of the JSP first flushed the buffer, then called releasePageContext. Under Sun Webserver, the code generated just calls releasePageContext without explicitly flushing the buffer before the call. When flushing the buffer for a non-committed response, the headers are first generated and sent, along with any cookies, including the session cookie. The server only sends the session cookie if, among other things, the session satisfies "_session.isNew()". The order of events in releasePageContext ensures that this is never true when used in combination with IWSSessionManager. I don't have the source code to verify this, but from experimentation I think this is the reason: Before the buffer is flushed, the session is saved by IWSSessionManager.update(session), which at line 498 calls "sn.unsetNew()". So the session is never isNew() when it gets around to sending the session cookie. This can be resolved by either adding an explicit buffer flush to the finally{} section of the JSP, or removing the unsetNew() call from IWSSessionManager. Since I don't know where the code that generates the JSP is (or if I can even change it), I ended up removing the sn.unsetNew() call from the update() function.
    Here's the code generated in the finally{} section using IWS6 and Sun Webserver:
    Iplanet 6
            } finally {
                if (out != null && (out instanceof org.apache.jasper.runtime.JspWriterImpl)) {
                    ((org.apache.jasper.runtime.JspWriterImpl) out).flushBuffer();
                if (_jspxFactory != null) _jspxFactory.releasePageContext(pageContext);
            }Sun Webserver
            } finally {
                _jspx_releaseTags(_jspx_curTag, null);
                if (_jspxFactory != null) _jspxFactory.releasePageContext(pageContext);
            }

    I posted a bug report on this.

  • JMF error - Format of Stream not supported in RTP Session Manager

    java.io.IOException: Format of Stream not supported in RTP Session Manager
    at com.sun.media.datasink.rtp.Handler.open(Handler.java:139)
    why this erro occors?
    I already created the DataSink.
    When I try to do this...
    dsk.open(); //here the error got
    dsk.start();     Code of server of media
    I want to sent audio (wav) like a radio, but from file. Without stop to send streaming. PullBufered
    *Class Server that you offers Streaming of midia
    public class Servidor {
    private MediaLocator ml;
    private Processor pro;
    private javax.media.protocol.DataSource ds;
    private DataSink dsk;
    private boolean codificado = false;
    //start the server service, passing the adress of media
    // ex: d:\music\music.wav
    // pass the ip and port, to make a server works
    public void iniciarServicoServidor(String end,String ip, int porta)
    try {
    //capture media
    capturarMidia(end);
    //creates processor
    criarProcessor();
    // configure the processor
    configurarProcessor();
    //setContent RAW
    descreverConteudoEnviado();
    //format the media in right RTP format
    formatRTP();
    //creat the streaming
    criarStreaming();
    //configure the server
    configurarServidor(ip, porta);
    //in this method raise the excepition
    iniciarServidor();
    //when I try to open the DataSink.open() raises the exception
    //java.io.IOException: Format of Stream not supported in RTP Session //Manager
    // at com.sun.media.datasink.rtp.Handler.open(Handler.java:139)
    } catch (RuntimeException e) {
    System.out.println("Houve um erro em iniciarServicoServidor");
    e.printStackTrace();
    public void capturarMidia(String endereco)
    try {
    System.out.println("**************************************************************");
    System.out.println("Iniciando processo de servidor de multimidia em " + Calendar.getInstance().getTime().toString());
    ml = new MediaLocator("file:///" + endereco);
    System.out.println("Midia realizada com sucesso.");
    System.out.println ("[" + "file:///" + endereco +"]");
    } catch (RuntimeException e) {
    System.out.println("Houve um erro em capturarMidia");
    e.printStackTrace ();
    public void criarProcessor()
    try {
    System.out.println("**************************************************************");
    pro = Manager.createProcessor(ml);
    System.out.println("Processor criado com sucesso.");
    System.out.println("Midia com durcao:" + pro.getDuration().getSeconds());
    } catch (NoProcessorException e) {
    System.out.println("Houve um erro em criarProcessor");
    e.printStackTrace();
    } catch (IOException e) {
    System.out.println ("Houve um erro em criarProcessor");
    e.printStackTrace();
    public void configurarProcessor()
    try {
    System.out.println("**************************************************************");
    System.out.println("Processor em estado de configura��o.");
    pro.configure();
    System.out.println("Processor configurado.");
    } catch (RuntimeException e) {
    System.out.println("Houve um erro em configurarProcessor");
    e.printStackTrace();
    public void descreverConteudoEnviado()
    try {
    System.out.println("**************************************************************");
    pro.setContentDescriptor(new ContentDescriptor(ContentDescriptor.RAW));
    System.out.println("Descritor de conteudo:" + pro.getContentDescriptor().toString());
    } catch (NotConfiguredError e) {
    System.out.println("Houve um erro em descreverConteudoEnviado");
    e.printStackTrace();
    private Format checkForVideoSizes(Format original, Format supported) {
    int width, height;
    Dimension size = ((VideoFormat)original).getSize();
    Format jpegFmt = new Format(VideoFormat.JPEG_RTP);
    Format h263Fmt = new Format(VideoFormat.H263_RTP);
    if (supported.matches(jpegFmt)) {
    // For JPEG, make sure width and height are divisible by 8.
    width = (size.width % 8 == 0 ? size.width :
    (int)(size.width / 8) * 8);
    height = (size.height % 8 == 0 ? size.height :
    (int)(size.height / 8) * 8);
    } else if (supported.matches(h263Fmt)) {
    // For H.263, we only support some specific sizes.
    if (size.width < 128) {
    width = 128;
    height = 96;
    } else if ( size.width < 176) {
    width = 176;
    height = 144;
    } else {
    width = 352;
    height = 288;
    } else {
    // We don't know this particular format. We'll just
    // leave it alone then.
    return supported;
    return (new VideoFormat(null,
    new Dimension(width, height),
    Format.NOT_SPECIFIED ,
    null,
    Format.NOT_SPECIFIED)).intersects(supported);
    public void formatRTP()
    try {
    // Program the tracks.
    TrackControl tracks[] = pro.getTrackControls();
    Format supported[];
    Format chosen;
    for (int i = 0; i < tracks.length; i++) {
    Format format = tracks.getFormat();
    if (tracks[i].isEnabled()) {
    supported = tracks[i].getSupportedFormats();
    // We've set the output content to the RAW_RTP.
    // So all the supported formats should work with RTP.
    // We'll just pick the first one.
    if (supported.length > 0) {
    if (supported[0] instanceof VideoFormat) {
    // For video formats, we should double check the
    // sizes since not all formats work in all sizes.
    chosen = checkForVideoSizes(tracks[i].getFormat(),
    supported[0]);
    } else
    chosen = supported[0];
    tracks[i].setFormat(chosen);
    System.err.println("Track " + i + " is set to transmit as:");
    System.err.println(" " + chosen);
    codificado = true;
    } else
    tracks[i].setEnabled(false);
    } else
    tracks[i].setEnabled(false);
    } catch (RuntimeException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    public void tocar()
    pro.start();
    public void criarStreaming()
    try {
    System.out.println("**************************************************************");
    if (codificado)
    System.out.println("Midia codificada...");
    System.out.println("Processor entra em estado de realize.");
    pro.realize();
    System.out.println("Processor realized.");
    System.out.println("Adquirindo o streaming a ser enviado.");
    ds = pro.getDataOutput();
    System.out.println("Streaming adquirido pronto a ser enviado.");
    } catch (NotRealizedError e) {
    System.out.println("Houve um erro em criarStreaming");
    System.out.println(e.getMessage());
    e.printStackTrace();
    catch (Exception e) {
    System.out.println(e.getMessage());
    public void configurarServidor(String ip, int porta)
    System.out.println("**************************************************************");
    String url = "rtp://" + ip + ":" + porta + "/audio/1";
    System.out.println("Servidor ira atender em " + url);
    MediaLocator mml = new MediaLocator(url);
    System.out.println("Localizador de midia ja criado");
    try {
    System.out.println("Criando um DataSink a ser enviado.");
    dsk = Manager.createDataSink(ds, mml);
    System.out.println("DataSink criado.");
    } catch (NoDataSinkException e) {
    e.printStackTrace();
    public void iniciarServidor()
    try {
    System.out.println("**************************************************************");
    dsk.open();
    System.out.println("Servidor ligado.");
    dsk.start();
    System.out.println("Servidor iniciado.");
    } catch (SecurityException e) {
    e.printStackTrace();
    } catch (IOException e) {
    e.printStackTrace();
    Gives that output console.
    All methods are executed but the last doesnt works.
    The method that open the DataSink.
    What can I do?
    Iniciando processo de servidor de multimidia em Sun May 13 22:37:02 BRT 2007
    Midia realizada com sucesso.
    [file:///c:\radio.wav ]
    Processor criado com sucesso.
    Midia com durcao:9.223372036854776E9
    Processor em estado de configura��o.
    Processor configurado.
    Descritor de conteudo:RAW
    Midia codificada...
    Processor entra em estado de realize.
    Processor realized.
    Adquirindo o streaming a ser enviado.
    Streaming adquirido pronto a ser enviado.
    Servidor ira atender em rtp://127.0.0.1:22000/audio/1
    Localizador de midia ja criado
    Criando um DataSink a ser enviado.
    streams is [Lcom.sun.media.multiplexer.RawBufferMux$RawBufferSourceStream;@a0dcd9 : 1
    sink: setOutputLocator rtp://127.0.0.1:22000/audio/1
    DataSink criado.
    Track 0 is set to transmit as:
    unknown, 44100.0 Hz, 16-bit, Stereo, LittleEndian, Signed, 176400.0 frame rate, FrameSize=32 bits
    java.io.IOException: Format of Stream not supported in RTP Session Manager
    at com.sun.media.datasink.rtp.Handler.open(Handler.java:139)
    at br.org.multimidiasi.motor.Servidor.iniciarServidor(Servidor.java:291)
    at br.org.multimidiasi.motor.Servidor.iniciarServicoServidor(Servidor.java:43)
    at br.org.multimidiasi.motor.ConsoleServidor.main(ConsoleServidor.java:30)
    Since already thanks so much.
    Exactally in this method raises erros.
    Ive tried another formats (avi, mp3) but all with the same error, what I can do?
    [code] public void iniciarServidor()
    try {
    System.out.println("**************************************************************");
    dsk.open();
    System.out.println("Servidor ligado.");
    dsk.start();
    System.out.println("Servidor iniciado.");
    } catch (SecurityException e) {
    e.printStackTrace();
    } catch (IOException e) {
    e.printStackTrace();
    Track 0 is set to transmit as:
    unknown, 44100.0 Hz, 16-bit, Stereo, LittleEndian, Signed, 176400.0 frame rate, FrameSize=32 bits
    java.io.IOException: Format of Stream not supported in RTP Session Manager
    at com.sun.media.datasink.rtp.Handler.open(Handler.java:139)
    at br.org.multimidiasi.motor.Servidor.iniciarServidor(Servidor.java:291)
    at br.org.multimidiasi.motor.Servidor.iniciarServicoServidor(Servidor.java:43)
    at br.org.multimidiasi.motor.ConsoleServidor.main(ConsoleServidor.java:30)

    unknown, 44100.0 Hz, 16-bit, Stereo,
    LittleEndian, Signed, 176400.0 frame rate,
    FrameSize=32 bits
    java.io.IOException: Format of Stream not supported
    in RTP Session Manager
    The fact that it doesn't know what the format is
    might have to do with the problem. I've had similar
    problems, and I've traced it back to missing jars and
    codecs. Have you tried running the same code locally
    without the transmission to see if you player will
    even play the file?Already and it works, I used Player to play it and play normally, I try to make it with the diferents codecs of audio and video, but no sucess.

Maybe you are looking for

  • How do I do a CLEAN install of Lion?

    I've just installed Lion and it runs more like Mouse. Everything has slowed right down. I've repaired permissions, and that's no better. Adobe Bridge is an absolute nightmare. I've reset it's preferences and that's not helped. It keeps asking me to r

  • I can't click hyperlinks on a pdf in preview

    I've opened a pdf in preview which contains links to websites, but I can't click these links.  Any ideas why?  It works fine on a pc.

  • How to use a single jsp as template

    hi I have a jsp with a layout. it means the jsp has menu on the left and header on the top. now for every different call the center part of the jsp should change. Is this possible? I mean for every different call a different jsp should be included in

  • Script to add a new page in LiveCycle

    I am new to LiveCycle so please forgive my ignorance. I have 2 things I am trying to do. 1. In my fillable form, I want to have default text in the the form field that appears in light gray and disappears automatically when a user clicks in the field

  • Purchase order increase limitation for user

    Hi Experts How can increase the purchase order limitation for the perticular user which transaction code have to be run to change the purchase limitation Regards Piroz