More than one throws exception

Please I have a doubt...and I cant find in my directories the documentation that I had installed!!!
So the doubt is: how can I throw more than one exception...what is the syntax?!

You can't throw more than one exception, the 'throw' keyword only takes one Throwable. If you mean, how do you declare a method as throwing more than one exception, the exceptions are comma seperated.
   public void foo () throws OneException, TwoException, ThreeException
       }

Similar Messages

  • Exception MDSLockedSessionManager already registered. Can't register more than one.

    I've migrated my application from 11.1.2.1 to 12.1.2 using JDev 12c.
    I can deploy it to my standalone weblogic  without problem.
    But when I access it I get exception:
    java.lang.Exception: MDSLockedSessionManager already registered. Can't register more than one.
            at oracle.adf.share.mds.MDSTransManager.registerMDSLockedSessionManagerInst(MDSTransManager.java:131)
            at oracle.adf.share.mds.MDSTransManager.registerMDSLockedSessionManager(MDSTransManager.java:123)
    The stack trace starts in my custom filter:
        public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException,ServletException {
                chain.doFilter(request, response);
    What do I wrong?
    Thanks,
    Lukas

    Check all meta data in any descriptors. I bet there is a duplicate entry in one of them (e.g. weblogic-application.xml)...
    Timo

  • More than one reference characteristics Exception Aggregation

    Hi All,
    Is it possible to use more than one reference characteristics in reports for Exception Aggregation?
    Thanks In Advance

    Hi PPMM,
    Did you resolve this issue?
    Thanks,
    Pam

  • What is the exception for finding more than one row?

    What is the exception if you do a select and get more than one row? no_data_found is the exception for not finding any, what is the exception for finding "too much". Thx

    Funnily enough there is a complete list of predefined exceptions in the documentation .
    Cheers, APC

  • Upgraded to iOS 6 and now I can't open anything in the kindle app? I have to say that I have had my ipad3 for 6 months and intensely dislike the problems with using it. Also is there any way of opening more than one screen as it is hopeless otherwise?

    I Have had my iPad for 6 months as I cannot access my work emails using windows. I have to say that it is the most unhelpful device I have ever used and although it looks like there isn't an answer for some of the questions I have asked below, I thought I would try!
    1) I have upgraded to ios6 and the kindle app will open but crashes and disappears when I try to access a book?
    2) is there any way I can open more than one page at a time, as opening one at a time is hopeless?
    3) Is there any way you can replicate the right click function on word? As pasting and copying on the iPad is irritating to say the least!
    4) why can't my Samsung 11 phone connect to my iPad via Bluetooth? A they can't seem to 'see' each other? I may have turned a setting off when I was recently abroad and didn't want huge roaming charges.
    5) Why do the submit buttons on some websites not work and how can I get them to? I never have a problem with windows, but it is often a problem with the iPad.
    6) I have several websites which I have built and usually upgrade on the windows desktop, usually through Internet explorer, but I can't access the sites properly on the iPad (I can see them but can't alter them) and when sending emails through the websites they won't show the page and I can't navigate the page (the size of the email page is bigger than the iPad screen, but I can't either shrink the page to size or move the page around as you normally would on the pad, any ideas?
    7) finally, when roaming abroad recently, I had no problems using the wifi, but when trying to use the cellular data (using the roaming function) I could not get it to work? The ipad seemed to be connected to the network with no problems, but wouldn't actually update the emails? I tried turning it on and off, but that didn't make a difference. My kindle and mobile phone (both also on 3G ) worked great, it was just (as usual) the ipad playing up.
    8) when wanting to alter part of a sentence, I can't always get the cursor in the right place? Sometimes it is simple the wrong line, but often it will only go at the end or start of a word and not where I want it. Is there any way of making it more exact? Again I never have a problem with moving the cursor on windows, either by mouse or on the touch screen function on windows 7. Any ideas? As after pressing the screen multiple times I just want to throw it out of the window!
    IT might just be that I don't have the correct settings (I am a technophobe) but I absolutely hate the iPad and only have it for work emails, it is so annoying that I can get my mobile phone and kindle3g to work fine, but always have problems with the iPad. I am sure it could be good (and for reading emails on the go in the uk it is great, as I like the key board) but it just seems to make everything else difficult.
    i Hope you can help and sorry for asking questions others have, but I am just hoping that something new might have been developed!
    thanks,
    K
    Message was edited by: K Paton

    1) I have upgraded to ios6 and the kindle app will open but crashes and disappears when I try to access a book?
    Try rebooting your iPad, that should fix he issue. I that doesn't work, delete the app and re-download it.  The Kindle books should all be in he Kindle cloud services and you can get them again. I have an iPad2 w/ Kindle app and it works just fine - no issues.
    2) is there any way I can open more than one page at a time, as opening one at a time is hopeless?
    Page as in a kindle book way? turn iPad to landscape position from portrait position. If, however, you mean open more than one application at a time, then no. And not hopeless, as it takes a bit of time to get used to, going from a desktop/laptop format to tablet format.
    3) Is there any way you can replicate the right click function on word? As pasting and copying on the iPad is irritating to say the least!
    It's actually fairly easy. Press down on the word, then you can expand by drawing your finger to cover word/sentence/paragraph/page, hit select or select all then it gives you the option to cut, copy, paste, define. If you want to use a word processing app on the iPad, Pages is a good application.
    4) why can't my Samsung 11 phone connect to my iPad via Bluetooth? A they can't seem to 'see' each other? I may have turned a setting off when I was recently abroad and didn't want huge roaming charges.
    It's the connection on your phone. Samsung Galaxy SII? Android software?  What you have to do is go to the phone's settings and connect via wireless, not Bluetooth. Go to System Settings (on phone) and under Wireless and Networks click 'more' and go to the Tethering and Portable Hotspot option. Set up your mobile wifi hotspot,  name it though it will probably come up with 'AndroidAP', choose a WPA2 security level and put in a password. Go back to previous screen and turn on 'Portable Wi-Fi Hotspot' box. Then on your iPad in the Settings - Wi-Fi section, it should then recognize your phone for tethering. If it's a Windows Phone 7,  I don't know the layout of that software, but presumeably similar.
    5) Why do the submit buttons on some websites not work and how can I get them to? I never have a problem with windows, but it is often a problem with the iPad.
    Sometimes the issue is with the website design, not all websites are optimized for mobile devices - not just iPad but also Android devices. It happens. They're getting there, but occasionally the page might need a refresh.
    6) I have several websites which I have built and usually upgrade on the windows desktop, usually through Internet explorer, but I can't access the sites properly on the iPad (I can see them but can't alter them) and when sending emails through the websites they won't show the page and I can't navigate the page (the size of the email page is bigger than the iPad screen, but I can't either shrink the page to size or move the page around as you normally would on the pad, any ideas?
    It depends on what you use to build the websites on the computer. Recommend a free program on the computer called CoffeeCup Free HTML Editor. I don't recommend using IE period; Firefox or Chrome are my choices on Windows machines. I have two websites that I manage, both using this program. I'm assuming that when you mean you can't access the sites on the iPad you mean to update them? Ostensible there are apps to let you do this. What format are the sites? Without seeing what exactly you mean and what you want to do, it's hard to explain.
    As for seeing full page while emailing within a site, turn iPad to portrait mode, and try to finger-pinch touch the screen to see if that will bring the fuller page  into view. Other option is opening a second tab with same website and just go between tabs to reference material.
    7) finally, when roaming abroad recently, I had no problems using the wifi, but when trying to use the cellular data (using the roaming function) I could not get it to work? The ipad seemed to be connected to the network with no problems, but wouldn't actually update the emails? I tried turning it on and off, but that didn't make a difference. My kindle and mobile phone (both also on 3G ) worked great, it was just (as usual) the ipad playing up.
    If you were outside the US or Canada, my guess is the problem lies within the SIM card in your iPad. If you were outside North America, there are different band levels - I'm guessing you have a SIM thats locked to a particular provider. Band level frequencies differ per country/continent, so a SIM card that will work in Canada/US will not likely work in UK/Europe/Asia/Australia, etc. you will be able to get your emails again when back on a wifi network. Mobile phone may have a different type SIM card (GSM/HSPA) from your iPad SIM. Also, check your email settings.
    8) when wanting to alter part of a sentence, I can't always get the cursor in the right place? Sometimes it is simple the wrong line, but often it will only go at the end or start of a word and not where I want it. Is there any way of making it more exact? Again I never have a problem with moving the cursor on windows, either by mouse or on the touch screen function on windows 7. Any ideas? As after pressing the screen multiple times I just want to throw it out of the window!
    Moving the cursor on a sentence is a matter of putting your finger on the screen where you want it. It's exceptionally easy to do. I'm using the Notes app to write this whole segment and I just need to put my finger where I want to change things and presto it's ready for me to change where I want it.
    Here's a solution: sell your iPad (after you wipe your data off it) to someone who will appreciate it, and put your money towards the Windows Surface Tablet out later this year/early next year, where you can (reportedly) connect a mouse to it. It will have some of the Windows 7/8 functionality that you're more familiar with, or get a netbook.
    - Ceridwyn2

  • [Fwd: Client accessing MBeanHome for more than one domain receives SecurityException]

    Fwd'ing to security newsgroup
    -------- Original Message --------
    Subject: Client accessing MBeanHome for more than one domain receives
    SecurityException
    Date: 4 Mar 2004 07:27:33 -0800
    From: Dinesh Bhat <[email protected]>
    Reply-To: Dinesh Bhat <[email protected]>
    Organization: BEA NEWS SITE
    Newsgroups: weblogic.developer.interest.management
    Hi,
    When a client accesses MBeans of more than one domains (Weblogic 8.1)
    that have
    different passwords, it receives a SecurityException. This occurs when
    the MBeanHome
    for each domain is looked up at initialization and reused for each
    request ( to
    access MBeans ). The security exception does not occur if the MBeanHome
    for each
    domain is looked up for each request. On initial review, this behavoir
    seems inconsistent.
    Looking up the MBeanHome for each request may introduce a significant
    overhead.
    I am not sure if concurrent lookups would also cause the same problem.
    I have read on another post that we can work around this problem by
    establishing
    a trust relationship between the servers, but this may not be feasible
    when one
    is monitoring a lot of servers and the overhead of configuration may be
    an issue.
    I have attached code that can reproduce the problem.
    Please advise on the correct approach.
    Thanks
    Dinesh Bhat
    Panacya Inc.
    import java.util.ArrayList;
    import java.util.Set;
    import java.util.HashMap;
    import java.util.Iterator;
    import java.util.Hashtable;
    import javax.management.MBeanServer;
    import javax.naming.Context;
    import weblogic.jndi.Environment;
    import weblogic.management.MBeanHome;
    * This class reproduces the Security Exception that is caused when a client tries to access
    * MBeans of more than one domain with different weblogic passwords. Here is the stacktrace of the
    * exception
    * java.lang.SecurityException: [Security:090398]Invalid Subject: principals=[weblogic, Administrators]
         at weblogic.rjvm.BasicOutboundRequest.sendReceive(BasicOutboundRequest.java:108)
         at weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:138)
         at weblogic.management.internal.AdminMBeanHomeImpl_811_WLStub.getDomainName(Unknown Source)
         at WLSecurityTest.getWeblogicInfo(WLSecurityTest.java:140)
         at WLSecurityTest.runTest(WLSecurityTest.java:75)
         at WLSecurityTest.<init>(WLSecurityTest.java:66)
         at WLSecurityTest.main(WLSecurityTest.java:51)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at com.intellij.rt.execution.application.AppMain.main(Unknown Source)
    Caused by: java.lang.SecurityException: [Security:090398]Invalid Subject: principals=[weblogic, Administrators]
         at weblogic.security.service.SecurityServiceManager.seal(SecurityServiceManager.java:682)
         at weblogic.rjvm.MsgAbbrevInputStream.getSubject(MsgAbbrevInputStream.java:181)
         at weblogic.rmi.internal.BasicServerRef.acceptRequest(BasicServerRef.java:814)
         at weblogic.rmi.internal.BasicServerRef.dispatch(BasicServerRef.java:299)
         at weblogic.rjvm.RJVMImpl.dispatchRequest(RJVMImpl.java:920)
         at weblogic.rjvm.RJVMImpl.dispatch(RJVMImpl.java:841)
         at weblogic.rjvm.ConnectionManagerServer.handleRJVM(ConnectionManagerServer.java:222)
         at weblogic.rjvm.ConnectionManager.dispatch(ConnectionManager.java:794)
         at weblogic.rjvm.t3.T3JVMConnection.dispatch(T3JVMConnection.java:570)
         at weblogic.socket.NTSocketMuxer.processSockets(NTSocketMuxer.java:105)
         at weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:32)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
    * Note: the exception is caused only when the MBeanHome for each domain is cached and used for subsequent
    * transactions. The exception does not occur if the MBeanHome for each domain is looked up for each transaction. This
    * would significant overhead in practice. Also the transactions across the various domains occurs serially, hence
    * the effect of concurrent lookups has to be tested.
    * Usage:
    * This class has been tested with weblogic 8.1
    * The class needs weblogic.jar in its classpath
    * One can specify the weblogic details as System properties. The properties need to be specified in
    * the following format:
    * wls.host.n, wls.userId.n, wls.password.n where n is the weblogix instance number. Also specify
    * the boolean system property reconnect.each.iteration to toggle between reconnecting or not reconnecting
    * for each iteration. When not reconnecting for each iteration, the MBeanHome is reused and the Security Exception
    * occurs.
    * Following is the example of system properties
    * -Dwls.host.0=localhost:7001 -Dwls.userId.0=weblogic -Dwls.password.0=weblogic
    * -Dwls.host.1=localhost:7011 -Dwls.userId.1=weblogic -Dwls.password.1=weblogic1
    * -Dwls.host.2=localhost:7021 -Dwls.userId.2=weblogic -Dwls.password.2=weblogic2
    * -Dreconnect.each.iteration=false
    public class WLSecurityTest
    ArrayList wlsDetailsList = new ArrayList();
    HashMap connectionMap = new HashMap();
    public static void main(String[] args)
    try
    WLSecurityTest wlSecurityTest = new WLSecurityTest();
    catch (Exception e)
    e.printStackTrace();
    * Constructor
    * @throws Exception
    public WLSecurityTest() throws Exception
    int noOfTries = 10;
    getWLSDetails();
    for( int i=0; i <= noOfTries; i++)
    runTest();
    * Runs the test
    private void runTest()
    for (int i = 0; i < wlsDetailsList.size(); i++)
    WLSDetails wlsDetails = (WLSDetails) wlsDetailsList.get(i);
    getWeblogicInfo(wlsDetails);
    * Get Weblogic details from System properties
    * @throws Exception
    private void getWLSDetails() throws Exception
    wlsDetailsList = new ArrayList();
    String hostKeyTmpl = "wls.host";
    String userIdKeyTmpl = "wls.userId";
    String passwordKeyTmpl = "wls.password";
    boolean done = false;
    for (int i = 0; !done; i++)
    WLSDetails wlsDetails = new WLSDetails();
    String hostKey = hostKeyTmpl + "." + Integer.toString(i);
    String userIdKey = userIdKeyTmpl + "." + Integer.toString(i);
    String passwordKey = passwordKeyTmpl + "." + Integer.toString(i);
    wlsDetails.hostName = System.getProperty(hostKey);
    done = (wlsDetails.hostName == null) || (wlsDetails.hostName.length() == 0);
    if (!done)
    wlsDetails.userId = System.getProperty(userIdKey);
    wlsDetails.password = System.getProperty(passwordKey);
    connect(wlsDetails);
    wlsDetailsList.add(wlsDetails);
    * Lookup the MBeanHome for the specified weblogic server
    * @param wlsDetails
    * @throws Exception
    public synchronized void connect(WLSecurityTest.WLSDetails wlsDetails) throws Exception
    Context ctx = null;
    MBeanHome mbHomeLocal = null;
    try
    Environment env = new Environment();
    env.setProviderUrl("t3://" + wlsDetails.hostName);
    env.setSecurityPrincipal(wlsDetails.userId);
    env.setSecurityCredentials(wlsDetails.password);
    Hashtable hashtable = env.getProperties();
    System.out.println(hashtable.toString());
    ctx = env.getInitialContext();
    wlsDetails._mBeanHome = (MBeanHome) ctx.lookup(MBeanHome.ADMIN_JNDI_NAME);
    catch (Exception e)
    e.printStackTrace();
    * Gets weblogic information using MBeans
    * @param wlsDetails
    public synchronized void getWeblogicInfo(WLSDetails wlsDetails)
    try
    boolean reconnectEachIteration =
    Boolean.getBoolean("reconnect.each.iteration");
    if( (reconnectEachIteration) || ((wlsDetails._mBeanHome == null) && (!reconnectEachIteration) ))
    connect(wlsDetails);
    MBeanHome mbHomeLocal = wlsDetails._mBeanHome;
    String domainName = mbHomeLocal.getDomainName();
    Set allMBeans = mbHomeLocal.getAllMBeans();
    System.out.println("Size: " + allMBeans.size());
    Set clusterMBeans = mbHomeLocal.getMBeansByType("Cluster", domainName);
    System.out.println(clusterMBeans);
    MBeanServer mBeanServer = mbHomeLocal.getMBeanServer();
    catch (Exception ex)
    ex.printStackTrace();
    * Class that holds weblogic server details
    class WLSDetails
    String hostName = "";
    String userId = "";
    String password = "";
    MBeanHome _mBeanHome = null;

    If Server version is 61.
    Make user "system" password of all weblogic servers same.
    If Server version above 61(70,81)
    In the Security Advanced Settings un check generated credential and specify a common credentail for all the weblogic servers(domains).

  • More than one entity found for a single-object find method

    Hi everyone...
    I have this error when my webservice is running..I don't know what it means and what would be the best solution..
    <pns:message>More than one entity found for a single-object find method.</pns:message>
    it throws an Exception..
    Thanks!

    = More than one row found in a DB with the "unique" key supplied...
    Your method is returning an object where it should return a collection ?
    Enjoy

  • Testing for more than one command line argument

    Ok im writing a client to access a given server. What i want to happen is to say that if you enter one argument at the command line do this code- if you enter more than one do something else. I cant seem think of how to do this though-ive tried testing if args > 0 but it wont let me do that . Here is the code so far:
    import java.io.*;
    import java.net.*;
    class Whereis2
       public static void main(String args[]) throws Exception
          int c;
          //whois.geektools.com
          Socket s = new Socket("dante.net.dcs.hull.ac.uk",43);
          InputStream in = s.getInputStream();
          OutputStream out = s.getOutputStream();
            String str = args[0] + "\r\n" ;
             // convert string to bytes, unicode to ASCII
             byte buf[] = str.getBytes();
             // send data to server
             out.write(buf) ;
          while ((c = in.read()) != -1)
         System.out.print ((char) c);
          s.close();
    } Basically i want the code written above to happen is you put in one argument-ie Whereis2 Paul for example. But if i put in Whereis2 Paul "In a meeting" I want it to update the server. Can anyone help me to do this?
    Thanks a lot

    And by the way:
    "Where is Paul" (notice the quotation marks) is a single argument with spaces in it.
    Where is Paul (no quotation marks) is three arguments, no spaces.
    PS. Why are you throwing Exception?

  • Does BPEL allow partnerlinks where the WSDL has more than one namespace

    Hi
    I have a WSDL where the schema is in a different namespace than the message types. BPEL Designer throws "Exception: Problem building schema" when accessing the variable in the "Assign" activity. Can someone point out if there is a problem with my WSDL file ?
    <?xml version="1.0" encoding="UTF-8"?>
    <definitions name="ProvWithXSL"
    targetNamespace="http://xmlns.oracle.com/ProvWithXSL"
    xmlns="http://schemas.xmlsoap.org/wsdl/"
    xmlns:client="http://xmlns.oracle.com/ProvWithXSL"
    xmlns:tns="http://www.example.org"
    xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/">
         <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         TYPE DEFINITION - List of services participating in this BPEL process
         The default output of the BPEL designer uses strings as input and
         output to the BPEL Process. But you can define or import any XML
         Schema type and us them as part of the message types.
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
         <types>
              <schema attributeFormDefault="qualified"
                   elementFormDefault="qualified"
    targetNamespace="http://www.example.org"
    xmlns:tns="http://www.example.org">
                   xmlns="http://www.w3.org/2001/XMLSchema">
    <complexType name="EventHdr">
    <sequence>
    <element name="eventType" type="string"/>
    <element name="eventID" type="string"/>
    <element name="eventSrc" type="string"/>
    <element name="objectDN" type="string"/>
    <element name="profileID" type="string"/>
    </sequence>
    </complexType>
    <complexType name="Attribute">
    <sequence>
    <element name="attrname" type="string"/>
    <element name="attrval" type="string" maxOccurs="unbounded"/>
    </sequence>
    </complexType>
    <complexType name="EventAttrs">
    <sequence>
    <element name="attr" type="tns:Attribute" maxOccurs="unbounded"/>
    </sequence>
    </complexType>
    <element name="event">
    <complexType>
    <sequence>
    <element name="hdr" type="tns:EventHdr"/>
    <element name="attrs" type="tns:EventAttrs"/>
    </sequence>
    </complexType>
    </element>
    <element name="ProvWithXSLProcessRequest">
              <complexType>
                   <sequence>
                        <element name="parameters" type="string"/>
                   </sequence>
              </complexType>
         </element>
         <element name="ProvWithXSLProcessResponse">
              <complexType>
                   <sequence>
                        <element name="result" type="string"/>
                   </sequence>
              </complexType>
         </element>
    </schema>
    </types>
         <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         MESSAGE TYPE DEFINITION - Definition of the message types used as
         part of the port type defintions
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
         <message name="ProvWithXSLRequestMessage">
              <!--<part name="payload" element="tns:event"/>-->
    <part name="payload" element="tns:ProvWithXSLProcessRequest"/>
         </message>
         <message name="ProvWithXSLResponseMessage">
              <part name="payload" element="tns:ProvWithXSLProcessResponse"/>
         </message>
         <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         PORT TYPE DEFINITION - A port type groups a set of operations into
         a logical service unit.
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
         <!-- portType implemented by the ProvWithXSL BPEL process -->
         <portType name="ProvWithXSL">
              <operation name="initiate">
                   <input message="client:ProvWithXSLRequestMessage"/>
              </operation>
         </portType>
         <!-- portType implemented by the requester of ProvWithXSL BPEL process
         for asynchronous callback purposes
         -->
         <portType name="ProvWithXSLCallback">
              <operation name="onResult">
                   <input message="client:ProvWithXSLResponseMessage"/>
              </operation>
         </portType>
         <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         PARTNER LINK TYPE DEFINITION
         the ProvWithXSL partnerLinkType binds the provider and
         requester portType into an asynchronous conversation.
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
         <plnk:partnerLinkType name="ProvWithXSL">
              <plnk:role name="ProvWithXSLProvider">
                   <plnk:portType name="client:ProvWithXSL"/>
              </plnk:role>
              <plnk:role name="ProvWithXSLRequester">
                   <plnk:portType name="client:ProvWithXSLCallback"/>
              </plnk:role>
         </plnk:partnerLinkType>
    </definitions>

    You can use more than one namespace (done so before), and several ways to do so.
    But first, there's one error in your schema definition:
    <schema attributeFormDefault="qualified"
    elementFormDefault="qualified"
    targetNamespace="http://www.example.org"
    xmlns:tns="http://www.example.org">
    xmlns="http://www.w3.org/2001/XMLSchema">
    remove the ">" after xmlns:tns. Btw, this will cause the exception to occur as well.
    Why not put your elements in a new schema, like below, and leave the original ports & messages intact, as you don't change anything in it from the original generation. Just add this schema above/below the schema for the messages and it will work just fine.
    hth,
    Mike
    So, you will have a wsdl that looks like:
    <schema attributeFormDefault="qualified"
    elementFormDefault="qualified"
    targetNamespace="http://www.example.org"
    xmlns:tns="http://www.example.org"
    xmlns="http://www.w3.org/2001/XMLSchema">
    <complexType name="EventHdr">
    <sequence>
    <element name="eventType" type="string"/>
    <element name="eventID" type="string"/>
    <element name="eventSrc" type="string"/>
    <element name="objectDN" type="string"/>
    <element name="profileID" type="string"/>
    </sequence>
    </complexType>
    <complexType name="Attribute">
    <sequence>
    <element name="attrname" type="string"/>
    <element name="attrval" type="string" maxOccurs="unbounded"/>
    </sequence>
    </complexType>
    <complexType name="EventAttrs">
    <sequence>
    <element name="attr" type="tns:Attribute" maxOccurs="unbounded"/>
    </sequence>
    </complexType>
    <element name="event">
    <complexType>
    <sequence>
    <element name="hdr" type="tns:EventHdr"/>
    <element name="attrs" type="tns:EventAttrs"/>
    </sequence>
    </complexType>
    </element>
    </schema>     
    <schema attributeFormDefault="qualified"
    elementFormDefault="qualified"
    targetNamespace="http://xmlns.oracle.com/ProvWithXSL"
    xmlns:tns="http://www.example.org"
    xmlns="http://www.w3.org/2001/XMLSchema">
    <element name="ProvWithXSLProcessRequest">
    <complexType>
    <sequence>
    <element name="parameters" type="string"/>
    </sequence>
    </complexType>
    </element>
    <element name="ProvWithXSLProcessResponse">
    <complexType>
    <sequence>
    <element name="result" type="string"/>
    </sequence>
    </complexType>
    </element>
    </schema>

  • Javax.jbi.messaging.MessagingException: More than one operation defined

    Hi,
    i had already implemented a web service consisting of 6 methods that works fine. Now i want to access this service via JBI. Therefore i developed a service assembly containing only of a soap binding component. When i try to access the jbi environment via the inbound endpoint OpenESB throws following exception:
    [#|2006-07-26T16:23:50.531+0200|WARNING|sun-appserver-pe9.0|com.sun.jbi.component.com.sun.httpsoapbc-1.0-2com.sun.jbi.httpsoapbc.embedded.GrizzlyRequestProcessor|_ThreadID=32;_ThreadName=httpWorkerThread-12010-2;_RequestID=a33dbb24-d088-4a6a-9642-96187c32bb36;|Exception in processing request.
    javax.jbi.messaging.MessagingException: More than one operation defined. Unable to resolve operation: {http://service}UseRepositoryService,UseRepository,inbound
         at com.sun.jbi.httpsoapbc.InboundMessageProcessor.execute(InboundMessageProcessor.java:214)
         at com.sun.jbi.httpsoapbc.embedded.GrizzlyRequestProcessor.processAsynchRequest(GrizzlyRequestProcessor.java:214)
         at com.sun.jbi.httpsoapbc.embedded.GrizzlyRequestProcessor.service(GrizzlyRequestProcessor.java:173)
         at com.sun.enterprise.web.connector.grizzly.ProcessorTask.invokeAdapter(ProcessorTask.java:667)
         at com.sun.jbi.httpsoapbc.embedded.JBIGrizzlyAsyncFilter.doFilter(JBIGrizzlyAsyncFilter.java:70)
         at com.sun.enterprise.web.connector.grizzly.async.DefaultAsyncExecutor.invokeFilters(DefaultAsyncExecutor.java:143)
         at com.sun.enterprise.web.connector.grizzly.async.DefaultAsyncExecutor.interrupt(DefaultAsyncExecutor.java:132)
         at com.sun.enterprise.web.connector.grizzly.async.AsyncProcessorTask.doTask(AsyncProcessorTask.java:81)
         at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252)
         at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:75)
    How can i specify in my service assembly that if i send a SOAP request for method X on my client that OpenESB routes this message to the correct Outbound endpoint?
    Thank you
    Thomas

    Hello Andi,
    thanks for your reply. To exclude the soap action error i will post the complete wsdl file now. But in my opinion every operation has its own input and output definition.
    The consumer wsdl:
    <?xml version="1.0" encoding="UTF-8"?>
    <wsdl:definitions targetNamespace="http://service" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://service" xmlns:intf="http://service" xmlns:tns1="http://types" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <!--WSDL created by Apache Axis version: 1.2.1
    Built on Jun 14, 2005 (09:15:57 EDT)-->
    <wsdl:types>
    <schema elementFormDefault="qualified" targetNamespace="http://service" xmlns="http://www.w3.org/2001/XMLSchema">
    <import namespace="http://types"/>
    <element name="loadEcore">
    <complexType>
    <sequence>
    <element name="ecoreId" type="xsd:long"/>
    </sequence>a
    </complexType>
    </element>
    <element name="loadEcoreResponse">
    <complexType>
    <sequence>
    <element name="loadEcoreReturn" type="xsd:base64Binary"/>
    </sequence>
    </complexType>
    </element>
    <element name="loadInstance">
    <complexType>
    <sequence>
    <element name="instanceId" type="xsd:long"/>
    </sequence>
    </complexType>
    </element>
    <element name="loadInstanceResponse">
    <complexType>
    <sequence>
    <element name="loadInstanceReturn" type="xsd:base64Binary"/>
    </sequence>
    </complexType>
    </element>
    <element name="loadInstanceForProject">
    <complexType>
    <sequence>
    <element name="instanceId" type="xsd:long"/>
    </sequence>
    </complexType>
    </element>
    <element name="loadInstanceForProjectResponse">
    <complexType>
    <sequence>
    <element name="loadInstanceForProjectReturn" type="xsd:base64Binary"/>
    </sequence>
    </complexType>
    </element>
    <element name="deleteInstance">
    <complexType>
    <sequence>
    <element name="instanceId" type="xsd:long"/>
    </sequence>
    </complexType>
    </element>
    <element name="deleteInstanceResponse">
    <complexType>
    <sequence>
    <element name="deleteInstanceReturn" type="xsd:boolean"/>
    </sequence>
    </complexType>
    </element>
    <element name="getAllInstancesFromDB">
    <complexType/>
    </element>
    <element name="getAllInstancesFromDBResponse">
    <complexType>
    <sequence>
    <element maxOccurs="unbounded" name="getAllInstancesFromDBReturn" type="tns1:InstancePackageValueBean"/>
    </sequence>
    </complexType>
    </element>
    <element name="saveInstance">
    <complexType>
    <sequence>
    <element name="resourceBytes" type="xsd:base64Binary"/>
    <element name="fileName" type="xsd:string"/>
    </sequence>
    </complexType>
    </element>
    <element name="saveInstanceResponse">
    <complexType>
    <sequence>
    <element name="saveInstanceReturn" type="xsd:boolean"/>
    </sequence>
    </complexType>
    </element>
    </schema>
    <schema elementFormDefault="qualified" targetNamespace="http://types" xmlns="http://www.w3.org/2001/XMLSchema">
    <complexType name="InstancePackageValueBean">
    <sequence>
    <element name="ecoreId" type="xsd:long"/>
    <element name="fileName" nillable="true" type="xsd:string"/>
    <element name="id" type="xsd:long"/>
    <element name="name" nillable="true" type="xsd:string"/>
    <element name="usedModels" nillable="true" type="xsd:string"/>
    </sequence>
    </complexType>
    </schema>
    </wsdl:types>
    <wsdl:message name="loadEcoreRequest">
    <wsdl:part element="impl:loadEcore" name="parameters"/>
    </wsdl:message>
    <wsdl:message name="loadEcoreResponse">
    <wsdl:part element="impl:loadEcoreResponse" name="parameters"/>
    </wsdl:message>
    <wsdl:message name="saveInstanceResponse">
    <wsdl:part element="impl:saveInstanceResponse" name="parameters"/>
    </wsdl:message>
    <wsdl:message name="loadInstanceForProjectResponse">
    <wsdl:part element="impl:loadInstanceForProjectResponse" name="parameters"/>
    </wsdl:message>
    <wsdl:message name="loadInstanceResponse">
    <wsdl:part element="impl:loadInstanceResponse" name="parameters"/>
    </wsdl:message>
    <wsdl:message name="getAllInstancesFromDBRequest">
    <wsdl:part element="impl:getAllInstancesFromDB" name="parameters"/>
    </wsdl:message>
    <wsdl:message name="loadInstanceRequest">
    <wsdl:part element="impl:loadInstance" name="parameters"/>
    </wsdl:message>
    <wsdl:message name="getAllInstancesFromDBResponse">
    <wsdl:part element="impl:getAllInstancesFromDBResponse" name="parameters"/>
    </wsdl:message>
    <wsdl:message name="loadInstanceForProjectRequest">
    <wsdl:part element="impl:loadInstanceForProject" name="parameters"/>
    </wsdl:message>
    <wsdl:message name="saveInstanceRequest">
    <wsdl:part element="impl:saveInstance" name="parameters"/>
    </wsdl:message>
    <wsdl:message name="deleteInstanceRequest">
    <wsdl:part element="impl:deleteInstance" name="parameters"/>
    </wsdl:message>
    <wsdl:message name="deleteInstanceResponse">
    <wsdl:part element="impl:deleteInstanceResponse" name="parameters"/>
    </wsdl:message>
    <wsdl:portType name="UseRepository">
    <wsdl:operation name="loadEcore">
    <wsdl:input message="impl:loadEcoreRequest" name="loadEcoreRequest"/>
    <wsdl:output message="impl:loadEcoreResponse" name="loadEcoreResponse"/>
    </wsdl:operation>
    <wsdl:operation name="loadInstance">
    <wsdl:input message="impl:loadInstanceRequest" name="loadInstanceRequest"/>
    <wsdl:output message="impl:loadInstanceResponse" name="loadInstanceResponse"/>
    </wsdl:operation>
    <wsdl:operation name="loadInstanceForProject">
    <wsdl:input message="impl:loadInstanceForProjectRequest" name="loadInstanceForProjectRequest"/>
    <wsdl:output message="impl:loadInstanceForProjectResponse" name="loadInstanceForProjectResponse"/>
    </wsdl:operation>
    <wsdl:operation name="deleteInstance">
    <wsdl:input message="impl:deleteInstanceRequest" name="deleteInstanceRequest"/>
    <wsdl:output message="impl:deleteInstanceResponse" name="deleteInstanceResponse"/>
    </wsdl:operation>
    <wsdl:operation name="getAllInstancesFromDB">
    <wsdl:input message="impl:getAllInstancesFromDBRequest" name="getAllInstancesFromDBRequest"/>
    <wsdl:output message="impl:getAllInstancesFromDBResponse" name="getAllInstancesFromDBResponse"/>
    </wsdl:operation>
    <wsdl:operation name="saveInstance">
    <wsdl:input message="impl:saveInstanceRequest" name="saveInstanceRequest"/>
    <wsdl:output message="impl:saveInstanceResponse" name="saveInstanceResponse"/>
    </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="UseRepositorySoapBinding" type="impl:UseRepository">
    <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="loadEcore">
    <wsdlsoap:operation soapAction=""/>
    <wsdl:input name="loadEcoreRequest">
    <wsdlsoap:body use="literal"/>
    </wsdl:input>
    <wsdl:output name="loadEcoreResponse">
    <wsdlsoap:body use="literal"/>
    </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="loadInstance">
    <wsdlsoap:operation soapAction=""/>
    <wsdl:input name="loadInstanceRequest">
    <wsdlsoap:body use="literal"/>
    </wsdl:input>
    <wsdl:output name="loadInstanceResponse">
    <wsdlsoap:body use="literal"/>
    </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="loadInstanceForProject">
    <wsdlsoap:operation soapAction=""/>
    <wsdl:input name="loadInstanceForProjectRequest">
    <wsdlsoap:body use="literal"/>
    </wsdl:input>
    <wsdl:output name="loadInstanceForProjectResponse">
    <wsdlsoap:body use="literal"/>
    </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="deleteInstance">
    <wsdlsoap:operation soapAction=""/>
    <wsdl:input name="deleteInstanceRequest">
    <wsdlsoap:body use="literal"/>
    </wsdl:input>
    <wsdl:output name="deleteInstanceResponse">
    <wsdlsoap:body use="literal"/>
    </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="getAllInstancesFromDB">
    <wsdlsoap:operation soapAction=""/>
    <wsdl:input name="getAllInstancesFromDBRequest">
    <wsdlsoap:body use="literal"/>
    </wsdl:input>
    <wsdl:output name="getAllInstancesFromDBResponse">
    <wsdlsoap:body use="literal"/>
    </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="saveInstance">
    <wsdlsoap:operation soapAction=""/>
    <wsdl:input name="saveInstanceRequest">
    <wsdlsoap:body use="literal"/>
    </wsdl:input>
    <wsdl:output name="saveInstanceResponse">
    <wsdlsoap:body use="literal"/>
    </wsdl:output>
    </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="UseRepositoryService">
    <wsdl:port binding="impl:UseRepositorySoapBinding" name="UseRepository">
    <wsdlsoap:address location="http://localhost:12010/service/repository"/>
    </wsdl:port>
    </wsdl:service>
    </wsdl:definitions>
    Except for the service name, port, address etc the provider wsdl is the same.
    Could you tell me if it works when i will only use one operation for example?
    I had already implemented a service assembly which contained only one operation. That SA worked fine.
    If the Service Assembly and Binding Component descriptors had wrong references e.g. the wrong interface-name, would OpenESB throws an exception while deployment?
    In addition, could you tell me a good link to a nice bpel engine example? How is the interaction between client ans service using the bpel engine?
    I think using the SoapBC the interaction is following:
    Client --> BC --> Service
    With Bpel engine?
    Client --> BC --> bpel --> BC2 --> service?
    Thanks a lot
    Thomas

  • How to add more than one input arguments to the tpcall

    Hi
    Can any one know how to add more than one input arguments in the tpcall using WTC (Jatmi)?
    Par example, I have un service Tuxedo getConsoClient(char* cli_id, char* type)
    To call this service, I'm using tpcall("getConsoClient", dataIn, 0);
    here, I did't know how to add two parameters in the TypedBuffer object. I'm new to WTC.
    Any hints will be greatly appreaciated.
    Advanced thanks

    Thanks for you help. But in java Jatmi, I have lot of problem to convert array into TypedBuffer or TypedString. See below code, I'm tried using vector or tableau etc..
    But I have always same erreur. :(
    public void getClientInfo() {
         Context ctx;
         TuxedoConnection myTux;
         TypedString numinst = new TypedString("1");
         TypedString idClient = new TypedString("1003");
         TypedString[] dataIn = {numinst,idClient};
         //TypedString dataIn = new TypedString(numinst+"\0"+idClient+"\0");
         Vector input = new Vector();
         input.add(0,numinst);
         input.add(1,idClient);
         Reply rpy = null;
         try{          
              System.out.println("getClientInfo called : " + dataIn);
              TuxedoConnectionFactory tcf;               
              ctx = new InitialContext();
              tcf = (TuxedoConnectionFactory) ctx.lookup("tuxedo.services.TuxedoConnection");
              myTux = tcf.getTuxedoConnection();          
              System.out.println("About to call tpcall cnx = "+myTux);
              rpy = myTux.tpcall("LireInfoCli_SE",(TypedBuffer)dataIn, 0);          
              System.out.println("tpcall successfull!");
              TypedFML32 typ = (TypedFML32) rpy.getReplyBuffer();
              System.out.println("Reply Type = "+rpy.getReplyBuffer().getType());
              System.out.println("Reply toString = "+typ.toString());
              while(typ.Fiterator().hasNext()){
                   System.out.println("Reply toString = "+typ.Fiterator().next().toString());               
              myTux.tpterm(); // Closing the association with Tuxedo
         }catch (TPReplyException tpx) {
              // Could not get the tuxedo object, throw TPENOENT
              System.out.println("TPReplyException perrno = " + tpx.gettperrno()+" DETAILS "+tpx.gettperrordetail()+" getLocalizedMessage "+tpx.getLocalizedMessage()+" "+tpx.getCause());
              tpx.printStackTrace();
         }catch (TPException tpx1) {
              // Could not get the tuxedo object, throw TPENOENT
              System.out.println("TPReplyException perrno = " + tpx1.gettperrno()+" DETAILS "+tpx1.gettperrordetail()+" getLocalizedMessage "+tpx1.getLocalizedMessage()+" "+tpx1.getCause());
              tpx1.printStackTrace();
         }catch (NamingException ne) {
                   // Could not get the tuxedo object, throw TPENOENT
                   System.out.println("Could not get TuxedoConnectionFactory : " + ne.getMessage());
                   ne.printStackTrace();
         }catch(Exception e){
                   System.out.println("Exception in getClientInfo ->"+e.getMessage());
                   e.printStackTrace();
         return;
    }

  • Sending more than one data to Socket

    Hi Guys
    How can i send more than one data to socket. What i have to do is
    in server side
    1) Want to send file data to socket
    2) and the name of the file to socket
    in client
    1) read the file data from socket
    2) read the file name from the socket
    3) and save the file.
    how can i do this, I know how to send only file data, but i am finding dificuilt to send both.
    please some one help me with sample code.
    Thanks in advance
    Shan

    Thanks for the reply
    the problem i am facing is send the file name and data together . I have modified a code to send the file data, giving the static file name at the client side. Could you please help me to modify the code to send both file name and data from server. I am pasting my code. Sorry to ask like this but i am struggling a lot in this issue. When you are free please help me.
    (Also i don't have any Duke dollers to assign for this post)
    import java.io.*;
    import java.net.*;
    class Server
    public static void main(String args[]) throws Exception
         try{
         String clientSentence;
         ServerSocket welcomeSocket = new ServerSocket(80);
         while(true)
              Socket connectionSocket = welcomeSocket.accept();
              BufferedReader inFromClient = new BufferedReader(new InputStreamReader(connectionSocket.getInputStream()));
              BufferedOutputStream outToClient = new BufferedOutputStream(connectionSocket.getOutputStream());
              System.out.println(inFromClient.readLine());
              int data;
              int totalSizeTransferred = 0;
              int totalSizeRead;
              int PACKET_SIZE = 20480;
              byte[] packet = new byte[PACKET_SIZE];
              System.out.println("reading file...");
              FileInputStream fis = new FileInputStream("36meg.pdf");
              while ((totalSizeRead = fis.read(packet, 0, packet.length)) >= 0)
                   outToClient.write(packet, 0, totalSizeRead);
                   totalSizeTransferred = totalSizeTransferred + totalSizeRead;
                   System.out.println(totalSizeTransferred);
         System.out.println("done reading file...");
         outToClient.close();
         fis.close();
         }catch(Exception ex){}
    import java.io.*;
    import java.net.*;
    class Client
         public static void main(String args[]) throws Exception
              String sentence;
              BufferedReader inFromUser = new BufferedReader(new InputStreamReader(System.in));
              Socket clientSocket = new Socket("194.129.252.65", 80);
              DataOutputStream outToServer = new DataOutputStream(clientSocket.getOutputStream());
              BufferedInputStream inFromServer = new BufferedInputStream(clientSocket.getInputStream());
              sentence = inFromUser.readLine();
              outToServer.writeBytes(sentence + '\n');
              FileOutputStream fos = new FileOutputStream("hello.jpg");
              int totalDataRead;
              int totalSizeWritten = 0;
              int DATA_SIZE = 20480;
              byte[] inData = new byte[DATA_SIZE];
              System.out.println("Begin");
         while ((totalDataRead = inFromServer.read(inData, 0, inData.length)) >= 0)
              fos.write(inData, 0, totalDataRead);
              totalSizeWritten = totalSizeWritten + totalDataRead;
              System.out.println(totalSizeWritten);
              System.out.println("Done");
              fos.close();
              clientSocket.close();

  • Play more than one sound

    I want to write a program that can play more tha one music file(wav).
    I have used threat and mixer(javax.sound.sample.*) but Ican't do this.
    Help me please !!!!!!
    And show me some code example about mixer if can
    Thank you very much !!!!!!!!

    Here is a simple solution for playing more than one sound at the time. It uses two classes where the first is a thread that plays a sound, and the second is a "container" that loads and stores your sounds.
    SoundThread.java
    import javax.sound.sampled.*;
    public class SoundThread extends Thread
        private Clip soundClip = null;
        private int soundIndex = 0;
        private int loopCount = 0;
        private boolean donePlaying = false;
         * Constructor
         * @param acClip Clip The sound clip.
         * @param index int The index of the sound (so that the correct thread can be found when a sound should be stopped.)
        public SoundThread( Clip clip, int index )
            soundIndex = index;
            soundClip = clip;
            soundClip.stop();
            soundClip.flush();
            soundClip.setFramePosition( 0 );
            soundClip.setLoopPoints(0, -1);
            setPriority(Thread.MIN_PRIORITY);
          * Tell the thread to play the sound once and start playback.
         public void playSound()
             loopCount = 0;
             start();
         * Tell the thread to loop the sound and start playing.
        public void loopSound()
            loopCount = Clip.LOOP_CONTINUOUSLY;
            start();
         * Stop playing the sound in this thread.
        public void stopSound()
            soundClip.stop();
            soundClip.flush();
            soundClip.setFramePosition( 0 );
            donePlaying = true;
         * Get the index of this particular sound clip.
         * @return int The index.
        public int getSoundIndex()
            return soundIndex;
         * Has the sound finished playing?
         * @return boolean True iff it's done.
        public boolean isDonePlaying()
            return donePlaying;
         * Play the sound in the thread.
        public void run()
            soundClip.loop( loopCount );
            donePlaying = true;
    SoundPlayer.java
    import javax.sound.sampled.*;
    import java.net.URL;
    import java.util.LinkedList;
    import java.util.Vector;
    public class SoundPlayer
        private Vector<Clip> clipList = null;
        private LinkedList<SoundThread> playerList = null;
         * Constructor
         * Initializes the list of sounds being played and the list of sound clips.
        public SoundPlayer()
            playerList = new LinkedList<SoundThread>();
            clipList = new Vector<Clip>();
         * Add a sound to the list of sounds in the player.
         * @param fileName String The file name (including sub-directories) to the sound.
         * @return int The index of the sound in the list, -1 if it could not be added.
         * @throws UnsupportedAudioFileException The format of the file is unrecognized.
         * @throws LineUnavailableException No output found.
         * @throws IOException Most likely the file could not be found.
        public int setSound( String fileName ) throws Exception
            Clip theClip = getClip(getURL(fileName));
            if ( clipList.add(theClip) == false )
                theClip.flush();
                theClip.close();
                return -1;
            return clipList.indexOf(theClip);
         * Get a reference to a specific sound.
         * @param soundIndex int The internal index of the sound.
         * @return Clip A reference to the sound.
        public Clip getSound( int soundIndex )
            return clipList.elementAt(soundIndex);
         * Play a sound.
         * @param soundIndex int The internal index of the sound to be played.
        public void play( int soundIndex )
            SoundThread player = new SoundThread(getSound(soundIndex), soundIndex);
            playerList.add(player);
            player.playSound();
         * Stop playing all sounds.
        public void stop()
            while ( playerList.isEmpty() == false )
                SoundThread player = playerList.removeFirst();
                player.stopSound();
                player = null;
         * Stop playing a specific looping sound.
         * @param soundIndex int The internal index of the sound to be stopped.
        public void stop( int soundIndex )
            // Create a temporary list for sounds that are playing and should continue to play.
            LinkedList<SoundThread> tempList = new LinkedList<SoundThread>();
            while ( playerList.isEmpty() == false )
                SoundThread player = playerList.removeFirst();
                // This is the sound clip that should be stopped.
                if ( player.getSoundIndex() == soundIndex )
                    player.stopSound();
                // Remove any threads that are done playing.
                if ( player.isDonePlaying() )
                    player = null;
                // Add all other threads to the temporary list.
                else
                    tempList.add(player);
            // Update the player list to the new list.
            playerList = tempList;
         * Loop a sound.
         * @param soundIndex int The internal index of the sound to be played.
        public void loop( int soundIndex )
            SoundThread player = new SoundThread(getSound(soundIndex), soundIndex);
            playerList.add(player);
            player.loopSound();
         * Get an URL to a file inside the current jar archive.
         * @param fileName String The file name, including subdierctory information if applicable.
         * @return URL An URL to the file.
        public URL getURL( String fileName )
            return this.getClass().getClassLoader().getResource(fileName);
         * Load a sound clip from an URL.
         * @param urlResource URL An URL to the sound file.
         * @return Clip A reference to the sound.
        public Clip getClip( URL urlResource ) throws Exception
            Clip theSound = null;
            try
                // Open a stream to the sound.
                AudioInputStream ais = AudioSystem.getAudioInputStream( urlResource );
                // Get the format of the sound clip.
                AudioFormat af = ais.getFormat();
                // Create a line for the sound clip.
                DataLine.Info dli = new DataLine.Info( Clip.class, af, AudioSystem.NOT_SPECIFIED );
                // If the format of the clip is not supported directly then try to transcode it to PCM.
                if ( !AudioSystem.isLineSupported( dli ) )
                    // Create a new PCM audio format for the clip.
                    AudioFormat pcm = new AudioFormat( af.getSampleRate(), 16, af.getChannels(), true, false );
                    // Open a stream to the sound using the new format.
                    ais = AudioSystem.getAudioInputStream( pcm, ais );
                    // Read the format of the clip.
                    af = ais.getFormat();
                    // Create a new line for the sound clip.
                    dli = new DataLine.Info( Clip.class, af );
                // Create the clip, open it, and read its entire contents.
                theSound = ( Clip )AudioSystem.getLine( dli );
                theSound.open( ais );
                theSound.drain();
            catch( Exception ex )
                throw new Exception(urlResource.toString() + "\n" + ex.getMessage());
            // Return a reference to the sound clip.
            return theSound;
          * Destructor
          * Release memory used by loaded sounds.
         public void dispose()
             stop();
             for ( int i = 0; i < clipList.size(); i++ )
                 Clip c = clipList.elementAt(i);
                 c.stop();
                 c.flush();
                 c.close();
             clipList = null;
    }Here is an example of how to use these classes:
        public static final void main( String[] args )
            try
                SoundPlayer sp = new SoundPlayer();
                int clip1 = sp.setSound("clip1.wav");
                int clip2 = sp.setSound("mySounds/clip2.aiff");
                int clip3 = sp.setSound("clip3.au");
                sp.loop( clip1 );
                Thread.sleep( 5000 );
                sp.play( clip2 );
                Thread.sleep( 1000 );
                sp.play( clip3 );
                Thread.sleep( 4000 );
                sp.stop( clip1 );
                sp.dispose();
            catch( Exception ex )
                ex.printStackTrace();
    ...The main weakness of this solution is that if you've got two or more instances of the same sound looping and want only one of them to stop, then, sorry, they're all stopped. There are probably more weak points but these two classes have worked well for my purposes so far.
    Hope this solves at least part of your problem.
    Hjalti
    PS. I have assembled these two classes from code snippets and examples found here and there on the Web so I'm in no way claiming to be the original author of all of this code. Unfortunately I haven't registered where it all came from so I'm unable to give credit where credit is due.

  • How can I use more than one Data Provider in my web Apps

    I am trying to use two different data provider in my web apps to run two different queries from the same table ,the data provider A is working correctly but when I attempt to run data provider B ,It display an error page ,here is the error message : Exception Details :javax.servlet.ServletEx ception
    java.lang.RuntimeException: java.sql.SQLException : Cannot connect .Both dataSourceName and url properties are null.

    Hi,
    You can use more than one data provider in your application. However if you have defined a dataprovider for a particular table already, and wish to bind a component, select the component and use its context menu to Bind to Data...

  • Encore can't burn more than one DVD at a time: Sense Code 56400

    For a long time now I've been unable to burn multiple DVD's at a time. I burn more than one and I get an error and have to make a coaster out of yet another DVD
    I just upgraded to 24 gb of DDR3 PC 1600 RAM, I have an 6 Core Processor, I have 7.8 on everything accept my hard drive which is 7.0 out of 7.9 according to my Windows 7 Pro. 64 bit system.
    I have 2 different DVD burners, one is a blu-ray burner too. I have the same issues, only different error readings it seems, on both drives. The first drive didn't burn even one for some reason so I tried the second. The second drive would burned 3 and on the fourth I got the errors' which I've included screen shots of below. I was surprised I got through three before I got to this error. By the end of the week I have a large project I need to make 30 DVD's of. HELP!!!!!
    A long time ago on my older machine I had similar problems and I went through different drives and discs until I seemed to come up with the magic combination which seemed to be a Plextor burner and Verbatim. But, then i got a bad batch of verbatim and tried Maxell and used those successfully for a while. Right now I'm using what a friend gave me, TDK's. I'm wondering if that's what the problem is... HELP!!!!

    I have managed to get it to work consistently now. I just burned 20 DVD's without a problem.
    I tried everything you suggested except the imageburn software. I didn't like that site, I was too anxious to try and figure out where to download that software in the midst of all the advertisements on that site.
    After clearing out everything in startup and services except what I needed I still wasn't able to burn successfully. Finally I went and purchased some Verbatim DVD-R discs and wahlah! Actually, after the first try with the verbatim I had an error code when trying to burn with Encore. So, I created and image file as you suggested and then I used Cyberlink's Power2Go to burn the image file and from there on it seems everything is solid.
    I think the biggest problem was using TDK discs. I came to the realization a few years ago that certain disks are not as predictable as others and that verbatim and maxell seem to be the best. I did get one bad batch of verbatim though one time and that's when I switched to Maxell. My friend gave me 200 of the TDK's and I've been having problems ever since. But, I wasn't sure what it was exactly because he gave me those around the same time I rebuilt my system.
    I had also found the Plextor seems to be the best bet for burners. But, I had been using an HP one lately and thought maybe that was the problem. However, now it seems to be fine.
    I really don't know what fixed it. I mean, nothing definitely worked until I started using the Verbatim today. But, that first verbatim erroring perplexed me. I had done some other things too, like removed some programs, like a bunch of HP printer crap. I even removed my virus software, Window Security Essentials. I just reinstalled it so now I'm wondering if I can burn as consistently. I had seen somewhere where someone said they removed Windows' Defender to get theirs working.
    Anyways, I guess what I need to do is format my main hard drive, only put adobe stuff on it, and then take my old computer set it up for everything else. That'll probably be the best thing to do... If I have anymore problems like this I'm doing that right away!

Maybe you are looking for

  • Password protected document created in Acrobat XI (Mac) can't be opened by Reader XI (Windows)

    I have a document that I created and password protected using Acrobat 11.0.2 (Mac). I can open it with the same password using Reader 11.0.2 (Mac) but not Reader 11.0.2 (Windows).  On Windows I get an "invalid password" message. Anyone else found thi

  • IPhone registration...

    I was wondering how to get back to the iPhone registration screen... I don't suppose it's very important, however, I would like to know if you can get back... For some reason it's annoying me that I can't find how to get back! I am talking about the

  • Unable to uninstall itunes so can update

    I've been trying to udate itunes kept getting error & Now trying to follow dirctions by apple forum to uninstall ad then re-install itunes. Now I can not uninstall the componet "Apple Software Update" & "Apple Mobile Device" when I try to uninstall I

  • Long standing issue with Caller Display

    Hello, I hope someone may be able to help. We have had no caller display service since just before Christmas, some six or so weeks ago now. I must have called 151 nearly 10 times, received several calls back, one visit from Openreach, made three BT c

  • How to swap two primitive dataelements using swap function??

    How to write a swap function that can swap two integer..??