Obtaining initialcontext from t3 client leaks current thread

Summary: creating an initial context from a t3 client leaks the current
thread.
NB: I posted about this problem recently, except that the initialcontext was
obtained from
within the Weblogic server. I was told that user threads should not be
spawned from within
the server. I've since discovered that the problem also exists from a T3
client as well.
Any solutions/workarounds?
Our temporary workaround is to maintain our own thread pool, and never
expire threads
out of the pool. That appears to mitigate the problem, but I'm a little
leery of reusing
threads when it appears as though parts of Weblogic key off the thread
object (this is
what seems to be causing the leak in the first place.) Is this a correct
workaround?
Regards,
-kb-
Sample output:
java -mx64m -ms64m com.snapfish.test.SimpleTestJVMSockHTTPClient: connect() success to host: localhost port: 7001 sockID: 4
Avail mem is 66325400
Avail mem is 66240784
Avail mem is 66139744
Avail mem is 66038672
Avail mem is 65937600
Avail mem is 65836528
Avail mem is 65735456
Avail mem is 65634392
Avail mem is 65533240
Avail mem is 65432208
-- SimpleTest.java --
package com.snapfish.test;
import java.util.Properties;
import javax.naming.InitialContext;
import javax.naming.Context;
public class SimpleTest
public static void main(String arg[])
for (int i=0; i<1000; i++) {
Thread t = new Thread () {
public void run() {
try {
Properties p = new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
p.put(Context.PROVIDER_URL,
"http://localhost:7001");
InitialContext ctx = new InitialContext(p);
ctx.close();
ctx = null;
catch (Exception ex) {
ex.printStackTrace();
return;
private byte buf[] = new byte[100000];
t.start();
try {  t.join(); }
catch (InterruptedException ex) {
ex.printStackTrace();
return;
t = null;
System.gc();
System.out.println("Avail mem is
"+Runtime.getRuntime().freeMemory());

You will need the generated stubs packaged on the client side.

Similar Messages

  • Obtaining DataSource from a client application

    Hi,
    I am trying to use the connection pooling capability of DataSource, but my application is not running under any container, ie. servlet/ejb. How can i obtain DataSource object ? Do I need to use JNDI to do that ? If so, how can I use JNDI without any web container/ejb container ?
    thanks for the help

    You simple run the JNDI registry in a separate process, then bind obejcts to it, which could be a datasource or whatever. Then you have other objects connect to the JNDI tree and lookup objects. It works the same, but you simply have to initiate the JNDI service manually.

  • How do RDP clients obtain license from host/license server?

    Hi,
    I have a W2k8 R2 server setup with Remote Desktop Session Host and Licensing. This will be used to allow more than 2 RDP connections to a server. 
     Can someone explain the process from the client side, getting the license from the host/licensing server, then connect to the server they need to manage?
    What configuration is needed on the client/server side to know it needs check for a RDP license?
    Thanks in advance,
    J

    Hello,
    Below is the licensing guide for Remote Desktop Services.
    http://technet.microsoft.com/en-in/library/dd983943(v=ws.10).aspx
    How the connection works,
    The clients will first connect to Remote Desktop Session Host. The Session host will forward it to the License Server.
    You have the option to tell the Remote Desktop Session host to say which is the license server it should contact. Check this link below to see how to do this.
    http://hookorcrook.net/2011/12/19/configuring-remote-desktop-services-licensing-server-windows-server-2008/
    All the CAL licenses will be installed and configured in the License Server.
    There are two types of CAL licenses - Per User and Per Device CALs. Based on the type of license available in the License server, the license will be obtained and the user's connection is forwarded to the Remote Desktop Session host server.
    If no license is available in the Licensing server, it will fail there.

  • How to upload file from java client to php

    hi
    i am trying to upload/send a file from client using swing/applet
    and receiving it with php code.
    here is the php code which uploads the post file from the client
    $uploaddir = "/home/raghavendra/Documents/";
    $file = basename( $_FILES["uploadedfile"]["name"]);
    echo "file:\n".$file;
    $uploadfile = $uploaddir. $file;
    if (move_uploaded_file($_FILES["uploadedfile"]["tmp_name"],$uploadfile)) {
    echo "File is valid, and was successfully uploaded.\n";
    else {
    echo "File upload failure Possible file upload attack!\n";
    and corresponding different java code which post the
    1)
    public void postmethodTest(String filefrom){
    try{
    String hostname = "localhost";
    int port = 80;
    InetAddress addr = InetAddress.getByName(hostname);
    Socket socket = new Socket(addr, port);
    // Send header
    String path ="/php_prgs/var/www/nsboxng/htdocs/tryupdate.php";
    File theFile = new File(filefrom);
    System.out.println ("size: " + (int) theFile.length());
    DataInputStream fis = new DataInputStream(new BufferedInputStream(new FileInputStream(theFile)));
    byte[] theData = new byte[(int) theFile.length( )];
    fis.readFully(theData);
    fis.close();
    DataOutputStream raw = new DataOutputStream(socket.getOutputStream());
    Writer wr = new OutputStreamWriter(raw);
    String command =
    "POST "+path+" HTTP/1.0\r\n"
    + "Content-type: multipart/form-data, boundary=mango\r\n"
    + "Content-length: " + ((int) theFile.length()) + "\r\n"
    + "\r\n"
    + "--mango\r\n"
    + "content-disposition: name=\"MAX_FILE_SIZE\"\r\n"
    + "\r\n"
    + "\r\n--mango\r\n"
    + "content-disposition: attachment; name=\"datafile\"" ;
    String filename="test.doc\"\r\n"
    + "Content-Type: text/doc\r\n"
    + "Content-Transfer-Encoding: binary\r\n"
    + "\r\n";
    wr.write(command);
    wr.flush();
    raw.write(theData);
    raw.flush( );
    wr.write("\r\n--mango--\r\n");
    wr.flush( );
    BufferedReader rd = new BufferedReader(new
    InputStreamReader(socket.getInputStream()));
    String line;
    while ((line = rd.readLine()) != null) {
    System.out.println("out"+line);
    wr.close();
    raw.close();
    socket.close();
    } catch (Exception e) {System.out.println(e.toString());}
    2)
    public void postMethod(String strURL, String filefrom){
    try {
    String fname = filefrom.substring(filefrom.lastIndexOf("/")+1, filefrom.length());
    File input=new File(filefrom);
    // Prepare HTTP post
    PostMethod post = new PostMethod(strURL);
    // Request content will be retrieved directly
    // from the input stream
    // Per default, the request content needs to be buffered
    // in order to determine its length.
    // Request body buffering can be avoided when
    // content length is explicitly specified
    post.setRequestEntity(new InputStreamRequestEntity(new FileInputStream(input), input.length()));
    // Specify content type and encoding
    // If content encoding is not explicitly specified
    // ISO-8859-1 is assumed
    //post.setRequestHeader("Content-type", "text/xml; charset=ISO-8859-1");
    post.setRequestHeader("Content-Type","multipart/form-data");
    post.setRequestHeader("Content-Disposition", "form-data; name="+fname);
    // Get HTTP client
    HttpClient httpclient = new HttpClient();
    // Execute request
    try {
    int result=httpclient.executeMethod(post);
    // Display status code
    System.out.println("Response status code: " +result);
    // Display response
    System.out.println("Response body: ");
    // System.out.println(post.getResponseBodyAsString());
    BufferedReader console = new BufferedReader(new InputStreamReader(post.getResponseBodyAsStream()));
    String name = null;
    String line = null;
    try {
    while ((line = console.readLine()) != null) {
    System.out.println("output"+line);
    //name = console.readLine();
    catch (IOException e) { name = "<" + e + ">"; }
    // System.out.println("Hello " + name);
    } finally {
    // Release current connection to the connection pool
    // once you are done
    post.releaseConnection();
    catch(IOException e){
    but am getting else condition response from php code
    but if i post with html code it is working fine.
    can anybody help me please where i have to change the code
    please suggest me. am in a big trouble and i have to complete this as soon as possible

    One thread is enough.
    http://forum.java.sun.com/thread.jspa?threadID=5198449
    You could have bumped it instead. Also, you still just posted a junk of unformatted stuff. Furthermore, for HttpClient support ask at an HttpClient mailing list of rorum.

  • Error while running EJB from java client on JBOSS

    Hi
    As i am new to EJB i have created a helloworld application in ejb which is working fine when i try to call it from servlet but when i try to invoke the same ejb from java client (i.e from diff jvm) on jboss i got the following error:
    javax.naming.CommunicationException: Could not obtain connection to any of these urls: localhost:1099 and discovery failed with error: javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out] [Root exception is javax.naming.CommunicationException: Failed to connect to server localhost:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused]]]
         at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1399)
         at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:579)
         at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)
         at javax.naming.InitialContext.lookup(InitialContext.java:351)
         at com.gl.TestClient.main(TestClient.java:39)
    Caused by: javax.naming.CommunicationException: Failed to connect to server localhost:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused]]
         at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:254)
         at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1370)
         ... 4 more
    Caused by: javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused]
         at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:228)
         ... 5 more
    Caused by: java.net.ConnectException: Connection refused
         at java.net.PlainSocketImpl.socketConnect(Native Method)
         at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
         at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
         at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
         at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
         at java.net.Socket.connect(Socket.java:519)
         at java.net.Socket.connect(Socket.java:469)
         at java.net.Socket.<init>(Socket.java:366)
         at java.net.Socket.<init>(Socket.java:266)
         at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:69)
         at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:62)
         at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:224)
         ... 5 more
    Following is my code:
    Home Interface:
    package com.gl;
    import javax.ejb.CreateException;
    public interface testHome extends EJBHome {
         String JNDI_NAME = "testBean";
         public     test create()
         throws java.rmi.RemoteException,CreateException;
    Remote Interface:
    package com.gl;
    import java.rmi.RemoteException;
    import javax.ejb.EJBObject;
    public interface test extends EJBObject {
         public String welcomeMessage() throws RemoteException;
    Bean:
    package com.gl;
    import java.rmi.RemoteException;
    import javax.ejb.EJBException;
    import javax.ejb.SessionBean;
    import javax.ejb.SessionContext;
    public class testbean implements SessionBean {
         public void ejbActivate() throws EJBException, RemoteException {
              // TODO Auto-generated method stub
         public void ejbPassivate() throws EJBException, RemoteException {
              // TODO Auto-generated method stub
         public void ejbRemove() throws EJBException, RemoteException {
              // TODO Auto-generated method stub
         public void setSessionContext(SessionContext arg0) throws EJBException,
                   RemoteException {
              // TODO Auto-generated method stub
         public void ejbCreate(){}
         public String welcomeMessage(){
              return "Welcome to the World of EJB";
    ejb-jar.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
    <ejb-jar>
    <enterprise-beans>
    <session>
    <ejb-name>testBean</ejb-name>
    <home>com.gl.testHome</home>
    <remote>com.gl.test</remote>
    <ejb-class>com.gl.testbean</ejb-class>
    <session-type>Stateless</session-type>
    <transaction-type>Container</transaction-type>
    </session>
    </enterprise-beans>
    </ejb-jar>
    jboss.xml:
    <?xml version='1.0' ?>
    <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 3.2//EN" "http://www.jboss.org/j2ee/dtd/jboss_3_2.dtd">
    <jboss>
    <enterprise-beans>
    <entity>
    <ejb-name>testBean</ejb-name>
    <jndi-name>testBean</jndi-name>
    </entity>
    </enterprise-beans>
    </jboss>
    Client code:
    package com.gl;
    import java.util.Properties;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.rmi.PortableRemoteObject;
    public class TestClient {
         public static void main(String[] args) throws Exception{
                   try{
                   /*     Properties props=new Properties();
                        props.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
                        props.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
                        props.put(Context.PROVIDER_URL, "jnp://localhost:1099");
                   Properties props = new Properties();
    props.put(Context.INITIAL_CONTEXT_FACTORY,
    "org.jnp.interfaces.NamingContextFactory");
    props.put(Context.PROVIDER_URL, "localhost:1099");
                        System.out.println("Properties ok");
                        //env.setProperty(Context.INITIAL_CONTEXT_FACTORY,"org.jboss.naming.HttpNamingContextFactory");
                        //env.put(Context.PROVIDER_URL,"http://localhost:8080");
                        //env.put(Context.SECURITY_PRINCIPAL, "");
                        //env.put(Context.SECURITY_CREDENTIALS, "");
                        Context ctx=new InitialContext(props);
                        System.out.println("context ok");
                        //testHome home = (testHome)ctx.lookup("testBean");
                        Object obj = ctx.lookup ("testBean");
                        System.out.println("ojb = " + obj);
                        testHome ejbHome = (testHome)PortableRemoteObject.narrow(obj,testHome.class);
                   test ejbObject = ejbHome.create();
                   String message = ejbObject.welcomeMessage();
                        System.out.println("home ok");
                        System.out.println("remote ok");
                        System.out.println(message);
                        catch(Exception e){e.printStackTrace();}
    I am able to successfully deployed my ejb on JBOSS but i m getting above error when i am trying to invoke ejb from java client.
    kindly suggest me something to solve this issue.
    Regards
    Gagan
    Edited by: Gagan2914 on Aug 26, 2008 3:28 AM

    Is it a remote lookup? Then maybe this will help:
    [http://wiki.jboss.org/wiki/JBoss42FAQ]
    - Roy

  • CANNOT_LOAD_BUNDLE_ERR from remote client (same local network).

    Hello,
    We're having problems (as many other people) with remotely connecting (but on same network) Server Monitor (1.8(5)) from a 10.6.4 client to the LOM IP (or FQDN) of our Xserve (model Xserve3,1)(early 2009)(running under 10.6.4)(LOM revision 1.1.8)(Boot ROM versionXS31.0081.B06).
    Although connections of Server Monitor on that Xserve via localhost work fine, connections from the client (a Macbook Pro running 10.6.4) give the infamous CANNOTLOAD_BUNDLEERR.
    Note that connections from the client to our OTHER Xserve (early 2008)(model Xserve2,1)(LOM revision 1.1.2)(Boot ROM Version XS21.006C.B06) work fine (both via localhost and non localhost).
    Please help!
    shawn
    p.s. Here's a list of what didn't help:
    Our LOM Firmware does seem to be up-to-date on both the working Xserve (the one that does allow remote connections) and the not-willing-to-do-remote Xserve. http://support.apple.com/kb/HT3539 (trying to install a LOM updater tells us we're already up to date.. and anyway, the LOM Firmware update should only be for Early2008 Xserves).
    This unsolved archived discussion did not help:
    Server Admin/Monitor Issues (MrHoffman)
    http://discussions.apple.com/thread.jspa?threadID=2325127
    Nor did reading "LOM it up!" (MacTroll) or the discussion that followed.
    http://www.afp548.com/article.php?story=20070211101829496&query=120
    Using Network Utility > Lookup from the client machine shows that the IP address does indeed point to the correct FQDN and vice versa.
    Running, from the client, dig server2.epfl.ch showed the expected IP addresses.
    Running, from the client, dig -x with the returned IP address, showed the expected FQDN.
    Pinging the LOM's FQDN gives me successful ACKs of .200ms.
    Running changeip -checkhostname on the server shows the non-LOM ip address and correct non-LOM FQDN. How do I use changeip to check the LOM hostname and IP address (which is different) ??
    We're not mixing 10.5 and 10.6; Both server and client are using 10.6.4.
    Running ServerMonitor directly on the server (using localhost) works fine.
    ConfigureLocalMachine on the not-working Xserve (call it Xserve2) shows LOM using Ethernet PORT2 (but switching to PORT1 doesn't help). The Subnet-mask and Router values are configured identically to the working Xserve (call it Xserve1) where the config does allow remote access. The version of ServerMonitor on both Xserves and on the clientMacs is 1.8(5). Every machine is 10.6.4.
    The command "ipmitool lan print 2" on Xserve2 reveals the correct IP address and other infos. But the command "ipmitool lan print 1" says that Channel 1 is not a LAN Channel. Is this important? If so, what do I do with this info?
    Ideas from reading LOM No Workie (Faby) don't help.
    http://lists.apple.com/archives/Macos-x-server/2006/Dec/msg00620.html
    I've also uselessly read:
    Xserve User's Guide : http://www.apple.com/support/xserve/
    OS X Server Manuals : http://www.apple.com/server/macosx/resources/documentation.html
    HT2773 document - Xserve (Late 2006 and later): Configuring Lights-Out Management (LOM) : http://support.apple.com/kb/HT2773

    I'm going to skim over some details of IP and IP routing.
    My IP for that NIC on which the LOM is running is 128.178.100.87.
    If I'm reading you correctly, I should NOT have an IP for my LOM (if you say 'correct' then I'm really confused).
    Your LOM needs its own unique IP address.
    This can be a little confusing if you're looking at the hardware, but it's entirely possible to have several separate IP hosts (devices) on one network jack, and each needs its own (unique) address. You're not assigning IP addresses to cables, you're assigning addresses to hosts.
    And if I read you to say that yes 128.178.100.87 should be assigned to the LOM but not the NIC,.. then to what is the LOM attached/configured?
    Well, if two hosts (or even two network controllers on the same host) have the same address (and the LOM is a host), then (best case) the IP traffic on the second host controller to start detects the address collision and won't allow the host to go online. Worst case, traffic gets snarled.
    Finally, it seems that this setup on XserveBAD (an XServe3,1) is the same on XserveGOOD (and Xserve2,1) in terms of IPs NICs and LOMs. The only diff seems to be Xserve versions.
    There was a brief kerfuffle with the Xserve3,1 boxes and the tools back when those boxes first arrived, but that all settled down with current tools and firmware.
    *2. 2nd dual-port NIC*
    YES indeed! You're good! From the Preferences>Network panel I see we have a PCI ethernet with two ports (both XserveBAD & XserveGOOD have this) link-aggretated. To that bond, we've assigned the IP address that people use to ssh into the machines. LOM is not there. XserveBAD's LOM is configured to say +LOM uses ethernet Port 1+ and XserveGOOD's LOM is set to +uses Network1+ (the GUI looks different on the two machines).
    Two networks (also) means you'll have to consider IP routing; which NIC is used to respond to traffic. Inbound IP packet traffic might well arrive at the box, but if the box doesn't have its routing configured "correctly" then the IP packets "outbound" in response might not be sent out the expected controller; the inbound IP traffic and the IP responses don't automatically use the same controller. Those routing determinations are made separately, based on the local subnet, available local static routes, and the rest of the packets get sent to the default router to deal with.
    For both XserveBAD and XserveGOOD, the Preferences>Network panel shows the IP that we configured for the LOM to be the one on 'Ethernet 1" with subnet mask of 255.255.255.0. And in both cases the IP address used for sshing (the one used on the PCI ethernet bonded ports) is on 'Ethernet 0' with subnet mask 255.255.255.0.
    The subnet masks tells IP where the IP packet is going to be set. In the most general of terms, that mask tells IP routing where to send the packet, and that decision (and specifically with the 255.255.255.0 mask) says that if the first three bytes are the same, it's a local address and the messages get sent directly. If the first three bytes differ (and it's not an established route), it goes to the designated "gateway" router.
    p.s. FWIW, I almost went with SadLOM and HappyLOM but I'm still pretending to be a serious mac admin-wannabe here.
    Uh-huh. You'll get over that.
    p.p.s. I didn't catch your drift concerning public/private subnets.. but I'm googling, I'm googling and reading here http://articles.techrepublic.com.com/5100-10878_11-6089187.html
    Your network uses IP addresses in the public static IP space, and IP addresses in one of the private address spaces. (The same would apply if you had IP addresses in different subnets in any of the private IP address blocks, though the use of a public space implies there's a "public" LAN and a private LAN.)
    That looks reasonable as far as it goes, albeit a little stale, and it unfortunately lacks the associated discussion of routing; of why you'd be interested in subnets, and what happens with the packets. The class stuff discussed there is replaced with what's called "CIDR" - classless routing -- and is long gone. (I've been around long enough that the class A, B and C stuff is second nature and old habit, but that "classful" scheme has been replaced with the far more flexible "classless" CIDR scheme.) And the article lists 17 years for IPv4, and the last of the available IPv4 blocks are likely to be handed out within the next few years; we're all dealing with IPv6 now, and its likely that IPv4 addresses are going to get harder to get and probably also more expensive.
    when next you're in Switzerland, I owe you free beers.
    Danke. Der Ratskeller in Zürich war ziemlich gut. Quite a pretty walking area around there too, and with a beautiful view of the river.

  • Javaws 1.4.2 "current thread not owner"

    Hello everyone,
    I have an application that I have been launching with javaws since the javaws 1.0.x days that won't work with javaws 1.4.2. Does anyone have any clue as to what could be wrong?
    Java Web Start 1.4.2 Console, started Thu Aug 21 09:15:25 EDT 2003
    Java 2 Runtime Environment: Version 1.2.2 by Sun Microsystems Inc.
    --------- EXCEPTION ---------
    java.lang.IllegalMonitorStateException: current thread not owner
         at com.sun.javaws.security.JNLPClassPath.findNamedResourceInLoaders(Unknown Source)
         at java.lang.ClassLoader.loadClass(ClassLoader.java, Compiled Code)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java, Compiled Code)
         at com.sun.javaws.security.JNLPClassPath.findNamedResource(Unknown Source)
         at com.sun.javaws.security.JNLPClassPath.getResource(Unknown Source)
         at com.sun.jnlp.JNLPClassLoader$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sun.jnlp.JNLPClassLoader.findClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(ClassLoader.java, Compiled Code)
         at java.lang.ClassLoader.loadClass(ClassLoader.java, Compiled Code)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java, Compiled Code)
         at org.apache.xerces.framework.XMLParser.<init>(XMLParser.java)
         at org.apache.xerces.framework.XMLParser.<init>(XMLParser.java)
         at org.apache.xerces.parsers.DOMParser.<init>(DOMParser.java)
         at com.fpl.ima.deployit.options.DeployItOptions.loadOptions(DeployItOptions.java, Compiled Code)
         at com.fpl.ima.deployit.options.DeployItOptions.getInstance(DeployItOptions.java)
         at com.fpl.ima.deployit.DeployIt.initialize(DeployIt.java)
         at com.fpl.ima.deployit.DeployIt.<init>(DeployIt.java)
         at com.fpl.ima.deployit.DeployIt.main(DeployIt.java)
         at java.lang.reflect.Method.invoke(Native Method)
         at com.sun.javaws.Launcher.executeApplication(Unknown Source)
         at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
         at com.sun.javaws.Launcher.continueLaunch(Unknown Source)
         at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source)
         at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source)
         at com.sun.javaws.Launcher.run(Unknown Source)
         at java.lang.Thread.run(Thread.java:479)
    Exception occurred in main() of DeployIt
    java.lang.IllegalMonitorStateException: current thread not owner
         at com.sun.javaws.security.JNLPClassPath.findNamedResourceInLoaders(Unknown Source)
         at java.lang.ClassLoader.loadClass(ClassLoader.java, Compiled Code)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java, Compiled Code)
         at com.sun.javaws.security.JNLPClassPath.findNamedResource(Unknown Source)
         at com.sun.javaws.security.JNLPClassPath.getResource(Unknown Source)
         at com.sun.jnlp.JNLPClassLoader$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sun.jnlp.JNLPClassLoader.findClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(ClassLoader.java, Compiled Code)
         at java.lang.ClassLoader.loadClass(ClassLoader.java, Compiled Code)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java, Compiled Code)
         at com.fpl.ima.deployit.DeployIt.main(DeployIt.java)
         at java.lang.reflect.Method.invoke(Native Method)
         at com.sun.javaws.Launcher.executeApplication(Unknown Source)
         at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
         at com.sun.javaws.Launcher.continueLaunch(Unknown Source)
         at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source)
         at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source)
         at com.sun.javaws.Launcher.run(Unknown Source)
         at java.lang.Thread.run(Thread.java:479)

    I can only guess at the likely cause. Previously (jws 1.2 and earlier) every web start process would kick off a jvm for the web start client to process the jnlp, this would in turn then kick off a second jvm to run the actual application.
    1.4.2 has changed this slightly to improve startup time etc.. the second jvm process doesn't happen, and now the web start app runs from the same jvm that the web start client has started for itself. This is why the integration dialog is such a problem with modal apps in 1.4.2 -- they're sharing (and conflicting with) the same event thread.
    At least this is what I think is happening ~ I'm very sure but cant be 100% certain ..because much like the autodownloads Sun haven't published any of the source for 1.4.2 web start (shouldn't this be part of the shipped sdk source these days?).
    I guess this change breaks your previous class-loading assumptions.
    - Richard

  • Javax.naming.NamingException: Could not obtain InitialContext for URL

    Hello Folks,
    I am getting an error
    "javax.naming.NamingException: Could not obtain InitialContext for URL" when I am trying to call a servlet(deployed in an ear file in weblogic server) from a client.
    Any help or suggestion would be highly appeciable. Please let me know if any further information is required
    Regards
    Pankaj

    I encounter the same issues when using the TimerTask to access the JNDI tree. I have found success when I move my business logic to an EJB and call my EJB from my TimerTask. It's a bit more work, but not much. The EJB inherits it's identity based on it's configuration and has no trouble accessing the JNDI tree whenever it's called. Try this and see if your problem doesn't go away.
    Hope this helps,
    Perry Tew

  • Accessing the same stateful session bean from multiple clients in a clustered environment

    I am trying to access the same stateful session bean from multiple
              clients. I also want this bean to have failover support so we want to
              deploy it in a cluster. The following description is how we have tried
              to solve this problem, but it does not seem to be working. Any
              insight would be greatly appreciated!
              I have set up a cluster of three servers. I deployed a stateful
              session bean with in memory replication across the cluster. A client
              obtains a reference to an instance of one of these beans to handle a
              request. Subsequent requests will have to use the same bean and could
              come from various clients. So after using the bean the first client
              stores the handle to the bean (actually the replica aware stub) to be
              used by other clients to be able to obtain the bean. When another
              client retrieves the handle gets the replica aware stub and makes a
              call to the bean the request seems to unpredictably go to any of the
              three servers rather than the primary server hosting that bean. If the
              call goes to the primary server everything seems to work fine the
              session data is available and it gets backed up on the secondary
              server. If it happens to go to the secondary server a bean that has
              the correct session data services the request but gives the error
              <Failed to update the secondary copy of a stateful session bean from
              home:ejb20-statefulSession-TraderHome>. Then any subsequent requests
              to the primary server will not reflect changes made on the secondary
              and vice versa. If the request happens to go to the third server that
              is not hosting an instance of that bean then the client receives an
              error that the bean was not available. From my understanding I thought
              the replica aware stub would know which server is the primary host for
              that bean and send the request there.
              Thanks in advance,
              Justin
              

              If 'allow-concurrent-call' does exactly what you need, then you don't have a problem,
              do you?
              Except of course if you switch ejb containers. Oh well.
              Mike
              "FBenvadi" <[email protected]> wrote:
              >I've got the same problem.
              >I understand from you that concurrent access to a stateful session bean
              >is
              >not allowed but there is a
              >token is weblogic-ejb-jar.xml that is called 'allow-concurrent-call'
              >that
              >does exactly what I need.
              >What you mean 'you'll get a surprise when you go to production' ?
              >I need to understand becouse I can still change the design.
              >Thanks Francesco
              >[email protected]
              >
              >"Mike Reiche" <[email protected]> wrote in message
              >news:[email protected]...
              >>
              >> Get the fix immediately from BEA and test it. It would be a shame to
              >wait
              >until
              >> December only to get a fix - that doesn't work.
              >>
              >> As for stateful session bean use - just remember that concurrent access
              >to
              >a stateful
              >> session bean is not allowed. Things will work fine until you go to
              >production
              >> and encounter some real load - then you will get a surprise.
              >>
              >> Mike
              >>
              >> [email protected] (Justin Meyer) wrote:
              >> >I just heard back from WebLogic Tech Support and they have confirmed
              >> >that this is a bug. Here is their reply:
              >> >
              >> >There is some problem in failover of stateful session beans when its
              >> >run from a java client.However, it is fixed now.
              >> >
              >> >The fix will be in SP2 which will be out by december.
              >> >
              >> >
              >> >Mike,
              >> >Thanks for your reply. I do infact believe we are correctly using
              >a
              >> >stateful session bean however it may have been misleading from my
              >> >description of the problem. We are not accessing the bean
              >> >concurrently from 2 different clients. The second client will only
              >> >come into play if the first client fails. In this case we want to
              >be
              >> >able to reacquire the handle to our stateful session bean and call
              >it
              >> >from the secondary client.
              >> >
              >> >
              >> >Justin
              >> >
              >> >"Mike Reiche" <[email protected]> wrote in message
              >news:<[email protected]>...
              >> >> You should be using an entity bean, not a stateful session bean
              >for
              >> >this application.
              >> >>
              >> >> A stateful session bean is intended to be keep state (stateful)
              >for
              >> >the duration
              >> >> of a client's session (session).
              >> >>
              >> >> It is not meant to be shared by different clients - in fact, if
              >you
              >> >attempt to
              >> >> access the same stateful session bean concurrently - it will throw
              >> >an exception.
              >> >>
              >> >> We did your little trick (storing/retrieving handle) with a stateful
              >> >session bean
              >> >> on WLS 5.1 - and it did work properly - not as you describe. Our
              >sfsb's
              >> >were not
              >> >> replicated as yours are.
              >> >>
              >> >> Mike
              >> >>
              >> >> [email protected] (Justin Meyer) wrote:
              >> >> >I am trying to access the same stateful session bean from multiple
              >> >> >clients. I also want this bean to have failover support so we want
              >> >to
              >> >> >deploy it in a cluster. The following description is how we have
              >tried
              >> >> >to solve this problem, but it does not seem to be working. Any
              >> >> >insight would be greatly appreciated!
              >> >> >
              >> >> >I have set up a cluster of three servers. I deployed a stateful
              >> >> >session bean with in memory replication across the cluster. A client
              >> >> >obtains a reference to an instance of one of these beans to handle
              >> >a
              >> >> >request. Subsequent requests will have to use the same bean and
              >could
              >> >> >come from various clients. So after using the bean the first client
              >> >> >stores the handle to the bean (actually the replica aware stub)
              >to
              >> >be
              >> >> >used by other clients to be able to obtain the bean. When another
              >> >> >client retrieves the handle gets the replica aware stub and makes
              >> >a
              >> >> >call to the bean the request seems to unpredictably go to any of
              >the
              >> >> >three servers rather than the primary server hosting that bean.
              >If
              >> >the
              >> >> >call goes to the primary server everything seems to work fine the
              >> >> >session data is available and it gets backed up on the secondary
              >> >> >server. If it happens to go to the secondary server a bean that
              >has
              >> >> >the correct session data services the request but gives the error
              >> >> ><Failed to update the secondary copy of a stateful session bean
              >from
              >> >> >home:ejb20-statefulSession-TraderHome>. Then any subsequent requests
              >> >> >to the primary server will not reflect changes made on the secondary
              >> >> >and vice versa. If the request happens to go to the third server
              >that
              >> >> >is not hosting an instance of that bean then the client receives
              >an
              >> >> >error that the bean was not available. From my understanding I
              >thought
              >> >> >the replica aware stub would know which server is the primary host
              >> >for
              >> >> >that bean and send the request there.
              >> >> >
              >> >> >Thanks in advance,
              >> >> >Justin
              >>
              >
              >
              

  • I want to access JMS Queue in websphere from a client application

    Hello all
    I tried to access a jms queue in the websphere from a client application
    my connection factory jndi name is : MyConn
    my queue name jndi name is : MyQueue
    and here is my code :
    Hashtable environment = new Hashtable();
    environment.put(Context.INITIAL_CONTEXT_FACTORY,
    "com.ibm.websphere.naming.WsnInitialContextFactory");
    environment.put(Context.URL_PKG_PREFIXES, "com.ibm.ws.naming");
    environment.put(Context.PROVIDER_URL, "corbaloc:iiop:localhost:2809");
    return new InitialContext(environment);
    then:
    q = (Queue) ctx.lookup(QJNDIName);
    QueueConnectionFactory connFactory = (QueueConnectionFactory)
    ctx.lookup(ConnFactName);
    I had the following exception :
    javax.naming.NameNotFoundException: Context: networking/nodes/networking/servers/server1, name: MyQueue: First component in name MyQueue not found. Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0
    Can i have any help please ....

    Hi
    You are missing some critical jar files in your class path. It should be namingclient.jar, also please or something similar that is missing in classpath.
    HTH
    VJ

  • Copy client with open items FI, stocks MM and balance from one client to

    Hi Gurus,
    I have a question , I want to copy client with next information:
    1.- All Cuztomazing
    2.- All master data
    3.- Only open items FI-AR , FI-AP,
    4.- Stocks MM available for production.
    5.- Documents sales valids
    6.- Complete Balance (fixed , available and current asset, etc.)
    From one client to other client.
    ¿How can I do it?
    I know that cuztomazing and master data it's possible, I need to find from 3 to 6 point if it's possible for copy tables or some trx complete this information.
    This work it's because my company code changue NIF and  information TAX , and I need to have a cut over for carry forward only the describe information.
    Thank's a lot
    Regards
    Julio

    Hi Julio,
    How did you solve this? I need to perform exactly these steps.
    I am very interested in 3, 4 and 6.
    Thanks in advance.

  • How to refresh XML file  from my client machine

    Hai All
    I have temp.XML and temp.XSL template in our server machine.
    when i give a print from client machine first time it gives the record,and next time it did not get refresh.Always it shows the previous records in the browser.But when i go into the server machine and click on temp.xml,it shows the current record(correct records)
    How to refresh XML file  from my client machine?
    Regards
    Dhina

    You never delete a Time Machine backup by dragging it to the Trash. You are supposed to use the TM application to manage the backups. What you will need to do now is to simply erase the drive using Disk Utility.

  • Saving string  from multiple clients on a server data structue

    I have a server which receives updates from multiple clients ( in this example, football scores which are updated periodically by the clients.)
    When the server receives the scores it needs to store them and at certain time intervals send the complete list of scores to multiple terminals at various locations.
    I am approaching this task in stages...
    stage 1.
    ..create the clients and server ...test the clients can send the data and the server can receive the data and output to screen..
    this is completed
    stage 2...
    a/ on the server side store the received scores in a data structure (ArrayList<String> is what I'm thinking.)
    b/ periodically output all scores to the screen (maybe every 30 seconds) and empty the ArrayList..am looking at the Timer class for this part..
    stage 3
    create the monitors and output scores to monitors periodically..
    ======================================================
    right now I'm at stage 2a ie trying to store the received scores in a data structure.
    i've created a method saveScore in the StoreScore class which is called by the StoreScore run method...
    The saveScore method creates an ArrayList and adds the score to it...
    Question
    does every thread create a new instance of storedScores and therefore the scores are stored in a multitude of data structures?
    I think the answer is yes and if so then this is not the solution...
    What I'm thinking is , as all scores can be outputted to the server screen via System.out.println, is there not a way of saving all these scores in a single data structure?
    The code below is the server code..
    any advice much appreciated....thank you
    /*=============================================================== */
    import java.io.*;
    import java.net.*;
    import java.util.*;
    import java.util.concurrent.*;
    class ScoresServer1{
    final static int portNum = 1234; // any number > 1024
    final static int numThreads = 10;
    static ExecutorService pool;
    public static void main(String[] args){
    pool = Executors.newFixedThreadPool(numThreads);
    System.out.println("Server running ...");
    try{  
    ServerSocket servesock = new ServerSocket(portNum);
    // for service requests on port
    while (true){ 
    // wait for a service request on port portNum
    Socket socket = servesock.accept();
    // submit request to pool
    pool.submit(new StoreScore(socket));
    }catch(IOException e){}
    class StoreScore implements Runnable {
    BufferedReader reader;
    Socket sock;
    public StoreScore(Socket clientSOcket) {
    try {
    sock = clientSOcket;
    InputStreamReader isReader = new InputStreamReader(sock.getInputStream());
    reader = new BufferedReader(isReader);
    } catch (Exception ex) { ex.printStackTrace(); }
    public void run() {
    String message;
    try {
    while ((message = reader.readLine()) != null) {
    // System.out.println("latest score: " + message);
    saveScore(message);
    } catch (Exception ex) { ex.printStackTrace(); }
    public void saveScore(String message){
         ArrayList<String> storedScores = new ArrayList<String>();
         storedScores.add(message);
         Iterator<String> t = storedScores.iterator();
              while(t.hasNext()){
                   String s = t.next();
                   System.out.println(s);
    }

    does every thread create a new instance of storedScores and therefore the scores are stored in a multitude of data structures?
    I think the answer is yes and if so then this is not the solution...The answer is yes. However, threads can share data, if they were properly synchronized. You should read the threading tutorial before creating a lot of hard to debug mistakes.
    [http://java.sun.com/docs/books/tutorial/essential/concurrency/]

  • How to transfer data from one client to another client

    Dear Experts,
    Please explain how to transfer data (Materials) from one client to another client?
    Thanks,
    Ajay Kumar

    Hi Ajay,
    Check any of below methods
    Refer thread http://scn.sap.com/thread/171981 where people use IDOCs for master data transfer.
    OR
    This is done by BASIS team, by client refresh or client copy. Check with your basis team for this and there is some predefined time when they plan this activity, and in most project they do it once in 3 months etc to get production environment in test system which helps to resolve issues of production by creating similar case in test system.
    Check below threads for more information
    http://sap.ittoolbox.com/groups/technical-functional/sap-basis/cleint-copy-vs-client-refresh-1377848
    http://basissap.blogspot.in/2008/05/what-is-client-copy.html
    OR
    You can download data from one client and upload in another through BDC or LSMW.
    Regards,
    Sharat

  • Is there a way to figure out what the current thread is?

    I've got the following snippet of code:
    // create a new thread. If the current thread is not this new thread, return
    Thread CountDownThread = new Thread("CountDownThread");
    CountDownThread.start();
    if (/*CURRENT THREAD*/.getName() != CountDownThread.getName()) {
         System.out.println ("I'm not CountDownThread. I'm leaving.");
         return;
    // current thread should be new thread. Therefore start the countdown
    CurrTime = InitTime;
    while(CurrTime.charAt(0) != '-') {      // go until current time is negative
         CurrTime = C.countDown();       // returns the current time based on the difference between the initial and elapsed time
         setText(CurrTime);                   // display current time in JLabel
    C.reset();
    setText(C.getCurrTime());What I'm trying to do is get a clock (C) to count down and display the time remaining in a JLabel (this snippet is taken from a method within that very JLabel which I'm extending from javax.swing.JLabel). While it's counting down, I'd like for the program to go off and do other things. Therefore, I'm trying to create a new thread that carries out the task of counting down while the original/main thread moves on to do other things.
    Please have a look at the above code and tell me if I'm on the right track. The one thing I don't know how to do is figure out how to tell which thread the current thread is. I'm assuming that both the new thread and original/main one will execute the if statement, the new one after it returns from start() (which I haven't defined). The original/main one will detect that it is not the new thread and return, whereas the new thread will and go on to the while loop. In the while loop, it will count down the clock until it reaches 0, after which point it will reset it and die.
    If I'm on the right track, all I need to know is how to detect which thread is currently executing. If I'm not on the right track, what would be the best way to do this?

    What? No! No Thread terminates on the return of start(). Those two events are unrelated!Uh... I think you misunderstood what I said.
    I didn't say that CountDownThread terminates upon returning from start() (which is what it sounds like you interpreted from me); I said that the thread that CountDownThread creates terminates once CountDownThread returns from start() (i.e. like any other local variable/object). This, of course, assumes that CountDownThread has a Runnable object on which to call its run() method (am I right?), in which case my code above doesn't create a new thread at all (i.e. CountDownThread.start() is executed within the main/original thread) - am I right?
    No, run() doesn't call start()! That would be stupid.Again, you misunderstood. I shouldn't need to explain this one. A simple reference to an ordinary dictionary on the words 'former' and 'latter' should suffice :)
    Anyway, all joking aside, I have now improved my code and it works! Here's what it looks like:
    ClockJLabel.java
    package MazeMania.clock;
    public class ClockJLabel extends javax.swing.JLabel {
    private Clock C;
    private ClockJLabelsRunnable CJLR;
    public ClockJLabel() {
      C = new Clock();
      CJLR = new ClockJLabelsRunnable();
      setText(C.getCurrTime()); // should be 00:00:00:00
      setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
      // need to figure out how to set the size so that it sticks
      setForeground(new java.awt.Color(255, 0, 0));
      setBackground(new java.awt.Color(0, 0, 0));
      setOpaque(true);
    // starts the clock counting up indefinitely from 0
    public void start() {
      (new Thread(new Runnable() {
        public void run() {
         while(true) setText(C.getElapsedTime());
       })).start();
      //System.out.println("Started clock...");
    // starts the clock counting down from an initial time and runs this count down in a separate thread
    public void countDown(String InitTime) {
      // initialize the clock
      try {C.initClock(InitTime);}
      catch(java.text.ParseException PE) {
       System.out.println(PE.getMessage());
      // initialize JLabel's display
      setText(C.getCurrTime());
      // prepare Runnable and give it to new Thread. New Thread starts count down.
      CJLR.task = CJLR.COUNTDOWN;
      CJLR.CJL = this;
      Thread CountDownThread = new Thread(CJLR);
      CountDownThread.start();
    public Clock getClock() {
      return C;
    }ClockJLabelsRunnable
    package MazeMania.clock;
    import java.lang.Runnable;
    class ClockJLabelsRunnable implements Runnable {
    public static int COUNTDOWN = 1;
    public static int COUNTUP = 2;
    // NOTE: this Runnable doesn't test for the proper setting of these variables
    public int task = 0;
    public ClockJLabel CJL = null;
    public void run() {
      Clock C = CJL.getClock();
      while(C.countDown().charAt(0) != '-') {CJL.setText(C.getCurrTime());}
      C.reset();
      CJL.setText(C.getCurrTime());

Maybe you are looking for