KeyListener Problem Java 6

Hallo all,
can anyone tell me how I can control Ctrl+K under keypressed or keytyped events? I tried to do it like that but it always take the keyCode of the Ctrl button not the K button
public void keyPressed(final KeyEvent e) {
              if(e.isControlDown()){
               if(e.getKeyChar()== KeyEvent.VK_K){
                  if (getSelectedRow() == -1 && getModel() instanceof DefaultTableModel) {
                    for (int c = 0; c < getColumnCount(); c++) {
                        if (getValueAt(0, c) instanceof CommentDisplayButton) {
                            ((CommentDisplayButton) getValueAt(0, c)).doClick();
        }

Not me, you've been told to use Key Bindings in the past. This requirement is easily handled by Key Bindings. That is the way all Swing components are coded.
You've also been asked to post a SSCCE when you have a problem.
I won't waste anymore time helping someone who doesn't listen to past suggestions.

Similar Messages

  • Problem : java.nt.SocketPermission

    Hi.
    I use j2sdk1.4.0 + Apache2 + Tomcat4.0.4
    My applet access tomcat servlets to query an Ora9i database.
    Most of the client W98, NT4 and W-XP can access my applet to query the servlets with the exception of 2.
    One client uses java 1.3.1_03 and when he tries to use applet over www , java console throws these error :
    RemotedemoClient : set URL to http://<my site> :   java.security.AccessControlException access denied (java.nt.SocketPermission proxy-iap resolve)
    at java.security.AccessControlContext.checkPermission(Unknown Source)
    at java.security.AccessController.checkPermission(Unknown Source)
    at java.lang.SecurityManager.checkPermission(Unknown Source)
    at java.lang.SecurityManager.checkConnect(Unknown Source)
    at java.net.InetAddress.getAllByName0(Unknown Source)
    at java.net.InetAddress.getAllByName0(Unknown Source)
    at java.net.InetAddress.getByName(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.getHttpProxyAuthentication(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
    at sun.plugin.protocol.jdk12.http.HttpURLConnection.getInputStream(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.getHeaderField(Unknown Source)
    at sun.plugin.protocol.jdk12.http.HttpURLConnection.checkCookieHeader(Unknown Source)
    at sun.plugin.protocol.jdk12.http.HttpURLConnection.getInputStream(Unknown Source)
    at com.developer.Tunnel.QueryCollection.retrieveQueries(QueryCollection.java:62)
    at com.developer.Tunnel.QueryCollection.run(QueryCollection.java:38)
    at java.lang.Thread.run(Unknown Source)
    java.security.AccessControlException: access denied (java.net.SocketPermission proxy-iap resolve)
    at java.security.AccessControlContext.checkPermission(Unknown Source)
    at java.security.AccessController.checkPermission(Unknown Source)
    at java.lang.SecurityManager.checkPermission(Unknown Source)
    at java.lang.SecurityManager.checkConnect(Unknown Source)
    at java.net.InetAddress.getAllByName0(Unknown Source)
    at java.net.InetAddress.getAllByName0(Unknown Source)
    at java.net.InetAddress.getByName(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.getHttpProxyAuthentication(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
    at sun.plugin.protocol.jdk12.http.HttpURLConnection.getInputStream(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.getHeaderField(Unknown Source)
    at sun.plugin.protocol.jdk12.http.HttpURLConnection.checkCookieHeader(Unknown Source)
    at sun.plugin.protocol.jdk12.http.HttpURLConnection.getInputStream(Unknown Source)
    at com.developer.Tunnel.client.BaseTunnelClient._invokeMethod(BaseTunnelClient.java:193)
    at com.developer.Tunnel.client.BaseTunnelClient._initialize(BaseTunnelClient.java:89)
    at com.developer.Tunnel.RemotedemoClient.<init>(RemotedemoClient.java:28)
    at com.developer.Tunnel.demoApplet.init(demoApplet.java:80)
    at sun.applet.AppletPanel.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    java.security.AccessControlException: access denied (java.net.SocketPermission proxy-iap resolve)
    at java.security.AccessControlContext.checkPermission(Unknown Source)
    at java.security.AccessController.checkPermission(Unknown Source)
    at java.lang.SecurityManager.checkPermission(Unknown Source)
    at java.lang.SecurityManager.checkConnect(Unknown Source)
    at java.net.InetAddress.getAllByName0(Unknown Source)
    at java.net.InetAddress.getAllByName0(Unknown Source)
    at java.net.InetAddress.getByName(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.getHttpProxyAuthentication(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
    at sun.plugin.protocol.jdk12.http.HttpURLConnection.getInputStream(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.getHeaderField(Unknown Source)
    at sun.plugin.protocol.jdk12.http.HttpURLConnection.checkCookieHeader(Unknown Source)
    at sun.plugin.protocol.jdk12.http.HttpURLConnection.getInputStream(Unknown Source)
    at com.developer.Tunnel.QueryCollection.retrieveQueries(QueryCollection.java:62)
    at com.developer.Tunnel.QueryCollection.run(QueryCollection.java:38)
    at java.lang.Thread.run(Unknown Source)Is this a firewall problem from their end ???
    Is this a catalina.policy problem from my end ???

    Yes it is a proxy problem. You can't do anything on the server side.
    Here's an article which you should read before you solve the problem:
    Java Tip 42: Write Java apps that work with proxy-based firewalls
    How to use Java to connect with HTTP servers outside your corporate firewall
    Summary
    This tip will show you how to write Java applications that can get past
    your corporate proxy and access Web servers on the Internet. Adding
    proxy support to your Java applications involves writing just a few
    additional lines of code and doesn't rely on any security "loopholes." (675 words)
    By Ron Kurr
    Almost every company is concerned with protecting its internal network from hackers and thieves. One common security measure is to completely disconnect the corporate network from the Internet. If the bad guys can't connect to any of your machines, they can't hack into them. The unfortunate side effect of this tactic is that internal
    users can't access external Internet servers, like Yahoo or JavaWorld. To address this problem, network administrators often install something called a "proxy server." Essentially, a proxy is a service that sits between the Internet and the internal network and manages connections between the two worlds. Proxies help reduce outside security threats while still allowing internal users to access Internet services. While Java makes it easy to write Internet clients, these clients are useless unless they can get past your proxy. Fortunately, Java makes it easy to work with proxies -- if you know the magic words, that is.
    The secret to combining Java and proxies lies in activating certain system properties in the Java runtime. These properties appear to be undocumented, and are whispered between programmers as part of the Java
    folklore. In order to work with a proxy, your Java application needs to specify information about the proxy itself as well as specify user information for authentication purposes. In your program, before you begin to work with any Internet protocols, you'll need to add the following lines:
    System.getProperties().put( "proxySet", "true" );
    System.getProperties().put( "proxyHost", "myProxyMachineName" );
    System.getProperties().put( "proxyPort", "85" );
    The first line above tells Java that you'll be using a proxy for your connections, the second line specifies the machine that the proxy lives on, and the third line indicates what port the proxy is listening on. Some proxies require a user to type in a username and password before Internet access is granted. You've probably encountered this behavior if you use a Web browser behind a firewall. Here's how to perform the authentication:
    URLConnection connection = url.openConnection();
    String password = "username:password";
    String encodedPassword = base64Encode( password );
    connection.setRequestProperty( "Proxy-Authorization", encodedPassword );
    The idea behind the above code fragment is that you must adjust your HTTP header to send out your user information. This is achieved
    with the setRequestProperty() call. This method allows you to manipulate the HTTP headers before the request is sent out. HTTP
    requires the user name and password to be base64 encoded. Luckily, there are a couple of public domain APIs that will perform the
    encoding for you (see the Resources section).
    As you can see, there's not a whole lot to adding proxy support to your Java application. Given what you now know, and a little research
    (you'll have to find out how your proxy handles the protocol you're interested in and how to deal with user authentication), you can
    implement your proxy with other protocols.
    Proxying FTP
    Scott D. Taylor sent in the magic incantation to deal with proxying the FTP protocol:
    defaultProperties.put( "ftpProxySet", "true" );
    defaultProperties.put( "ftpProxyHost", "proxy-host-name" );
    defaultProperties.put( "ftpProxyPort", "85" );
    You can then access the files URLs using the "ftp" protocol via something like:
    URL url = new URL("ftp://ftp.netscape.com/pub/navigator/3.04/windows/readme.txt" );
    The base64Encode() method is in the HTTPClient.Codecs class. Get the HTTPClient source from <http://www.innovation.ch/java/HTTPClient/>

  • Weird keylistener problem...

    I just upgraded my java to 1.4.2 which caused this problem i believe. I add an action listener with the following code:
        this.addKeyListener(new java.awt.event.KeyAdapter() {
          public void keyPressed(KeyEvent e) {
            main_keyPressed(e);
        });This worked fine in an older version of java, but in 1.4.2 it doesnt get my keyinput from the frame. 'this' refers to my class that extends JFrame... Im not sure what is wrong... maybe I added it to the wrong object even though it worked fine with another version of java.
    Thanks for your help,
    CoW

    If a control on the JFrame has the focus it needs to have the KeyListener, as in the appended code. In this case the JFrame passes the KeyStokes off to the JTextArea before the JFrame KeyListener sees them. Change the ta to this on line 14 and you will see no more KeyEvents.
    import javax.swing.*;
    import java.awt.event.*;
    import java.awt.*;
    class TestKey extends JFrame
         Container cp;
         JTextArea ta;
         TestKey()
              cp = getContentPane();
             ta = new JTextArea(20,80);
              ta.addKeyListener(new java.awt.event.KeyAdapter()
                    public void keyPressed(KeyEvent e)
                         main_keyPressed(e);
              cp.add(ta,BorderLayout.CENTER);
              pack();
         void main_keyPressed(KeyEvent e)
              System.out.println(e);
         static public void main(String[] args)
              TestKey tk;
              tk = new TestKey();
              tk.show();

  • KeyListener problems

    I'm making a simple Packman game as an Applet.
    To control the my pacmans I would like to use the keybord, but I'm having trouble getting my events through to the right receiver. The trouble is I'm not sending my events to a component in the applet class but directly to the class implementing the Pacmans.
    Could this be some kind of Focusproblem??
    Any ideas anyone??
    My pacmanclass goes as follows(abbreviated):
    import java.util.*;
    import java.awt.event.*;
    public class Pacman extends Brikke implements KeyListener{
    public void keyTyped(KeyEvent e) {
         //no action
    public void keyPressed(KeyEvent e) {
         //kode goes here, doesn't react     
    public void keyReleased(KeyEvent e) {
         //no action
    }

    Howdy. I was grappling with a similar problem not long ago and managed to work it out..
    The Component that has the focus will receive the Keystrokes.
    By default, the root Container of your program will have the focus, ie. all initial keystrokes that you enter will go to your Frame/Applet object or whatever.
    Component has a method : requestFocus() .. which moves the focus to that particular Component and hence, it eats up all the Keystrokes. Check that function out.
    .. now not knowing the structure of your program exactly, I can suggest a couple of arbitrary methods of keeping the keyfocus on your Pacman object.
    1. You can add a Focus Listener object to the root Container, that calls the requestFocus() method of the Pacman object as soon as it receives the focus itself. This would result in your root container never owning the Focus itself, as it would always pass focus onto the Pacman object as soon as it acquired focus itself.
    2. You could implement the KeyListener interface object into the Pacman object, which would turn the Pacman object into both the equivalent of a Component and a KeyListener object. That means, you can add the Pacman object as a KeyListener into the root Container using the addKeyListener(KeyListener object) method. This would result in the root Container keeping focus, but all keystrokes being passed to the Pacman object.
    Hope that made sense.

  • Installation Problem - Java SDK 1.4.1

    I have a problem with installing Java on my machine at home that you may be able to help me with.
    Here are the Details: 1) I installed the most recent java SDK on my machine. 2) I set the Autoexec file with the correct PATH statement. 3) Set the correct CLASSPATH statement 4) The "Java -Version" statement gives the correct reply that it is version 1.4.
    Below is my AutoExec.bat file
    SET windir=C:\WINDOWS
    SET winbootdir=C:\WINDOWS
    SET COMSPEC=C:\WINDOWS\COMMAND.COM
    SET PATH=C:\PROGRA~1\MICROS~3\OFFICE;C:\WINDOWS;C:\WINDOWS\COMMAND;C:\ATF
    SET CLASSPATH=C:\J2SDK1_4\LIB\TOOLS.JAR;.;
    SET PROMPT=$p$g
    SET TEMP=C:\WINDOWS\TEMP
    SET TMP=C:\WINDOWS\TEMP
    Problem: Trying to compile a simple "HelloWorld" Program with "javac Helloworld.java" produces the error "Bad Command or File name".
    Issues: Command Line in Windows ME requires 8.3 format. Inserts tilde "~" and a number into the names of the files. even using a short name such as "HelWrld.java" inserts a tilde because of the "java" extension. Have tried using a "jav" extension but that does not work as the error is the same.
    Question: How can I get rid of the "Bad Command or File Name"?

    My First Java Progam (for Windows with Java 2 SDK v1.4.1)
    Follow these instructions EXACTLY.
    1. Download and install the Java 2 SDK, Standard Edition. You can find it here:
    http://java.sun.com/j2se/downloads.html
    Select the download for your operating system and be sure to download the SDK (rightmost column) and not the JRE. (The JRE is only the Java Runtime Environment, which does not include the Java compiler and other tools needed for software development).
    2. Read the README and installation instructions! Read these instead of asking questions about installation etc. in the Java forums.
    README for Java 2 SDK v1.4.1: http://java.sun.com/j2se/1.4.1/README.html
    Java 2 SDK v1.4.1 for Windows installation: http://java.sun.com/j2se/1.4.1/install-windows.html
    Things to note:
    - After installing, add the bin directory of the SDK to your PATH environment variable. For example, if you installed the SDK in C:\j2sdk1.4.1_01, add the directory C:\j2sdk1.4.1_01\bin to your PATH. (If you don't know what an environment variable is and how to set it, read the documentation of Windows; if you're using Windows XP, this might be useful: http://support.microsoft.com/default.aspx?scid=KB;EN-US;q310519& ).
    3. Open Notepad and type in your first program:
    public class HelloWorld {
    public static void main(String[] args) {
    System.out.println("Hello World!");
    Save this program somewhere with the filename "HelloWorld.java".
    Things to note:
    - The case of text is important. Don't type "Helloworld", "helloworld" or anything else. Also the case of the filename is important (even though Windows has case-insensive filenames!).
    - Watch out that Notepad doesn't append ".txt" to the filename. The file should be named "HelloWorld.java", not "HelloWorld.java.txt".
    4. Open a command prompt and go to the directory that contains the file "HelloWorld.java" (with the CD command).
    5. Compile the progam with the following command:
    javac HelloWorld.java
    Things to note:
    - If you get something like "Unknown command: javac" or "Bad command or filename", you did not (correctly) add the bin directory of the SDK to the PATH (see step 2).
    6. Run the program. If you didn't get any compile errors, you now have a new file "HelloWorld.class" in the same directory. Run the program with the following command:
    java HelloWorld
    Things to note:
    - If you get: "Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorld/class", you have typed "java HelloWorld.class". Leave off the ".class" at the end. You are typing a class name here, not a filename.
    - If you get something like: "Exception in thread "main" java.lang.NoClassDefFoundError: helloworld (wrong name: HelloWorld)", you have typed the class name wrong. Note that the case is important (i.e., don't type "helloworld" but "HelloWorld")!
    - You don't need to set any classpath here. In Java 1.4, the current directory is included in the classpath automatically. For older versions of Java, you may need to add the current directory (".") to the classpath, like this:
    java -classpath . HelloWorld
    7. Congratulations with your first working Java program. Now follow these links:
    Java Tutorial
    http://java.sun.com/docs/books/tutorial/
    New to Java Programming Center
    http://developer.java.sun.com/developer/onlineTraining/new2java/
    FAQ
    http://java.sun.com/products/jdk/faq.html
    How Classes are Found
    http://java.sun.com/j2se/1.4/docs/tooldocs/findingclasses.html
    Setting the class path
    http://java.sun.com/j2se/1.4/docs/tooldocs/win32/classpath.html
    JavaTM 2 SDK Tools and Utilities
    http://java.sun.com/j2se/1.4/docs/tooldocs/tools.html
    Jesper

  • String problem java.lang.NullPointerException

    Hii all :)
    How are u?? :)
    I have a little a problem with String object in this class (You can say its a homework ^__^ ).
    public class Personne {
         private String nom;
         private String prenom;
         private int age;
         public Personne(){
              this(null, null, 0);
         public Personne(String nom, String prenom, int age){
              setNom(nom);
              setPrenom(prenom);
              setAge(age);
         public void setNom(String nom){
              this.nom = new String(nom);
         public void setPrenom(String prenom){
              this.prenom = new String(prenom);
         public void setAge(int age){
              this.age = age;
         public String getNom(){
              return this.nom;
         public String getPrenom(){
              return this.prenom;
         public int getAge(){
              return this.age;
         public String toString(){
              System.out.print("Nom : " + this.getNom() + ", Penom : " + this.getPrenom() + ", Age : " + this.getAge() + " ");
              return null;
    }When i call the class personne with the Personne() i get these errors in compiling-time :
    Exception in thread "main" java.lang.NullPointerException
         at java.lang.String.<init>(Unknown Source)
         at Personne.setNom(Personne.java:18)
         at Personne.<init>(Personne.java:12)
         at Personne.<init>(Personne.java:8)
         at Main.main(Main.java:4) // The line wich i inisialize my object in my main method.
    can someone help me??
    Thank you alll ^__^
    Edited by: La VloZ on 18 mai 2013 22:50
    Edited by: La VloZ on 18 mai 2013 22:51
    Edited by: La VloZ on 18 mai 2013 22:51
    Edited by: La VloZ on 18 mai 2013 22:53
    Edited by: La VloZ on 18 mai 2013 22:55

    Why the error? Because you invoke the constructor String(String s), with s null. The constructor would produce a new String with the same character sequence as s, but if s is null, it cannot do this, so it throws NullPointerException. What else could it do? Without throwing an exception, a constructor has to create a new object, but there is no raw material, so to speak, for the creation. Think what would/could you do if you had to write such a 'copy constructor' for your own class and you would be passed null.
    Now, the String copy constructor is probably useless, as the javadoc hints. When you have a String already, you don't need to create an identical one, as the original will:
    - Not be garbage collected, if you keep a reference to it
    - Never be modified, as strings are immutable
    You are right that the code you show would 'copy the reference of nom to this.nom' and this is ok. It's exactly what you need, for the reasons above.

  • RMI Problem --   java.rmi.UnmarshalException:

    I am having a client and a server.... when i am trying to bring the client into server. but when i am doing it... i am getting an exception as below as...
    java.rmi.UnmarshalException: Error unmarshaling return header; nested exception is:
         java.io.EOFException
         at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
         at sun.rmi.server.UnicastRef.invoke(Unknown Source)
         at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
         at java.rmi.Naming.lookup(Unknown Source)
         at hsmsgui.rmtmgmt.RmtMgmtHandler.contactClient(RmtMgmtHandler.java:176)
         at hsmsgui.display.AddClientWzd.onFinishBtnClicked(AddClientWzd.java:488)
         at hsmsgui.display.AddClientWzd.actionPerformed(AddClientWzd.java:346)
         at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
         at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
         at java.awt.Component.processMouseEvent(Unknown Source)
         at javax.swing.JComponent.processMouseEvent(Unknown Source)
         at java.awt.Component.processEvent(Unknown Source)
         at java.awt.Container.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Window.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
         at java.awt.Dialog$1.run(Unknown Source)
         at java.awt.Dialog$3.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.awt.Dialog.show(Unknown Source)
         at hsmsgui.display.AddClientAction.actionPerformed(AddClientAction.java:38)
         at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
         at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
         at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
         at java.awt.Component.processMouseEvent(Unknown Source)
         at javax.swing.JComponent.processMouseEvent(Unknown Source)
         at java.awt.Component.processEvent(Unknown Source)
         at java.awt.Container.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Window.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)
    Caused by: java.io.EOFException
         at java.io.DataInputStream.readByte(Unknown Source)
         ... 60 more
    can any one help me out to solve this problem.......

    Thanks for ur reply...Now i' m getting the access denied problem..
    I am able to create the rmi registry successfully on the server, Then Binding is also done successfully. but when i try to connect the client to the server the exception is thrown Please help me..
    TEST - client PC name.
    java.security.AccessControlException: access denied (java.net.SocketPermission TEST resolve)
         at java.security.AccessControlContext.checkPermission(Unknown Source)
         at java.security.AccessController.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkConnect(Unknown Source)
         at java.net.InetAddress.getAllByName0(Unknown Source)
         at java.net.InetAddress.getAllByName0(Unknown Source)
         at java.net.InetAddress.getAllByName(Unknown Source)
         at java.net.InetAddress.getByName(Unknown Source)
         at java.net.InetSocketAddress.<init>(Unknown Source)
         at java.net.Socket.<init>(Unknown Source)
         at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(Unknown Source)
         at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(Unknown Source)
         at sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknown Source)
         at sun.rmi.transport.tcp.TCPChannel.createConnection(Unknown Source)
         at sun.rmi.transport.tcp.TCPChannel.newConnection(Unknown Source)
         at sun.rmi.server.UnicastRef.newCall(Unknown Source)
         at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
         at java.rmi.Naming.lookup(Unknown Source)
         at hsmsgui.rmtmgmt.RmtMgmtHandler.contactClient(RmtMgmtHandler.java:176)
         at hsmsgui.display.AddClientWzd.onFinishBtnClicked(AddClientWzd.java:488)
         at hsmsgui.display.AddClientWzd.actionPerformed(AddClientWzd.java:346)
         at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
         at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
         at java.awt.Component.processMouseEvent(Unknown Source)
         at javax.swing.JComponent.processMouseEvent(Unknown Source)
         at java.awt.Component.processEvent(Unknown Source)
         at java.awt.Container.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Window.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
         at java.awt.Dialog$1.run(Unknown Source)
         at java.awt.Dialog$3.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.awt.Dialog.show(Unknown Source)
         at hsmsgui.display.AddClientAction.actionPerformed(AddClientAction.java:38)
         at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
         at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
         at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
         at java.awt.Component.processMouseEvent(Unknown Source)
         at javax.swing.JComponent.processMouseEvent(Unknown Source)
         at java.awt.Component.processEvent(Unknown Source)
         at java.awt.Container.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Window.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)

  • DbAssistant Problems & Java Problems in General

    Like many people in this situation, I have struggled with
    installing 8.1.5. The biggest problem was that dbAssist
    appeared to not install correctly (it actually installed, but
    could not launch). The error is a java class exception "Could
    not find java.lang.Thread."
    The problem lies in that Oracle is not loading the JVM using
    environment variables PATH and CLASSPATH (which is the JAVA
    way). Instead they have hard-coded paths to specific classes.
    Oracle products are looking for java.lang.Thread in the rt.jar
    file which may or may not exist (depending on whether you have
    the JDK or the JRE). Instead you may have classes.zip which
    also has the java.lang.Thread class.
    The fix that worked for me is simply to link rt.jar to
    classes.zip.
    $ cd /usr/local/jre/lib
    $ ln -s classes.zip rt.jar
    So far this seems to work well (in light of the total install
    experience).
    null

    That's because you are using the JDK (which uses classes.zip),
    instead of the JRE (which uses rt.jar) as mentioned in the docs.
    David Rasmussen (guest) wrote:
    : Like many people in this situation, I have struggled with
    : installing 8.1.5. The biggest problem was that dbAssist
    : appeared to not install correctly (it actually installed, but
    : could not launch). The error is a java class exception "Could
    : not find java.lang.Thread."
    : The problem lies in that Oracle is not loading the JVM using
    : environment variables PATH and CLASSPATH (which is the JAVA
    : way). Instead they have hard-coded paths to specific classes.
    : Oracle products are looking for java.lang.Thread in the rt.jar
    : file which may or may not exist (depending on whether you have
    : the JDK or the JRE). Instead you may have classes.zip which
    : also has the java.lang.Thread class.
    : The fix that worked for me is simply to link rt.jar to
    : classes.zip.
    : $ cd /usr/local/jre/lib
    : $ ln -s classes.zip rt.jar
    : So far this seems to work well (in light of the total install
    : experience).
    null

  • Axis Client Web Service call problem: java.io.IOException: Stream closed

    Hi, I tried to call a webservice from Axis Client, and I encounter the following error. Do you guys have any idea what actually happens?
    Please help, I am newbie in web services.
    ==============Root Cause===============
    AxisFault
    faultCode: { h t t p : / / schemas.xmlsoap.org/soap/envelope/}Server.userException
    faultSubcode:
    faultString: java.io.IOException: Stream closed
    faultActor:
    faultNode:
    faultDetail:
         {h t t p : / / xml.apache.org/axis/}stackTrace:java.io.IOException: Stream closed
         at java.io.BufferedInputStream.ensureOpen(BufferedInputStream.java:120)
         at java.io.BufferedInputStream.read(BufferedInputStream.java:270)
         at org.apache.commons.httpclient.ContentLengthInputStream.read(ContentLengthInputStream.java:170)
         at java.io.FilterInputStream.read(FilterInputStream.java:111)
         at org.apache.commons.httpclient.AutoCloseInputStream.read(AutoCloseInputStream.java:108)
         at java.io.FilterInputStream.read(FilterInputStream.java:90)
         at org.apache.commons.httpclient.AutoCloseInputStream.read(AutoCloseInputStream.java:127)
         at org.apache.commons.httpclient.HttpMethodBase.getResponseBody(HttpMethodBase.java:688)
         at org.apache.commons.httpclient.HttpMethodBase.getResponseBodyAsString(HttpMethodBase.java:796)
         at org.apache.axis.transport.http.CommonsHTTPSender.invoke(CommonsHTTPSender.java:224)
         at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
         at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
         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 org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86)
         at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
         at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:529)
         {h t t p : / / xml.apache.org/axis/}hostname:compname
    java.io.IOException: Stream closed
         at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
         at org.apache.axis.transport.http.CommonsHTTPSender.invoke(CommonsHTTPSender.java:301)
         at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
         at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
         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 org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86)
         at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
         at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:529)     
    Caused by: java.io.IOException: Stream closed
         at java.io.BufferedInputStream.ensureOpen(BufferedInputStream.java:120)
         at java.io.BufferedInputStream.read(BufferedInputStream.java:270)
         at org.apache.commons.httpclient.ContentLengthInputStream.read(ContentLengthInputStream.java:170)
         at java.io.FilterInputStream.read(FilterInputStream.java:111)
         at org.apache.commons.httpclient.AutoCloseInputStream.read(AutoCloseInputStream.java:108)
         at java.io.FilterInputStream.read(FilterInputStream.java:90)
         at org.apache.commons.httpclient.AutoCloseInputStream.read(AutoCloseInputStream.java:127)
         at org.apache.commons.httpclient.HttpMethodBase.getResponseBody(HttpMethodBase.java:688)
         at org.apache.commons.httpclient.HttpMethodBase.getResponseBodyAsString(HttpMethodBase.java:796)
         at org.apache.axis.transport.http.CommonsHTTPSender.invoke(CommonsHTTPSender.java:224)
         ... 17 more  I am calling through proxy, the setting is as follows:
                System.setProperty("https.proxyHost", [proxyname here]);
                System.setProperty("https.proxyPort", [proxyport here]);
                System.setProperty("http.proxyHost", [proxyname here]);
                System.setProperty("http.proxyPort", [proxyport here]);

    Are there any problems showing up in the server's log?

  • Problem Java addin

    Hi to everyone:
       Excuse I'm installing CI Java Addin in remote form, but the problem is that the screen puts in blank and I can't see the status, someone can help me saying me the log where all the things of the sapInstGui save .
    Thanks

    Hi Joel,
    In case of windows it is:
    %ProgramFiles%\sapinst_instdir\<installation_specific>
    Here %ProgramFiles% means the path for program files folder.
    Normally it is C:\Program Files.
    In case of unix check
    /tmp/sapinst_instdir/<installation_specific>.
    Please award points if the answer was useful.
    Regards.
    Ruchit.

  • OSB Problem: java.lang.OutOfMemoryError: getNewTla

    Hi there,
    Yesterday I posted a problem related to the OSB console not loading and giving an error (<BEA-381951> JCA inbound request only invocation failed
    Since then I've looked harder at the problem and realised that the real problem was the following exception:
    ####<28/Jul/2010 11H16m BST> <Error> <Kernel> <Server> <AdminServerOsb> <[ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <a7acfb4f5f216892:-3c87e2be:12a1882fb62:-8000-000000000001fc60> <1280312179687> <BEA-000802> <ExecuteRequest failed
    java.lang.OutOfMemoryError: getNewTla.
    java.lang.OutOfMemoryError: getNewTla
         at java.util.concurrent.ConcurrentHashMap$KeySet.iterator(ConcurrentHashMap.java:1169)
         at weblogic.socket.SocketMuxer.getSocketsIterator(SocketMuxer.java:610)
         at weblogic.socket.SocketMuxer$TimerListenerImpl.timerExpired(SocketMuxer.java:955)
         at weblogic.timers.internal.TimerImpl.run(TimerImpl.java:273)
         at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    This exception is occurring every time I make a request to the weblogic server.
    I can't find any explanation about this problem anywhere so I'm asking for some help.
    Best Regards,
    Daniel Alves

    sorry for interfering but this kind of issues should be accompanied by analysis done with JRockit Mission Control Runtime Analysis (Flight Recording)
    http://download.oracle.com/docs/cd/E15289_01/doc.40/e15070/toc.htm
    take also advantage of the oomdiagnostics flag of JRockit.
    JRockit contains WONDERFUL diagnostics tools, if you learn how to use them you are the King of Persia.
    unless you determine the cause it's very difficult to address it by trial and error. Besides, if (if!) you have a memory leak there is no point in changing the JVM parameters....

  • Database connection problem java.lang.ArrayIndexOutOfBoundsException

    Hi,
    I am using Interstage server 7 and Oracle 11g for upgradation of project, application compilation is fine, but when I run the application its giving database connection exception.
    Full stack trace like below. JDK version is 1.3. can anybody tell me what may be the problem?
    2010-11-22 15:16:42 - ConnectionPool()
    java.lang.ArrayIndexOutOfBoundsException
         at oracle.security.o3logon.C1.r(C1)
         at oracle.security.o3logon.C1.l(C1)
         at oracle.security.o3logon.C0.c(C0)
         at oracle.security.o3logon.O3LoginClientHelper.getEPasswd(O3LoginClientHelper)
         at oracle.jdbc.ttc7.O3log.<init>(O3log.java:291)
         at oracle.jdbc.ttc7.TTC7Protocol.logon(TTC7Protocol.java:257)
         at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:307)
         at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:442)
         at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:321)
         at java.sql.DriverManager.getConnection(DriverManager.java:512)
         at java.sql.DriverManager.getConnection(DriverManager.java:172)
         at jp.tt.framework.db.DBConnection.getConnection(DBConnection.java:65)
         at jp.tt.framework.db.DBConnection.getConnection(DBConnection.java:88)
         at jp.tt.framework.db.ConnectionPool.<init>(ConnectionPool.java:38)
         at jp.tt.framework.BaseCommon.<clinit>(BaseCommon.java:217)
         at jp.tt.framework.core.Crypt.getInstance(Crypt.java:79)
         at org.apache.jsp.menu_jsp._jspService(menu_jsp.java:53)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:309)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:239)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:362)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:246)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:511)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:270)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:412)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:301)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2515)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:249)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:184)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:180)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.valves.RequestFilterValve.process(RequestFilterValve.java:370)
         at org.apache.catalina.valves.RemoteAddrValve.invoke(RemoteAddrValve.java:137)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:232)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:646)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:436)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:806)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
         at java.lang.Thread.run(Thread.java:479)
    Thanks in advance
    Manjunath
    Edited by: 814259 on 2010/11/21 23:47
    Edited by: 814259 on 2010/11/21 23:49

    Thank you for the replies
    The problem got solved. Problem was older version of Oracle driver was placed in WEB-INF/lib and a directory called lbrary(we created it) above WEB-INF, we were placed newer version of driver in oracle's jdbc/lib directory and specified that path in classpath. But by default the older version was prioritized and used by application so we were getting the exception mentioned. When we deleted older version of driver everything got working. This explation may help for those who have similar type of problems.
    Thanks

  • Keylistener problem... please help....

    Here is a piece of code that was killing me today ... I want to allow the user only to type numbers in the field .. could someone please rewrite the part of the code that is wrong...
    Thank Youuuuuu In Advance
    public Ccc(){
    NumericKeyHandler keyh = new NumericKeyHandler();
    JTextField field = new JTextField();
    field.addKeyListener(keyh);
    private class NumericKeyHandler implements KeyListener{
    public void keyPressed(KeyEvent e){
    if(!(Character.isDigit(e.getKeyChar()) || e.getKeyChar()=='.'))
    e.consume(); }
    public void keyReleased(KeyEvent e){ if(!(Character.isDigit(e.getKeyChar()) || e.getKeyChar()=='.'))
    e.consume(); }
    public void keyTyped(KeyEvent e){
    if(!(Character.isDigit(e.getKeyChar()) || e.getKeyChar()=='.'))
    e.consume();
    }// ends NumericKeyHandler
    private class ReturnKeyHandler implements KeyListener{
    public void keyPressed(KeyEvent e){
    if(!(Character.isDigit(e.getKeyChar()) || e.getKeyChar()=='.'))
    e.consume(); }
    public void keyReleased(KeyEvent e){
    if(!(Character.isDigit(e.getKeyChar()) || e.getKeyChar()=='.'))
    e.consume(); }
    public void keyTyped(KeyEvent e){
    if(!(Character.isDigit(e.getKeyChar()) || e.getKeyChar()=='.'))
    e.consume();
    }// ends ReturnKeyHandler
    }// ends Ccc

    The code works fine by me
    import javax.swing.*;
    import javax.swing.event.*;
    import java.awt.*;
    import java.awt.event.*;
    public class Ccc
      public static void main(String[] arg )
        new Ccc();
      public Ccc()
        NumericKeyHandler keyh = new NumericKeyHandler();
        JTextField field = new JTextField();
        field.addKeyListener(keyh);
        JFrame frame = new JFrame();
        frame.getContentPane().add(field);
        frame.setSize(400,400);
        frame.setVisible(true);
      private class NumericKeyHandler implements KeyListener
        public void keyPressed(KeyEvent e)
          if(!(Character.isDigit(e.getKeyChar()) || e.getKeyChar()=='.'))
            e.consume();
        public void keyReleased(KeyEvent e)
          if(!(Character.isDigit(e.getKeyChar()) || e.getKeyChar()=='.'))
            e.consume();
        public void keyTyped(KeyEvent e)
          if(!(Character.isDigit(e.getKeyChar()) || e.getKeyChar()=='.'))
            e.consume();
      }// ends NumericKeyHandler
      private class ReturnKeyHandler implements KeyListener
        public void keyPressed(KeyEvent e)
          if(!(Character.isDigit(e.getKeyChar()) || e.getKeyChar()=='.'))
            e.consume();
        public void keyReleased(KeyEvent e)
          if(!(Character.isDigit(e.getKeyChar()) || e.getKeyChar()=='.'))
            e.consume();
        public void keyTyped(KeyEvent e)
          if(!(Character.isDigit(e.getKeyChar()) || e.getKeyChar()=='.'))
            e.consume();
      }// ends ReturnKeyHandler
    }// ends Ccc

  • JSP AND BEAN PROBLEm   java.lang.nullpointerexception   help me please

    hello i have a problem, when i open login.jsp and enter the form i have nullpointerexception. i don't understand where i wrong... i use tomcat 5.5 ... sorry for my english i'm italian and i speak only italian :(
    login.jsp this is the code of the java server page
    <html>
    <%@ page language="java" import="java.sql.*" %>
    <jsp:useBean id="lavoro" scope="page" class="Ok.Dino"/>
    <%@ page session="false" %>
    <style type="text/css">
    <!--
    body {
         background-color: #003366;
    a:link {
         color: #CCCCCC;
    .style1 {
         color: #000000;
         font-weight: bold;
         font-size: x-large;
    .style4 {font-size: 18px}
    -->
    </style>
    <body>
    <%if(request.getMethod()=="GET"){
    %>
    <form action="login.jsp" method= "POST" name="frmlogin" id="frmlogin">
         <div align="center">
           <p class="style1">AUTENTICAZIONE</p>
           <p> </p>
           <table width="318" height="140" border="1">
            <tr>
              <td width="95" height="60" bordercolor="#000000" bgcolor="#0066CC"><p align="center"><strong>USER</strong></p>          </td>
              <td width="207" bgcolor="#0099CC"><p align="center">
                <input type="text" name="txtnome"></p>
              </td>
            </tr>
            <tr>
              <td height="72" bordercolor="#000000" bgcolor="#0066CC"><strong>PASSWORD</strong> </td>
              <td width="207" bgcolor="#0099CC"><div align="center">
                <input name="pwdtxt" type="password">
              </div></td>
            </tr>
          </table>
           <table width="318" border="1">
            <tr>
              <td width="318" height="87"> <div align="center">
                <input name="submit" type="submit" value="invia"  >
              </div>
              <p align="center"><strong><span class="style4">Se non sei registrato fallo <a href="file:///C|/Documents and Settings/access/Documenti/My Received Files/registrazione.jsp">adesso </a></span></strong></p></td>
            </tr>
          </table>
           <p> </p>
           <p> </p>
      </div>
    </form>
    <%}else {  %>
    <%lavoro.settxtnome(request.getParameter("txtnome"));%>
    <%!ResultSet rs=null;
         String x=null;
    %>
    <% lavoro.cn_db("dbutenti");%>
    <% rs=lavoro.run_query("SELECT user FROM utenti");%>
    <%}%>
    </body>
    </html>and this is the bean code
    package Ok;
    import java.sql.*;
    public class Dino
    private String txtnome,pwdtxt;
    private Connection cn=null;
    private Statement st=null;
    private ResultSet Rs=null;
    public String gettxtnome()
    return txtnome;
    public String getpwdtxt()
    return pwdtxt;
    public void settxtnome(String n)
    this.txtnome=n;
    public void setpwdtxt(String n)
    this.pwdtxt=n;
    public void cn_db(String db)
              if(cn==null){
              //1. Caricamento del driver
              try{
                   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
              }catch(ClassNotFoundException cnfe){
                   System.out.println("impossibile caricare il driver");
                   System.exit(1);
              try{
                   //2. Connessione al DB
                   cn = DriverManager.getConnection("jdbc:odbc:"+db);
                   //3. creazione degli oggetti Statement e ResultSet
                   st =cn.createStatement();
              }catch(SQLException e){
                   System.out.println(e+"jjj");
    }else{
         System.out.print("errore database gi�� creato");
    public ResultSet run_query(String qr)
         try{
    Rs=st.executeQuery(qr);
         }catch(SQLException e)
         System.out.print(e+"ecco l'error");
         return Rs;
    }

    Do you understand when a NullPointerException will be thrown? This will be thrown if you want to access an uninstantiated Object.
    So look to the stacktrace and go to the line where the NPE is been thrown and doublecheck if the object reference is actually instantiated.
    Or add a null-check to the object reference:if (someObject != null) {
        someObject.doSomething();
    }or just instantiate it:if (someObject == null) {
        someObject = new SomeObject();
    someObject.doSomething();

  • Hashtable problem - java.io.NotSerializableException

    I'm having trouble writing a hashtable out to a file. I know that the writeObject() method in ObjectOutputStream requires whatever it writes to be serializable, so I made the PlayerScore class implement serializable.. Now it gives "Not serializable Exeption: java.io.NotSerializableException: PluginMain" where PluginMain is the class that contains the hashtable. If I have it Implement Serializable I get the same error with what I would guess is a super class of mine named BotCore.
    All the source is here: www.witcheshovel.com/WartsStuff/PluginMain.java
    Here are what I believe to be the offending portions of the code:
         private Hashtable<String, PlayerScore> scoreTable;
         private void saveScores() {
              try {
                   out.showMessage("Hash a a string: " + scoreTable.toString());
                   String scoreFile = getSetting("8. Score File");     
                   FileOutputStream fileOut = new FileOutputStream (scoreFile);
                   ObjectOutputStream objectOut = new ObjectOutputStream(fileOut);
                   Object scores = (Object)scoreTable;
                   //objectOut.writeObject(scores);
                   objectOut.writeObject(scoreTable);
                   objectOut.close();
                   fileOut.close();
              catch (NotSerializableException a) {out.showMessage("Not serializable Exeption: " + a);}
              catch (Exception e) {out.showMessage("Failed to save file with error:" + e);}
         public class PlayerScore implements Serializable {     //Class for keeping player scores
              String playerName;
              int longestStreak=0;
              int totalCorrect=0;
              public PlayerScore() {}
              public PlayerScore(String name) {
                   playerName = name;
              public void setTotalCorrect(int newCorrect) {
                   totalCorrect = newCorrect;
              public void incTotalCorrect() {
                   totalCorrect++;
              public void setLongestStreak(int streak) {
                   longestStreak=streak;
              public void incLongestStreak() {
                   longestStreak++;
              public String getName() {
                   return playerName;
              public int getStreak() {
                   return longestStreak;
              public int getTotalCorrect() {
                   return totalCorrect;
         }

    Does it look like this:
    class PluginMain
      class PlayerScore implements Serializable
    }If PlayerScore (or anything else you try to serialize) is an inner class it has a hidden reference to its containing class (i.e. PluginMain.this), so serializing it will try to serialize the containing class. You can make the nested class static, or place it outside the scope of the containing class. If it still needs a reference to the containing class put it in explicitly and make it transient, but you will have a problem at the receiving end.

Maybe you are looking for

  • Memory questions concerning Mid 2010 Nehalem 4-core

    I have a Mid 2010 Nehalem 4 core Mac Pro - the base $2499 model which I purchased to upgrade from a Dual 1.8 GHz G5 (which still works great as a media center). The G5 had 4 GB of memory which was sufficient. The new Mac Pro came with only 3 GB and I

  • What formats can the Mac DVD player App support/play?

    I have a list of movies that I imported from my friend, and, I'm having a hard time trying to figure out which formats will work and which wont--totally not tech savvy enough to figure this one out.

  • Status record alert by timer

    Dear all, i am still developing a "help desk" application using Oracle Developer 6i. I have one feature in my application that i dont know how to make it. The feature is : i have to showing an alert every xx minutes (e.g : 5 minutes) for every compla

  • Af|menu in vertical layout... It's possible?

    Hello, It's possible to have a menu in "vertical mode"? | menu1 |          | Submenu1 |                         | CommandMenu1    |                         | GoCommandMenu1  |Thanks. Edited by: MarS on 23/Set/2011 3:49

  • Can I update from Director MX to Director 12 on my MAC?

    Since Adobe no longer supports (or offers, as far as I know) versions of Director between MX and 12, I am wondering if I have an upgrade path from MX.  Anyone know? Thanks. Dewey