Hiding a JDialog invoked in a Thread.

Hi,
I have a Swing application that starts a Thread that in turn creates a modal JDialog. I need to use the Thread so that I can wait around for information entered in the Dialog while leaving the rest of the application interactive. However, when I do this, any attempt I try (hide and setVisible(false)) to remove the dialog visibly from the screen fails. I initialize the Dialog with null as the Parent frame. Is that my problem, or am I doing something else wrong?
Thanks,
Jason Mazzotta

Generally you can close the dialog only from the event-dispatching thread. If you want to do it from another thread, you have to do the following:
instead of calling
setVisible( false );call
        SwingUtilities.invokeLater(
        new Runnable()
            public void run()
                 waitDlg.setVisible( false );

Similar Messages

  • Hiding fields in phtmlb:formLayout (new thread)

    Original Thread:
    hiding fields in a bsp...
    What Kevin is talking about, is some special development we did for HR eRecruitement. Well, let us turn it around. They helped us, and we returned the favour. And yes, this is actually some of the more interesting bits and pieces of BSP. (Fresh meat to discuss:).
    Effectively, the <phtmlb:formLayout> has two functionalities. The first is a very easy way to layout a form. The second is a way via customization to dynamically have customers overwrite the visibility/required property of each field. So the SAP puts the maximum number of fields into the formlayout, and the customer can then via customization remove some, flag some as required, etc.
    (If anybody should feel like writing a long weblog on this, I will provide technical detail, plus examples offline.)
    The interesting database tables are these PHTMLB_FLI* ones. Part of the agreement was that the application itself provides for a UI to update the table. Also, the application itself controls which fields are changable.
    If you really want to play, look at SBSPEXT_PHTMLB, the formLayout example. In the top part, there are also a serious of dropdown listboxes. What these do, is that they update the customization tables first, before the formlayout is rendered. So what you are seeing is actually the formlayout as it has been programmed, plus then the effects of a (customer) customization on it.
    Also the example shows the effect of using an XML bee to dynamically add entries into the fieldLayout (if the application added these hooks).
    brian

    Hallo Thomas,
    No, unfortunately we never build something to also customize the labels. They HR colleagues did not ask for this :).
    I first started to write you here a loong text with answers. But then I got lazy, and searched my archive mailbox. Here below is the <b>draft</b> input that I wrote initially for the documentation. It describes everything pretty good. (But it is draft document, never proofread again, so read it lightly!)
    bye, brian
    <u><b>Why?</b></u>
    Typically when an application is developed at SAP, the developer must make provision for all possible fields of information that must be displayed and/or queried from the user. However, in specific business cases, or depending on specific country laws, all fields might not be required. Also in some cases, fields in one scenario can be flagged required, versus in another they are only optional.
    The typical starting point will be a complete formlayout done during the development. On top of this a customization layer is placed. The automatic reading and applying of the customization layer is automatically done by the phtmlb fL.
    <b><u>What?</u></b>
    For each field, a default behaviour is assumed. This is the behaviour that is defined by the developer during development time. For example, it could be specified that email address must be required. During the runtime it is now possible to overwrite the default behaviour with a customization entry for the field.
    The following options are supported:
    <b>As Defined:</b> The formLayoutItem in displayed as it has been defined during development.
    <b>Invisible:</b> The formLayoutItem is not placed on the formLayout. It is immediately removed. All following items below it, will be moved up to fill its position.
    <b>Hidden:</b> In this case, the formLayoutItem is placed on the formLayout, but not displayed. The item reserves its slot, and an empty slot will be displayed. However, after all items have been placed on the formLayout, a row "compression" is done, whereby all rows that contain only hidden elements are removed. Hidden is important for cases where columns next to one another must align. A typical example would be name & surname horizontally aligned. If now one item is invisible before this row, the two items will not be aligned anymore. With hidden, this alignment will be kept, and we still have the benefit of empty rows been removed.
    <b>Required:</b> Sets the required flag for the item. Label of item will be rendered an indication that it is required (usually little red asterix after the label).
    <b>Optional:</b> Can be used to customize a required field to be not required.
    <b>Read Only:</b> Field value is only displayed.
    <u><b>What is index?</b></u>
    Customization is stored for a formLayout under the key that is build from the BSP application namespace, BSP application name, plus the page/view on which the formLayout is placed. It is assumed that there will only be one formLayout per view. A typical example would be:
         SAP/SBSPEXT_PHTMLB/FORMLAYOUTSAMPLE.HTM
    In addition, a customization key must be specified. Typical examples would be to say this is the default customization for USA, or for the specific branchen Losuegn. The customization key must be supplied with the <phtmlb:fL> tag, and only then will the customization data be read from the database.
    <b><u>Tables</u></b>
    For customization there are three interesting tables.
    The first table PHTMLB_FLI is completed by the developer, and defines a list of all the formLayout items that can be customized. Only for those flItems which customization is possible, will entries be made in this table. The table contains three components:
    <b>NS_APPL_PAGE</b> This is the unique key that identies the formLayout, consisting of namespace, application and page/view.
    <b>FLI_ID</b> Id string of the specific formLayoutItem.
    <b>COMPONENT</b> This is software component to which development applies, for example SAP_BASIS for all BSP development work done by us.
    The second table PHTMLB_FLI_TEXT is just a language dependant text table that describes each item in the formLayout.
    The tables PHTMLB_FLI and PHTMLB_FLI_TEXT are not using during the runtime. They are only of interest for design time. Note that NO tools are provided to make any entries in these tables. This is considered to be in the application domain, and will usually be part of the customization process of the application.
    The third table PHTMLB_FLI_CUST is the only table that is read during the runtime. It is assumed that a customization tool has made the relevant entries for this table.
    <b>NS_APPL_PAGE</b> see above
    <b>VARIANT_KEY</b> This is the specific customization layer that is currently active. This string is equavalent to <pthmlb:fL  customizationKey>. It is used to pull a specific customization.
    <b>FLI_ID</b> see above
    <b>MODIFIER</b> This is the new value to apply. For the possible values, see DDIC domain PHTMLB_FLI_MODIFIER.
    For an example of customization, see BSP application SBSPEXT_PHTMLB, pages formLayout.htm. In this example, the customization can quickly be set via dropdown listboxes. On each request the PHTMLB_FLI_CUST is quickly updated and then the formLayout will find the set of new customization data to use.

  • Invoking notifyAll() on threads in a vector??

    Each time I create a thread it gets added to a vector v. In the run method
    of this thread I have a flag. If this flag for some reason is set to true
    then that current thread will be set to wait:
    run(){
              if (flag_wait){
                  synchronized(this){
                  try{
                      flag_wait = false;
                      wait();
                  catch(InterruptedException e){}
    }If I create two threads and sets their flag_wait to true, I will now in my
    vector v have two threads that are waiting at index 0 and index 1.
    Now I create a third thread that should only notify thread a index 1.
    Therefore I would like to have another type of thread that has a reference
    to this vector and this in its run method:
    run(){
              if (flag_notify){
                  synchronized(this){
                  try{
                      flag_notify = false;
                      v.get(1).notifyAll(); // now only thread at index 1 should
    be notified!
                  catch(InterruptedException e){}
    }But for some reason I cannot run notifyAll() on a thread in a vector!
    Hope its possible to understand

    I'm not sure you can do that (at least not the way you've described). notify() and notifyAll() does not provide a way for you to specify which thread will be notified. Assumimg your thrid thread has the object monitor, a call to notify() will notify a single thread (The choice is arbitrary and occurs at the discretion of the implementation.) A call to notifyAll() will notify all threads.
    Also, you're doing thread.notifyAll(). But wait() is called on the current object. Per the API, the wait() method Causes current thread to wait until another thread invokes the notify() method or the notifyAll() method for this object.
    When you call wait, the current thread releases the monitor of the current object and waits in the pool of waiting threads for the current object. You need to call notify() or notifyAll() on the object within whose pool the thread is waiting.
    What you have done is:
    1. Force thread A to wait in the pool of the CURRENT OBJECT
    2. Force thread B to wait in the pool of the CURRENT OBJECT
    3. Call notify on thread A (this will notify all threads that are waiting in the pool of THREAD A). Though I suspect you are getting an IllegalMonitorException with that call since you may not have the monitor for thread A at that point.
    Hope this helps.

  • Problem with JDialogs and Threads

    Hi. I'm new to this forum and I hope I'm not asking a repeat question. I didn't find what I needed after a quick search of existing topics.
    I have this problem with creating a new JDialog from within a thread. I have a class which extends JDialog and within it I'm running a thread which calls up another JDialog. My problem is that the JDialog created by the Thread does not seem to function. Everything is unclickable except for the buttons in the titlebar. Is there something that I'm missing out on?

    yeah, bad idea, don't do that.

  • Java API - EventHandler threads not getting killed

    Hello everybody,
    I didn't know whether to post this in the PI forum or in the MDM forum. I use the following scenario:
    We run an EJB session bean in the Java Proxy environment of PI 7.1. In this bean we create an MDM session, log on to a repository and then attach a RecordListener that reacts to any change of the records. When an interesting change took place, the record is distributed to PI.
    The code looks like this:
    EventDispatcher evDis = new EventDispatcher(servername);
    RecordListener recLis = new RecordListener();
    evDis.registerDataNotifications(username, password, repIdent, regions[0]);
    evDis.addListener(recLis);
    The problem arises when we try to undeploy or stop the application. You would assume that it would stop everything connected to the application. However, it does not. The mentioned EventDispatcher creates a thread object when invoked, and this thread is never killed. The consequence: Records keep getting distributed as if nothing had happened, although the application is gone (even undeploying doesn't help). But when we redeploy the application, a new thread is created. So after some development you get 10 or more threads firing every change to PI. The only thing that helps is a restart of the J2EE engine.
    So, my question: Has anybody here made a similar experience? Is this common for MDM or is rather PI the cause of this issue?
    Any comments on that are very welcome.
    Best regards,
    Jörg

    Hi Veera,
    thanks a lot, that pot me on the right track! In fact, it's the @PreDestroy annotation which has to be used for some cleanup method. When we execute this and included the coding you mentioned the threads are killed properly.
    Currently we're facing the issue that somehow the commit status of the bean is not set to "Committed" and from the second message on we get exceptions. If anybody came across this, help is appreciated.
    Best regards,
    Jörg

  • One thread adding/updating value  and other thread getting values....issue

    am using a spring bean (singleton) and this is how it looks like
    public class MySingletonService {
    private Map<String, List<TaskVO>> alerts = new HashMap<String, List<TaskVO>>();
    //spring will call this method every 15 minutes
    public void pollDatabase() {
    //initialize the alerts instance variable and create/fill the alerts instance variable with new alerts for the employee(from database) .The key for the hashmap is the employee id
    //some client code (e.g. GUI) will call this method to get the alert for the operator id.This can be called anytime to get the latest info from the alert Map
    public List<TaskAlertVO> getOutstandingAlerts(String operatorId) {
    return alerts.get(operatorId);
    The issue here is that when getOutstandingAlerts is invoked by a thread,some other thread(Spring) calling the pollDatabase method might be updating the value.Please give me some idea and solution to get around this issue.
    I was thinking of creating a copy of alerts instance variable in the getOutstandingAlerts method and then use the copy to find the key and return the alert for that operator id.This way we dont have to worry about data conflict.
    Please advice

    Manjit wrote:
    jtahlborn wrote:
    if the pollDatabase() method is getting a complete new copy of the alerts every time, and the alerts map isn't being modified at all after load, then you can just:
    - make the alerts member variable volatible
    - create a new HashMap each time pollDatabase() is called, fill it in, and then assign it to the alerts member variable. Jtalhorn,I think I got your point.Basically you are suggesting that by creating a brand new map in each pollDatabase operation, then I dont have to worry about get operation ,simply because the client code is still looking at old memory location(old copy) and hence should not worry about values getting changes by pollDatabase method.
    I got it.
    But the small doubt is that why even I should bother about making the instance variable volatile ? Your suggestion should work without making it volatilebecause volatile ensures correct memory visibility between threads. if you didn't use volatile, then a caller to getOutstandingAlerts() could see some partially initialized/corrupt version of the map.

  • Java synchronization mechanism allows two threads to hold the same lock?

    Dear all,
    I am a little bit puzzled since I cannot explain why I get the following behavior.
    I have a small Java program to draw components. The drawings are cached in the memory for performance improvements. The cache is access by two different threads. Now the funny thing: even I synchronized every access to the cache, I still get ConcurrentModificationExceptions.
    Here is a part of the code:
         @Override public void paint(Graphics g2) {
              // Check if the image is in the cache
              Image drawing;
              synchronized (m_Cache) { drawing = m_Cache.get(m_CurrentOffset); }
              if (drawing == null) {
                   // The image is not cached, so draw it
                   // Put the image into the cache
                   synchronized (m_Cache) { m_Cache.put(m_CurrentOffset, drawing); }
         public void componentResized(ComponentEvent e) {
              // Upon resizing of the component, adjust several pre-calculated values
              // And flush the cache
              synchronized (m_Cache) { m_Cache.clear(); }
         public void elementUpdated(IHexGridElement Element) {
              // Clear cache where the element may be contained at
              synchronized (m_Cache) { for (Point p : m_Cache.keySet()) { if (isElementInScope(Element.getIndex(), p, new Point(p.x + m_MaxColumn, p.y + m_MaxRow))) { m_Cache.remove(p); } } }
         }The paint and componentResized methods are invoked by the AWTEventQueue-0 thread. The elementUpdated method is invoked by "MyThread" thread.
    Now my question is why do I get java.util.ConcurrentModificationException, especially in situations where a lot of repaintings have to be done and the window is resized? When I remove the caching stuff, everything works perfect, but only a little bit slow.
    Thanks for any help.

    In your elementUpdated method, you are using an Iterator to walk over the set of keys in your map. You can't see the Iterator, because you are using the new for-each loop syntax which hides it from you - but it's there under the covers. You are then removing elements from your map directly. This is what causes your ConcurrentModificationException.
    You should re-write your loop to explicitly use an iterator, and then do your remove operation through the iterator.
    Incidentally, you have a slight race condition in your paint method. Two (or more) threads could simultaneously discover that a given image is not cached, then both draw it, then both cache it. If the drawing operation produces the same drawing every time, then the only problem this causes is the overhead of drawing the image multiple times. To fix this, wrap the get, draw and put operations in a single synchronized block.

  • Problem when invoking a web service multiple times

    Hello,
    I have a java client which invokes an apache axis web service (deployed on an Oracle Application Server on a remote machine) multiple times.
    The client distributes the web service invokes among multiple threads, every thing goes well but after an average of 300 web service invokes (among all threads) ab exception is thrown from the client:
    java.net.SocketException: Unable to establish connection
    at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
    at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:154)
    at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
    at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:11
    at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
    at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
    at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
    at org.apache.axis.client.Call.invoke(Call.java:2767)
    at org.apache.axis.client.Call.invoke(Call.java:2443)
    at org.apache.axis.client.Call.invoke(Call.java:2366)
    at org.apache.axis.client.Call.invoke(Call.java:1812)
    at standardwebservice.StandardWebserviceSoapBindingStub.getStandardWebserviceData(StandardWebserviceSoapBindingStub.java:225)
    at standardwebservice.StandardWebserviceProxy.getStandardWebserviceData(StandardWebserviceProxy.java:50)
    at main.VericalThread.run(VericalThread.java:65)
    Caused by: java.net.SocketException: Unable to establish connection
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(Unknown Source)
    at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
    at java.net.PlainSocketImpl.connect(Unknown Source)
    at java.net.SocksSocketImpl.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.axis.components.net.DefaultSocketFactory.create(DefaultSocketFactory.java:153)
    at org.apache.axis.components.net.DefaultSocketFactory.create(DefaultSocketFactory.java:120)
    at org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.java:191)
    at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:404)
    at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:13
    ... 12 more
    Thread No. 1 Start for calling 1210ZD106MAT2AAxisFault
    faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
    faultSubcode:
    faultString: java.net.SocketException: Unable to establish connection
    faultActor:
    faultNode:
    faultDetail:
    {http://xml.apache.org/axis/}stackTrace:java.net.SocketException: Unable to establish connection
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(Unknown Source)
    at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
    at java.net.PlainSocketImpl.connect(Unknown Source)
    at java.net.SocksSocketImpl.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.axis.components.net.DefaultSocketFactory.create(DefaultSocketFactory.java:153)
    at org.apache.axis.components.net.DefaultSocketFactory.create(DefaultSocketFactory.java:120)
    at org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.java:191)
    at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:404)
    at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:13
    at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
    at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:11
    at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
    at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
    at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
    at org.apache.axis.client.Call.invoke(Call.java:2767)
    at org.apache.axis.client.Call.invoke(Call.java:2443)
    at org.apache.axis.client.Call.invoke(Call.java:2366)
    at org.apache.axis.client.Call.invoke(Call.java:1812)
    at standardwebservice.StandardWebserviceSoapBindingStub.getStandardWebserviceData(StandardWebserviceSoapBindingStub.java:225)
    at standardwebservice.StandardWebserviceProxy.getStandardWebserviceData(StandardWebserviceProxy.java:50)
    at main.VericalThread.run(VericalThread.java:65)
    By the way, when I deploy the same web service on an oracle application server on a local machine (in same physical network), every thing goes well and this exception doesn't appear.
    By the way, I also tried a JAX-RPC web service and the same exception is thrown.
    So please can somebody give me a help.

    Hello,
    I have a java client which invokes an apache axis web service (deployed on an Oracle Application Server on a remote machine) multiple times.
    The client distributes the web service invokes among multiple threads, every thing goes well but after an average of 300 web service invokes (among all threads) ab exception is thrown from the client:
    java.net.SocketException: Unable to establish connection
    at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
    at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:154)
    at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
    at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:11
    at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
    at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
    at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
    at org.apache.axis.client.Call.invoke(Call.java:2767)
    at org.apache.axis.client.Call.invoke(Call.java:2443)
    at org.apache.axis.client.Call.invoke(Call.java:2366)
    at org.apache.axis.client.Call.invoke(Call.java:1812)
    at standardwebservice.StandardWebserviceSoapBindingStub.getStandardWebserviceData(StandardWebserviceSoapBindingStub.java:225)
    at standardwebservice.StandardWebserviceProxy.getStandardWebserviceData(StandardWebserviceProxy.java:50)
    at main.VericalThread.run(VericalThread.java:65)
    Caused by: java.net.SocketException: Unable to establish connection
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(Unknown Source)
    at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
    at java.net.PlainSocketImpl.connect(Unknown Source)
    at java.net.SocksSocketImpl.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.axis.components.net.DefaultSocketFactory.create(DefaultSocketFactory.java:153)
    at org.apache.axis.components.net.DefaultSocketFactory.create(DefaultSocketFactory.java:120)
    at org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.java:191)
    at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:404)
    at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:13
    ... 12 more
    Thread No. 1 Start for calling 1210ZD106MAT2AAxisFault
    faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
    faultSubcode:
    faultString: java.net.SocketException: Unable to establish connection
    faultActor:
    faultNode:
    faultDetail:
    {http://xml.apache.org/axis/}stackTrace:java.net.SocketException: Unable to establish connection
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(Unknown Source)
    at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
    at java.net.PlainSocketImpl.connect(Unknown Source)
    at java.net.SocksSocketImpl.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.axis.components.net.DefaultSocketFactory.create(DefaultSocketFactory.java:153)
    at org.apache.axis.components.net.DefaultSocketFactory.create(DefaultSocketFactory.java:120)
    at org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.java:191)
    at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:404)
    at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:13
    at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
    at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:11
    at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
    at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
    at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
    at org.apache.axis.client.Call.invoke(Call.java:2767)
    at org.apache.axis.client.Call.invoke(Call.java:2443)
    at org.apache.axis.client.Call.invoke(Call.java:2366)
    at org.apache.axis.client.Call.invoke(Call.java:1812)
    at standardwebservice.StandardWebserviceSoapBindingStub.getStandardWebserviceData(StandardWebserviceSoapBindingStub.java:225)
    at standardwebservice.StandardWebserviceProxy.getStandardWebserviceData(StandardWebserviceProxy.java:50)
    at main.VericalThread.run(VericalThread.java:65)
    By the way, when I deploy the same web service on an oracle application server on a local machine (in same physical network), every thing goes well and this exception doesn't appear.
    By the way, I also tried a JAX-RPC web service and the same exception is thrown.
    So please can somebody give me a help.

  • Bpel- Error invoking Webservice

    Hi
    Getting error message while invoking a webservice from Bpel.
    The service is deployed in local, hence have given the localhost in wsdl url.
    http://localhost:8081/PASJava/ExposedComputation?wsdl
    <messages>
    <input>
    <Invoke2_processExposedComputation_InputVariable>
    <part name="parameters">
    <processExposedComputation/>
    </part>
    </Invoke2_processExposedComputation_InputVariable>
    </input>
    <fault>
    <bpelFault>
    <faultType>0</faultType>
    <remoteFault>
    <part name="summary">
    <summary>oracle.fabric.common.FabricInvocationException: Unable to access the following endpoint(s): http://localhost:8081/PASJava/ExposedComputation</summary>
    </part>
    <part name="detail">
    <detail>Unable to access the following endpoint(s): http://localhost:8081/PASJava/ExposedComputation</detail>
    </part>
    <part name="code">
    <code>null</code>
    </part>
    </remoteFault>
    </bpelFault>
    </fault>
    <faultType>
    <message>0</message>
    </faultType>
    </messages>
    Pls suggest.

    The error message is :
    <Error> <oracle.soa.bpel.engine.dispatch> <AdminServer> <orabpel.invoke.pool-4.thread-15> <<anonymous>> <> <1b8b91afeba98e17:-7d3b7bde:139e761e976:-8000-0000000000005636> <1348224359520> <BEA-000000> <failed to handle message
    com.oracle.bpel.client.BPELFault: faultName: {{http://schemas.oracle.com/bpel/extension}remoteFault}
    messageType: {{http://schemas.oracle.com/bpel/extension}RuntimeFaultMessage}
    parts: {{
    summary=<summary>oracle.fabric.common.FabricInvocationException: Unable to access the following endpoint(s): http://localhost:8081/PASJava/ExposedComputation</summary>
    ,detail=<detail>Unable to access the following endpoint(s): http://localhost:8081/PASJava/ExposedComputation</detail>
    ,code=<code>null</code>}
         at com.collaxa.cube.ws.WSInvocationManager.invoke(WSInvocationManager.java:338)
         at com.collaxa.cube.engine.ext.common.InvokeHandler.__invoke(InvokeHandler.java:1059)
         at com.collaxa.cube.engine.ext.common.InvokeHandler.handleNormalInvoke(InvokeHandler.java:586)
         at com.collaxa.cube.engine.ext.common.InvokeHandler.handle(InvokeHandler.java:130)
         at com.collaxa.cube.engine.ext.bpel.common.wmp.BPELInvokeWMP.__executeStatements(BPELInvokeWMP.java:74)
         at com.collaxa.cube.engine.ext.bpel.common.wmp.BaseBPELActivityWMP.perform(BaseBPELActivityWMP.java:158)
         at com.collaxa.cube.engine.CubeEngine.performActivity(CubeEngine.java:2543)
         at com.collaxa.cube.engine.CubeEngine._handleWorkItem(CubeEngine.java:1165)
         at com.collaxa.cube.engine.CubeEngine.handleWorkItem(CubeEngine.java:1071)
         at com.collaxa.cube.engine.dispatch.message.instance.PerformMessageHandler.handleLocal(PerformMessageHandler.java:73)
         at com.collaxa.cube.engine.dispatch.DispatchHelper.handleLocalMessage(DispatchHelper.java:220)
         at com.collaxa.cube.engine.dispatch.DispatchHelper.sendMemory(DispatchHelper.java:328)
         at com.collaxa.cube.engine.CubeEngine.endRequest(CubeEngine.java:4430)
         at com.collaxa.cube.engine.CubeEngine.endRequest(CubeEngine.java:4361)
         at com.collaxa.cube.engine.CubeEngine._createAndInvoke(CubeEngine.java:698)
         at com.collaxa.cube.engine.CubeEngine.createAndInvoke(CubeEngine.java:555)
         at com.collaxa.cube.engine.delivery.DeliveryService.handleInvoke(DeliveryService.java:673)
         at com.collaxa.cube.engine.ejb.impl.CubeDeliveryBean.handleInvoke(CubeDeliveryBean.java:293)
         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:597)
         at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
         at com.bea.core.repackaged.springframework.jee.intercept.MethodInvocationInvocationContext.proceed(MethodInvocationInvocationContext.java:104)
         at oracle.security.jps.ee.ejb.JpsAbsInterceptor$1.run(JpsAbsInterceptor.java:94)
         at java.security.AccessController.doPrivileged(Native Method)
         at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
         at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
         at oracle.security.jps.ee.ejb.JpsAbsInterceptor.runJaasMode(JpsAbsInterceptor.java:81)
         at oracle.security.jps.ee.ejb.JpsAbsInterceptor.intercept(JpsAbsInterceptor.java:112)
         at oracle.security.jps.ee.ejb.JpsInterceptor.intercept(JpsInterceptor.java:105)
         at sun.reflect.GeneratedMethodAccessor793.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
         at com.bea.core.repackaged.springframework.jee.intercept.JeeInterceptorInterceptor.invoke(JeeInterceptorInterceptor.java:69)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
         at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
         at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
         at com.bea.core.repackaged.springframework.jee.spi.MethodInvocationVisitorImpl.visit(MethodInvocationVisitorImpl.java:37)
         at weblogic.ejb.container.injection.EnvironmentInterceptorCallbackImpl.callback(EnvironmentInterceptorCallbackImpl.java:54)
         at com.bea.core.repackaged.springframework.jee.spi.EnvironmentInterceptor.invoke(EnvironmentInterceptor.java:50)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
         at com.bea.core.repackaged.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
         at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
         at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
         at com.bea.core.repackaged.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
         at $Proxy274.handleInvoke(Unknown Source)
         at com.collaxa.cube.engine.ejb.impl.bpel.BPELDeliveryBean_5k948i_ICubeDeliveryLocalBeanImpl.__WL_invoke(Unknown Source)
         at weblogic.ejb.container.internal.SessionLocalMethodInvoker.invoke(SessionLocalMethodInvoker.java:39)
         at com.collaxa.cube.engine.ejb.impl.bpel.BPELDeliveryBean_5k948i_ICubeDeliveryLocalBeanImpl.handleInvoke(Unknown Source)
         at com.collaxa.cube.engine.dispatch.message.invoke.InvokeInstanceMessageHandler.handle(InvokeInstanceMessageHandler.java:35)
         at com.collaxa.cube.engine.dispatch.DispatchHelper.handleMessage(DispatchHelper.java:140)
         at com.collaxa.cube.engine.dispatch.BaseDispatchTask.process(BaseDispatchTask.java:88)
         at com.collaxa.cube.engine.dispatch.BaseDispatchTask.run(BaseDispatchTask.java:64)
         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
         at java.lang.Thread.run(Thread.java:662)

  • Platform.runLater messes up my Thread.currentThread().getContextClassLoader()

    Hi,
    I have a plugin mechanism in my application. The plugins are defines by an interface and are loaded via URLClassLoader. A plugin can also have resources, loaded via ResourceBundle.getBundle.
    Whenever a plugin's method is called, I do this, before it is called:
    ClassLoader oldLoader = Thread.currentThread().getContextClassLoader();
    Thread.currentThread().setContextClassLoader(pluginClassLoaders.get(pluginClass.cast(proxy)));
    // Invoke plugin method
    Thread.currentThread().setContextClassLoader(oldLoader);
    The plugin methods are called in their own thread, that means, when I want to open a window I need to do it on the JavaFX Application Thread with Platform.runLater.
    The problem is, that in the run method of the Platform.runLater, my Thread.currentThread().getContextClassLoader() is not my URLClassLoader but the Application Classloader.
    Why I need this?
    I don't want the plugin developer to always keep in mind, that he has to pass the correct class loader (of his classes) into the ResourceBundle.getBundle method.
    Instead I thought I could rely on Thread.currentThread().getContextClassLoader(), which is set in the main application, to load the correct bundle.
    It would work, but not if I load the bundle inside the JavaFX Application Thread (but which makes the most sense for UI development).
    So my goal was to have a convenient method like:
    String getResource(String bundle, String key)
    return ResourceBundle.getBundle(bundle).getString(key),  Thread.currentThread().getContextClassLoader());
    To avoid passing the classloader every time.
    Any ideas on this?

    OK, found the problem.
    In data-sources.xml, there is a connection pool and a managed-data-source settings. If I set the data source in there - it works!! Seems these XML tags take preference above the datasource tag.
    This is how the data-sources.xml now looks that's been working:
    <?xml version = '1.0' standalone = 'yes'?>
    <data-sources xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://xmlns.oracle.com/oracleas/schema/data-sources-10_1.xsd" schema-major-version="10" schema-minor-version="1">
    <connection-pool name="jdev-connection-pool-MYDB">
    <connection-factory factory-class="com.mysql.jdbc.Driver" user="henkie" password="->DataBase_User_recGxQcVfghwCszzy_gfsRgwOrxutL2l" url="jdbc:mysql://localhost/mydb"/>
    </connection-pool>
    <managed-data-source name="jdev-connection-managed-MYDB" jndi-name="jdbc/MYDBDS" connection-pool-name="jdev-connection-pool-MYDB"/>
    </data-sources>

  • How to get info about currently running threads in j2sdk1.4.2

    I am using j2sdk-1.4.2. There are many threads running in my program. I want to see after which thraed is invoked after another thread. I have used Thread.sleep() method to sleep the thread and give the chance to another thread to run.
    Thanks,
    Amit Mittal.

    There is no way known to me to find out, which thread is currently active if you don't want to use debugging-outputs.
    But please don't use sleep(), it slows your code down unnecessarily and is not save. Use Thread.yield() in order to give other threads the chance to run.
    Regars, tom

  • Thread refuses to work

    Ok, this is the weirdest thing ever happened to me ever since i started working with cellphone programming.
    Lately, one of my thread refuses to activate. I have this thread that communicates with a thermal printer to print something right. Well, i have been working developing the interpretative code for it (since the SDK won't do any good for my needs) for about 4 weeks and been working perfectly. But then i tried to implement it on my application i was working on and it refused to work. Well, i though something was wrong with my code so i went back to my test program and tried to invoke de print thread and now it also refuses to work, but i noticed on the device log (i'm developing on blackberry) a IllegalMonitorStateException was thrown in the wait() method of my thread.
    My thread is running all the time expecting for me to call it to work so it has this structure
    class printThread implements Thread
        private boolean sleep = true;
        printThread(){} // Constructor
        public void run()
             while(sleep)
                 try
                     wait();
                 catch(InterruptedException e){}
                 if(sleep)
                    // Do the work when notifyed
        public void work()
             notify();
    }Thats my basic thread structure, and been working like a charm for ages already (my application has 4 thread running backward, one of it works every 5 minutes in the background) but then i added the print thread and this problem started to appear. then i went back to my test program for the printer and the problem followed me there.
    What might this be causing the problem? I could understand this problem happening in my application with the other 4 threads working there, but on the test program there's only 1 thread!!!

    hm it looks like you lost synchronized keyword while making changes in the code.
    IllegalMonitorStateException is definitely a WYSIWYC (What You See Is What You Coded). I mean, this exception is indeed the correct behavior for the code you posted.
    Consider changing *while(sleep){...}* to something like *synchronized(this){while(sleep){...}}* - that will probably make exception go away, but...
    ... on the test program there's only 1 thread!!!...but given above, after fixing the exception you can get into the next problem - your application will hang.
    You know, it takes two to tango. While one thread waits, there should be another one to notify.
    If there's only one thread waiting, it can wait forever. I won't guarantee that this is your case though because from your explanation it is not clear if there's indeed only one thread.
    I would also recommend you to consider studying Sun's [online tutorial on concurrency|http://java.sun.com/docs/books/tutorial/essential/concurrency/]. +"...This lesson introduces the platform's basic concurrency support..."+ - studying it can help fix problems faster than waiting for the answer at the forum. :)

  • Adding Custom Threads to a ThreadGroup

    Hi all.
    I am haveing trouble figuring out how to add MyThread to a ThreadGroup. I have a Runnable thread MyThread that extends Thread, which I want to add to ThreadGroup threadgroup. From what I can find, You can only add a Thread to a ThreadGroup when you call the Thread constructor. Any ideas? Is what I'm trying to do clear?

    Hi all.
    I am haveing trouble figuring out how to add MyThread
    to a ThreadGroup. I have a Runnable thread MyThread
    that extends Thread, which I want to add to
    ThreadGroup threadgroup. From what I can find, You
    can only add a Thread to a ThreadGroup when you call
    the Thread constructor. Any ideas? Is what I'm
    trying to do clear?Well, obviously you're constructing one of the Threads. So as the first line of your class' constructor, call super(...) to invoke one of Thread's constructors that takes a ThreadGroup.

  • Show Text Thread in all opened Document

    I want to show text thread in all opended Documents, here is my script, but have error, anyone can fix?
    var myEnableTextThreads = app.menuActions.itemByID(24332);
    var myEnableTextThreads1 = app.menuActions.item("Hide Text Threads");
    var myEnableTextThreads2 = app.menuActions.item("Show Text Threads");
    ShowThreads();
    function ShowThreads(){
    var myDoc = app.documents;
    for (var i=0; i<myDoc.length; i++) {
    if (myDoc[i].menuActions.item("Show Text Threads") == true){
               myEnableTextThreads.invoke();
                 alert("Text Threads Shown");

    Hi,
    No such property is exposed for scripting, unfortunately.
    The one to observe is a menuAction.name ==> but this is only an effect of some procedure involved by menuAction. Even worse ==> script will show you the last menuAction status - not the one is currently applied to activeDocument. It will update after menu activation in UI, not earlier.
    So you can only toggle between both of them regardless on its current state, using app.menuActions.itemByID(24332).
    If you will try to check (by script) its current menuAction.name ==> sometimes is true, sometimes is false.
    If you will check it manually ==. is true cause is updated already.
    Jarek

  • Swings and Threads

    My applet communicates with the database. To ensure that the GUI is updated in the Event-Dispatching Thread I am using a SwingWorker: in construct() the application communicates with DB, and in finished() it updates the GUI. In construct() of the SwingWorker thread I need to create a dialog box to prompt the user for an input like to chose a color or to answer yes/no.
    My question is: Do I need to use invokeAndWait() to create the dialog box? The more general question is: do we use invokeLater() or SwingWorker only for GUIs that are shared by several threads or we have to use it for every swing we create after Event-Dispatching Thread started running?
    Thank you

    One of the fun things about Swing and its EventDispatchThread is that
    doing things wrong (such as performing Swing operations from a thread
    other than the EDT) is that more often than not, even though they are done
    technically wrong, they will still appear to work, especially in small programs.
    (In a larger sense, this applies to any multi-threaded program: things might
    appear to work until the timing changes just a teensy bit...)
    What's even more fun is working with someone who has previously only
    done small programs and because of that, takes this approach in large programs, and then spending a large amount of time trying to figure out why
    something sporadically stops working, only to trace it back to a Swing
    operation being invoked from a thread other than the EDT. Fun!
    You know how to do it correctly.
    You know why to do it correctly.
    But you choose not to. Good luck with that.

Maybe you are looking for

  • The operation can't be completed... (error code -50)

    Couple of days ago I started getting this error message: +The operation can't be completed, because an unexpected error occurred (error code -50).+ Once I get this error nothing works anymore on my Mac. I can't copy, paste, edit, save, etc. any docum

  • Getting error while deploying a cube with time dimension

    Hi, I created a time dimension using WB with Cal yr and day heirarchy. Designed a cube using both and tried to deploy it. I got the following error. Appreciate your help.. Name Type Status Log TIME_CUB1 Cube Success VLD-0001: Validation completed suc

  • Activated iTunes Match, now most of my music is missing...

    After I upgraded to IOS6, I activated iTunes Match. Now almost all of music on my iMac is missing. When I click on a song, itunes says it can't find the song and asks if I want to try and locate it. All the songs now have have exclamation marks in a

  • Need to send an email (after the FTP adapter does the transfer)

    I have a simple ESB project. It uses FTP adapter to pick a file and encrypt it (by using a webservice) and then transfers that file to a different server. As mentioned FTP (SFTP) adapter is used to do this. After the file is transfered ( by using the

  • Help using the Connection Trunk command

    Hello Group, I could use a bit of assistance accomplishing the following. I have two Cisco 1760 Routers with a WIC 1/DSU T1 and one VIC2/E/M in each router.  I am new to CLI commands and could use some tips. I would like to set up these routers (I wi