Java.lang.InstantiationException when using Action class with constructor

Hi everyone,
I'm using the insertNewNode() method from this class in another action class, which works fine. But when this action itself is called, I get an infinite java.lang.InstantiationException (until the stack is overflowed). I'm initiating the fields required in every method in a constructor. If there is no constructor, this action works fine again. What's wrong?
public class GliederungNewAction implements Action {
     private final String DEFAULT_DESCRIPTION = "Neuer Punkt";
     private OracleConnection connection;
     private String username;
     private String catalogue;
     private String attribute;
     private String parent_attr;
     private int parent_sequenceNr;
     private int requiredSequenceNumber;
     public GliederungNewAction(OracleConnection connection, String username, String catalogue) {
          this.connection = connection;
          this.username = username;
          this.catalogue = catalogue;
     public String perform(ActionMapping mapping, HttpServletRequest request,
               HttpServletResponse response) {
          HttpSession session = request.getSession();
          // fetch the necessary parameters from the JSP site
          // the parent attribute is the selected attribute!
          parent_attr = request.getParameter("attr");
          catalogue = request.getParameter("catalogue");
          parent_sequenceNr = Integer.parseInt(request.getParameter("sort_sequence"));
          username = session.getAttribute("username").toString().toUpperCase();
          // connect to database    
          db.SessionConnection sessConn = (db.SessionConnection) session.getAttribute("connection");
          if (sessConn != null) {
               try {
                    sessConn.setAutoCommit(false);
                    connection = (OracleConnection)sessConn.getConnection();
                    // insert the new node into DB
                    insertNewNode(DEFAULT_DESCRIPTION, parent_attr, parent_sequenceNr);               
                    connection.commit();
                    // set attributes for JSP post-action operations
                    request.setAttribute("attr", attribute);
                    request.setAttribute("parent_attr", parent_attr);
               } catch(SQLException ex) {
                    if ( ex.getErrorCode() == 20001 ) {
                         return "error_edit.do";
                    } else { // for all other error codes, rollback and return general error page
                         try {
                              connection.rollback();
                              ex.printStackTrace();
                              return "error_general.do";
                         } catch (SQLException e) {
                              System.err.println("Rollback failed!");
                              e.printStackTrace();
                              return "error_general.do";
                         } // end of catch     
                    } // end of else
               } // end of catch
          return mapping.getForward();
        // sample method
      * Creates, fills and executes a prepared statement to insert a new entry into the specified table, representing
      * a new node in the catalogue.
      * @param parent_attr TODO
      * @param parent_sequenceNr TODO
      * @throws SQLException
     public void insertNewNode(String description, String parent_attr, int parent_sequenceNr) throws SQLException {
               requiredSequenceNumber = getRequiredSequenceNumber(parent_attr, parent_sequenceNr);
               int freeSequenceNumber = getFreeSequenceNumber(requiredSequenceNumber);
               int lastPosition = getLastNodePosition( getLastChildAttribute(parent_attr) );
               attribute = createNewNodeAttribute(parent_attr, lastPosition);
               String callAddNode = "{ call package.addNode(:1, :2, :3, :4, :5, :6, :7) }";
               CallableStatement cst;
               cst = connection.prepareCall(callAddNode);
               cst.setString(1, username );
               cst.setString(2, catalogue);
               cst.setString(3, attribute);
               cst.setString(4, parent_attr);
               cst.setString(5, description);
               cst.setInt(6, requiredSequenceNumber);
               cst.setInt(7, freeSequenceNumber);
               cst.execute();
               cst.close();
java.lang.InstantiationException: action.GliederungNewAction
     at java.lang.Class.newInstance0(Unknown Source)
     at java.lang.Class.newInstance(Unknown Source)
     at action.ActionMapping.perform(ActionMapping.java:54)
     at ControllerServlet.doResponse(ControllerServlet.java:92)
     at ControllerServlet.doPost(ControllerServlet.java:50)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
     at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:679)
     at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:431)
     at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:355)
     at ControllerServlet.doResponse(ControllerServlet.java:103)
     at ControllerServlet.doPost(ControllerServlet.java:50)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
     .......

You're welcome.
Still, I would report this as a bug at the Struts mailinglist/issuetracker. This silly behaviour shouldn't happen. Once an InstantiationException, okay, but in an infinite loop?!? That's definately a bug. Also the detail message may be more informative, e.g. "No default constructor found" or so.

Similar Messages

  • Java.lang.InstantiationException on user defined class

    Hi all,
    I'm getting the following exception.
    Portable(java.io.IOException): An exception occurred instantiating a PortableObject user type from a POF stream: type-id=2001, class-name=com.inmdb.CacheRowDataExtractor, exception=
    java.lang.InstantiationException: com.inmdb.CacheRowDataExtractor
    at com.tangosol.io.pof.PortableObjectSerializer.deserialize(PortableObjectSerializer.java:121)
    at com.tangosol.io.pof.PofBufferReader.readAsObject(PofBufferReader.java:3293)
    at com.tangosol.io.pof.PofBufferReader.readObject(PofBufferReader.java:2600)
    at com.tangosol.util.filter.ExtractorFilter.readExternal(ExtractorFilter.java:165)
    at com.tangosol.util.filter.ComparisonFilter.readExternal(ComparisonFilter.java:227)
    at com.tangosol.util.filter.LikeFilter.readExternal(LikeFilter.java:367)
    at com.tangosol.io.pof.PortableObjectSerializer.initialize(PortableObjectSerializer.java:153)
    at com.tangosol.io.pof.PortableObjectSerializer.deserialize(PortableObjectSerializer.java:128)
    at com.tangosol.io.pof.PofBufferReader.readAsObject(PofBufferReader.java:3293)
    at com.tangosol.io.pof.PofBufferReader.readAsObjectArray(PofBufferReader.java:3337)
    at com.tangosol.io.pof.PofBufferReader.readObjectArray(PofBufferReader.java:2169)
    at com.tangosol.util.filter.ArrayFilter.readExternal(ArrayFilter.java:235)
    at com.tangosol.io.pof.PortableObjectSerializer.initialize(PortableObjectSerializer.java:153)
    at com.tangosol.io.pof.PortableObjectSerializer.deserialize(PortableObjectSerializer.java:128)
    at com.tangosol.io.pof.PofBufferReader.readAsObject(PofBufferReader.java:3293)
    at com.tangosol.io.pof.PofBufferReader.readObject(PofBufferReader.java:2600)
    at com.tangosol.io.pof.ConfigurablePofContext.deserialize(ConfigurablePofContext.java:348)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.Service.readObject(Service.CDB:4)
    at com.tangosol.coherence.component.net.Message.readObject(Message.CDB:1)
    at com.tangosol.coherence.component.net.message.requestMessage.distributedCacheRequest.partialRequest.FilterRequest.read(FilterRequest.CDB:8)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.DistributedCache$QueryRequest.read(DistributedCache.CDB:1)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.onNotify(Grid.CDB:123)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.DistributedCache.onNotify(DistributedCache.CDB:3)
    at com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:42)
    at java.lang.Thread.run(Thread.java:595)
    at <process boundary>
    at com.tangosol.io.pof.ThrowablePofSerializer.deserialize(ThrowablePofSerializer.java:57)
    at com.tangosol.io.pof.PofBufferReader.readAsObject(PofBufferReader.java:3293)
    at com.tangosol.io.pof.PofBufferReader.readObject(PofBufferReader.java:2600)
    at com.tangosol.io.pof.PortableException.readExternal(PortableException.java:150)
    at com.tangosol.io.pof.ThrowablePofSerializer.deserialize(ThrowablePofSerializer.java:58)
    at com.tangosol.io.pof.PofBufferReader.readAsObject(PofBufferReader.java:3293)
    at com.tangosol.io.pof.PofBufferReader.readObject(PofBufferReader.java:2600)
    at com.tangosol.io.pof.ConfigurablePofContext.deserialize(ConfigurablePofContext.java:348)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.Service.readObject(Service.CDB:4)
    at com.tangosol.coherence.component.net.Message.readObject(Message.CDB:1)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.DistributedCache$QueryResponse.read(DistributedCache.CDB:33)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.onNotify(Grid.CDB:123)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.DistributedCache.onNotify(DistributedCache.CDB:3)
    at com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:42)
    at java.lang.Thread.run(Thread.java:595)
    class looks like:-
    public class CacheRowDataExtractor extends AbstractExtractor implements
              PortableObject, Serializable {
    // code
    What could be the problem?
    Thanks in advance,
    Rony

    Hi Rony,
    Yes it is mandatory. The default POF serializer just calls newInstance() on the Class to create an instance and it has no way of knowing how to call parameterised constructors. If you must have parameterised constructors then you would need to use external serializers rather than implement PortableObject. The docs are here: http://docs.oracle.com/cd/E24290_01/coh.371/e22837/api_pof.htm#BABEJCFF
    Does your Dev environment only have a single Coherence process, if so then nothing will be getting serialised so you will not see this sort of error. This is a common dev mistake and if possible you should always write Dev tests to use multiple nodes and also write unit tests to test POF serialisation.
    Writing a unit test is pretty easy...
    ConfigurablePofContext ctx = new ConfigurablePofContext("... name of your pof config file ...");
    CacheRowDataExtractor value = new CacheRowDataExtractor......
    Binary binary = ExternalizableHelper.toBinary(value, ctx);
    CacheRowDataExtractor result = (CacheRowDataExtractor) ExternalizableHelper.fromBinary(binary, ctx);
    ... now assert result is equal to original value ...JK

  • Java.lang.NullPointerException when using readTemplate with WLST offline

    I imported WLST offline as a module in to jython script and tried
    wlstOffline.readTemplate('../wls.jar')
    It gives me a java.lang.NullPointerException.
    Here is the entire stack trace
    Traceback (innermost last):
      File "testOffline.py", line 3, in ?
      File "E:\wlst\wlstOffline.py", line 78, in readDomain
    java.lang.NullPointerException
            at com.bea.plateng.domain.script.jython.WLScriptContext.handleException(
    Ljava/lang/Exception;Ljava/lang/String;)V(WLScriptContext.java:897)
            at com.bea.plateng.domain.script.jython.WLScriptContext.readDomain(Ljava
    /lang/String;)V(WLScriptContext.java:244)
            at jrockit.reflect.NativeMethodInvoker.invoke0(Ljava/lang/Object;ILjava/
    lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;(Unknown Source)
            at jrockit.reflect.NativeMethodInvoker.invoke(Ljava/lang/Object;[Ljava/l
    ang/Object;)Ljava/lang/Object;(Unknown Source)
            at jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava/lang/Object;[
    Ljava/lang/Object;)Ljava/lang/Object;(Unknown Source)
            at java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;
    I)Ljava/lang/Object;(Unknown Source)
            at org.python.core.PyReflectedFunction.__call__(Lorg/python/core/PyObjec
    t;[Lorg/python/core/PyObject;[Ljava/lang/String;)Lorg/python/core/PyObject;(PyRe
    flectedFunction.java:???)
            at org.python.core.PyMethod.__call__([Lorg/python/core/PyObject;[Ljava/l
    ang/String;)Lorg/python/core/PyObject;(PyMethod.java:???)
            at org.python.core.PyObject.__call__(Lorg/python/core/PyObject;)Lorg/pyt
    hon/core/PyObject;(PyObject.java:???)
            at org.python.core.PyInstance.invoke(Ljava/lang/String;Lorg/python/core/
    PyObject;)Lorg/python/core/PyObject;(PyInstance.java:???)
            at wlstOffline$py.readDomain$16(Lorg/python/core/PyFrame;)Lorg/python/co
    re/PyObject;(E:\wlst\wlstOffline.py:78)
            at wlstOffline$py.call_function(ILorg/python/core/PyFrame;)Lorg/python/c
    ore/PyObject;(E:\wlst\wlstOffline.py:???)
            at org.python.core.PyTableCode.call(Lorg/python/core/PyFrame;Lorg/python
    /core/PyObject;)Lorg/python/core/PyObject;(PyTableCode.java:???)
            at org.python.core.PyTableCode.call(Lorg/python/core/PyObject;Lorg/pytho
    n/core/PyObject;[Lorg/python/core/PyObject;Lorg/python/core/PyObject;)Lorg/pytho
    n/core/PyObject;(PyTableCode.java:???)
            at org.python.core.PyFunction.__call__(Lorg/python/core/PyObject;)Lorg/p
    ython/core/PyObject;(PyFunction.java:???)
            at org.python.core.PyObject.invoke(Ljava/lang/String;Lorg/python/core/Py
    Object;)Lorg/python/core/PyObject;(PyObject.java:???)
            at org.python.pycode._pyx0.f$0(Lorg/python/core/PyFrame;)Lorg/python/cor
    e/PyObject;(testOffline.py:3)
            at org.python.pycode._pyx0.call_function(ILorg/python/core/PyFrame;)Lorg
    /python/core/PyObject;(testOffline.py:???)
            at org.python.core.PyTableCode.call(Lorg/python/core/PyFrame;Lorg/python
    /core/PyObject;)Lorg/python/core/PyObject;(PyTableCode.java:???)
            at org.python.core.PyCode.call(Lorg/python/core/PyFrame;)Lorg/python/cor
    e/PyObject;(PyCode.java:???)
            at org.python.core.Py.runCode(Lorg/python/core/PyCode;Lorg/python/core/P
    yObject;Lorg/python/core/PyObject;)Lorg/python/core/PyObject;(Py.java:???)
            at org.python.core.__builtin__.execfile_flags(Ljava/lang/String;Lorg/pyt
    hon/core/PyObject;Lorg/python/core/PyObject;Lorg/python/core/CompilerFlags;)V(__
    builtin__.java:???)
            at org.python.util.PythonInterpreter.execfile(Ljava/lang/String;)V(Pytho
    nInterpreter.java:???)
            at org.python.util.jython.main([Ljava/lang/String;)V(jython.java:???)
    java.lang.NullPointerException: java.lang.NullPointerException
    [/pre]
    Can any one tell me what might be the problem.
    Thanks                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    The domain exists.
    And the line 78 in wlstOffline.py is as follows
    77 def readDomain(domainDir):
    78 WLS.readDomain(domainDir)
    79 updateCmo()
    80 updatePrompt()

  • "java.lang.NullPointerException" when use doFinal(byte[])

    My code here:
    KeyFactory kf = null;
    Cipher cipher = null;
    PrivateKey pk = null;
    byte[] symKey = null;
    try {
    Security.addProvider(new BouncyCastleProvider());
    catch (Exception e) {
    System.err.println("Error loading security provider (" +
    e.getMessage() + ")");
    try {
    kf = KeyFactory.getInstance("RSA");
    catch (NoSuchAlgorithmException ex1) {
    try {
    pk = kf.generatePrivate(priServer);
    catch (InvalidKeySpecException ex3) {
    try {
    cipher = Cipher.getInstance("RSA");
    catch (NoSuchAlgorithmException ex2) {
    catch (NoSuchPaddingException ex2) {
    try {
    cipher.init(Cipher.DECRYPT_MODE, pk);
    catch (InvalidKeyException ex4) {
    try {
    symKey = cipher.doFinal(CEK); //get encode of symmetric key
    when CEK is byte[].
    I got exception :
    java.lang.NullPointerException
         at java.math.BigInteger.remainder(BigInteger.java:1239)
         at org.bouncycastle.crypto.engines.RSAEngine.processBlock(RSAEngine.java:133)
         at org.bouncycastle.jce.provider.JCERSACipher.engineDoFinal(JCERSACipher.java:288)
    where my code wrong? Please help me!
    Note : I use bouncycastle provider.
    Thanks

    bla bla bla
    kf = KeyFactory.getInstance("RSA");
    pk = kf.generatePrivate(priServer);
    cipher = Cipher.getInstance("RSA");
    cipher.init(Cipher.DECRYPT_MODE, pk);IMHO RSA is 2-keys algorithm => you cannot use it in cipher class
    If u need encrypt use PBE for example
    PBEKeySpec pbeKeySpec;
    PBEParameterSpec pbeParamSpec;
    SecretKeyFactory keyFac;
    // Salt
    byte[] salt = ...;
    // Iteration count
    int count = 20;
    // Create PBE parameter set
    pbeParamSpec = new PBEParameterSpec(salt, count);
    // Prompt user for encryption password.
    pbeKeySpec = new PBEKeySpec(pass); //String with
    keyFac = SecretKeyFactory.getInstance("PBEWithMD5AndDES");
    SecretKey pbeKey = keyFac.generateSecret(pbeKeySpec);
    // Create PBE Cipher
    Cipher pbeCipher = Cipher.getInstance("PBEWithMD5AndDES");
    // Initialize PBE Cipher with key and parameters
    pbeCipher.init(Cipher.ENCRYPT_MODE, pbeKey, pbeParamSpec);
    // Our cleartext
    byte[] cleartext = "This is another example".getBytes();
    // Encrypt the cleartext
    byte[] ciphertext = pbeCipher.doFinal(cleartext);

  • Java.lang.VerifyError when using ant 1.6.2

    In short, I get the VerifyError when deploying my .ear in Weblogic 8.1 SP2. I have nailed down the issue to this:
    I compile all my code using Ant 1.6.2. If I package the code up using ant 1.6.2 I get the VerifyError. If I pacakge the code up using ant 1.4, all is well. Note that when I deploy the 1.6.2 packaged ear file on Windows, all is well also.
    During the ant package target I assembly the war and ear using the core war and ear tasks.
    We are using precompiled JSPs in the war file. It seems that WL8.1 wants to recompile the JSP file. I am not sure why - the ant 1.4 packaged ear does not want to recompile the same JSP.
    The detailed error is:
    Servlet class jsp_servlet._portal.__capitalmarketsoverview for servlet /portal/CapitalMarketsOverview.jsp could not be verified.
    java.lang.VerifyError: (class: jsp_servlet/_portal/__capitalmarketsoverview, method: _jspService signature: (Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V) Incompatible object argument for function call.>
    Any help is appreciated,
    Harry Duin

    Hello,
    I could not find an easy way to get the wls version of ant to start using the tasks you mention from ant 1.6.2.
    I tried defining the tasks using taskdef and also adding them to wls ant.jar and updating the deafult.properties file but the ant complained about unexpected elements in the build.xml file where I added the new tags (e.g import)
    If your really up against it you can try adding wls tasks to ant 1.6.2, they are listed here:
    http://e-docs.bea.com/wls/docs81/toolstable/ToolsTable.html#1009580
    Although I could not located exactly which jar they are in. Good luck.
    Cheers
    Hussein Badakhchani
    www.orbism.com

  • Java.lang.NullPointerException when using DataSource connection and executing CallableStatement

    Hi Guys
    I am having some problem as I am using a DataSource for connections and randomly
    the CallableStatements and PreparedStatements created from this DataSource becomes
    null and everytime I get NullPointerException with this message.
    java.sql.SQLException: java.lang.NullPointerException
         at weblogic.jdbc.rmi.SerialPreparedStatement.setString(SerialPreparedStatement.java:210)
         at .........
    Help will be appreciated..

    Hi Guys
    I am having some problem as I am using a DataSource for connections and randomly
    the CallableStatements and PreparedStatements created from this DataSource becomes
    null and everytime I get NullPointerException with this message.
    java.sql.SQLException: java.lang.NullPointerException
         at weblogic.jdbc.rmi.SerialPreparedStatement.setString(SerialPreparedStatement.java:210)
         at .........
    Help will be appreciated..

  • Java.lang.ArrayIndexOutOfBoundsException when using SOAP over SSL

    Looks like a strange thing. I am using MS SOAP Toolkit 2.0 sp2 to make SOAP calls
    to Weblogic (Win2000, 6.1) over SSL. On Weblogic I have an RPC service (EJB).
    I'm getting
    <Mar 26, 2002 9:14:56 PM EST> <Error> <HTTP> <Connection failure
    java.lang.ArrayIndexOutOfBoundsException
    at weblogic.security.SSL.GenericCipher.input(GenericCipher.java:216)
    at weblogic.security.SSL.SSLCiphertext.input(SSLCiphertext.java:65)
    at weblogic.security.SSL.SSLSocket.getRecord(SSLSocket.java:1030)
    at weblogic.security.SSL.RecordInputStream.getData(RecordInputStream.java:109)
    at weblogic.security.SSL.RecordInputStream.read(RecordInputStream.java:51)
    at weblogic.socket.SSLFilter.isMessageComplete(SSLFilter.java:182)
    at weblogic.socket.NTSocketMuxer.processSockets(NTSocketMuxer.java:605)
    at weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:24)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    But what's interesting, it's actually working. I am getting data as expected.
    Any idea what it could be?
    Thanks,
    Serge

    Looks like a strange thing. I am using MS SOAP Toolkit 2.0 sp2 to make SOAP calls
    to Weblogic (Win2000, 6.1) over SSL. On Weblogic I have an RPC service (EJB).
    I'm getting
    <Mar 26, 2002 9:14:56 PM EST> <Error> <HTTP> <Connection failure
    java.lang.ArrayIndexOutOfBoundsException
    at weblogic.security.SSL.GenericCipher.input(GenericCipher.java:216)
    at weblogic.security.SSL.SSLCiphertext.input(SSLCiphertext.java:65)
    at weblogic.security.SSL.SSLSocket.getRecord(SSLSocket.java:1030)
    at weblogic.security.SSL.RecordInputStream.getData(RecordInputStream.java:109)
    at weblogic.security.SSL.RecordInputStream.read(RecordInputStream.java:51)
    at weblogic.socket.SSLFilter.isMessageComplete(SSLFilter.java:182)
    at weblogic.socket.NTSocketMuxer.processSockets(NTSocketMuxer.java:605)
    at weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:24)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    But what's interesting, it's actually working. I am getting data as expected.
    Any idea what it could be?
    Thanks,
    Serge

  • Java.lang.NullpointerException when use source table as a mapping component

    Hi all,
    I am new to owb and I got NullPointerException when I try to drag a table to my mapping.
    The table is imported and it's from a windows oracle database. The mapping is located on my linux oracle database.
    By the way, I can even deploy the table.
    What have I done wrong and why this happen?
    thanks in advance.
    帖子经 953800编辑过

    Hi Timo,
    Thanks for the reply,
    If I understand correctly I need to apply to the weblogic server 10.3.5 + Sherman patch UPDATE1 patch #12979653 and patch #12917525. After this the ADF Runtime 11.1.1.5 installed in the Production environments will allow me to run my application that is running in ADF Runtime 11.1.2.1. right?
    I'm working on getting this patches installed. Thank you very much for your help.
    I run the test on my local server as a test class and as a web service, it worked perfect, nevertheless in the Production environment I got a interesting answer:
    Production 1 and 2:
    Request:
    <?xml version="1.0" encoding="UTF-8"?>
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://model/">
    <env:Header/>
    <env:Body>
    <ns1:getVersion/>
    </env:Body>
    </env:Envelope>
    Response
    <?xml version='1.0' encoding='UTF-8'?>
    <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
    <S:Body>
    <S:Fault xmlns:ns4="http://www.w3.org/2003/05/soap-envelope">
    <faultcode>S:Server</faultcode>
    <faultstring>oracle/jbo/Version</faultstring>
    </S:Fault>
    </S:Body>
    </S:Envelope>
    Request:
    <?xml version="1.0" encoding="UTF-8"?>
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://model/">
    <env:Header/>
    <env:Body>
    <ns1:getBuildLabel/>
    </env:Body>
    </env:Envelope>
    Response:
    <?xml version='1.0' encoding='UTF-8'?>
    <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
    <S:Body>
    <ns2:getBuildLabelResponse xmlns:ns2="http://model/">
    <return>oracle.jbo.Version</return>
    </ns2:getBuildLabelResponse>
    </S:Body>
    </S:Envelope>
    Edited by: 917852 on Jul 12, 2012 11:31 AM

  • Java.lang.InstantiationException: Error communicating with server:

    Hello everybody, I am an easy Helloworld application, the deploy is fine, but when I execute the client it appears the next error:
    java.lang.InstantiationException: Error communicating with server: Lookup error:
    java.net.ConnectException: Connection refused: connect; nested exception is:
    java.net.ConnectException: Connection refused: connect; nested exception
    is:
    javax.naming.NamingException: Lookup error: java.net.ConnectException: C
    onnection refused: connect; nested exception is:
    java.net.ConnectException: Connection refused: connect
    at com.evermind.server.ApplicationClientContext.createContext(Applicatio
    nClientContext.java:300)
    at com.evermind.server.ApplicationClientInitialContextFactory.getInitial
    Context(ApplicationClientInitialContextFactory.java:190)
    at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
    at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
    at javax.naming.InitialContext.init(Unknown Source)
    at javax.naming.InitialContext.<init>(Unknown Source)
    at hello.HelloClient.main(HelloClient.java:33)
    NamingException: Error reading application-client descriptor: Error communicatin
    g with server: Lookup error: java.net.ConnectException: Connection refused: conn
    ect; nested exception is:
    java.net.ConnectException: Connection refused: connect; nested exception
    is:
    javax.naming.NamingException: Lookup error: java.net.ConnectException: C
    onnection refused: connect; nested exception is:
    java.net.ConnectException: Connection refused: connect
    This is my application client:
    // HelloClient.java
    package hello;
    import javax.ejb.*;
    import javax.naming.*;
    import javax.rmi.PortableRemoteObject;
    import java.io.*;
    import java.util.*;
    import java.rmi.RemoteException;
    * A simple client for accessing an EJB.
    public class HelloClient
    public static void main(String[] args)
    System.out.println("client started...");
    try {
    // Initial context properties are set in the jndi.properties file
         Hashtable env = new Hashtable();
         env.put(Context.INITIAL_CONTEXT_FACTORY,"com.evermind.server.ApplicationClientInitialContextFactory");
         env.put(Context.PROVIDER_URL, "ormi://ecd11107.eadscasa.casa.corp:23791/helloworld");
         env.put(Context.SECURITY_PRINCIPAL, "admin");
         env.put(Context.SECURITY_CREDENTIALS, "123");
         Context context = new InitialContext(env);
    // This for use with com.evermind.server.rmi.RMIInitialContextFactory
    //Object homeObject = context.lookup("HelloBean");
    // This is for use with com.evermind.server.ApplicationClientInitialContextFactory
    Object homeObject = context.lookup("java:comp/env/Helloworld");
    // Narrow the reference to HelloHome.
    HelloHome home =
         (HelloHome) PortableRemoteObject.narrow(homeObject, HelloHome.class);
         System.out.println("hello home");
    // Create remote object and narrow the reference to Hello.
    Hello remote =
         (Hello) PortableRemoteObject.narrow(home.create(), Hello.class);
    System.out.println(remote.sayHello("James Earl"));
    } catch(NamingException e) {
    System.err.println("NamingException: " + e.getMessage());
    } catch(RemoteException e) {
    System.err.println("RemoteException: " + e.getMessage());
    } catch(CreateException e) {
    System.err.println("FinderException: " + e.getMessage());
    Can somebody helps me ???

    Thank you, but don�t work well yet. I checked the files orion-application.xml & principals.xml in the directory C:\servOracle\oracle\j2ee\home\application-deployments\helloworld but the result is the same, when I run the client the next error appears:
    NamingException: Lookup error: javax.naming.NoPermissionException: Not allowed to look up HelloBean, check the namespace-access tag setting in orion-application.xml for details; nested exception is:
    javax.naming.NoPermissionException: Not allowed to look up HelloBean, check the namespace-access tag setting in orion-application.xml for details
    This is my orion-application.xml
    <?xml version="1.0"?>
    <!DOCTYPE orion-application PUBLIC "-//ORACLE//DTD OC4J Application runtime 9.04//EN" "http://xmlns.oracle.com/ias/dtds/orion-application-9_04.dtd">
    <orion-application deployment-version="9.0.4.0.0" default-data-source="jdbc/OracleDS" treat-zero-as-null="true">
         <ejb-module remote="false" path="helloworld-ejb.jar" />
         <web-module id="helloworld-web" path="helloworld-web.war" />
         <client-module path="helloworld-client" deployment-time="fce4439997" auto-start="false" />
         <persistence path="persistence" />
         <principals path="principals.xml" />
         <jazn provider="XML" location="jazn-data.xml" />
         <log>
              <file path="application.log" />
         </log>
         <namespace-access>
              <read-access>
                   <namespace-resource root="">
                        <security-role-mapping name="<jndi-user-role>">
                             <group name="users" />
                        </security-role-mapping>
                   </namespace-resource>
              </read-access>
              <write-access>
                   <namespace-resource root="">
                        <security-role-mapping name="<jndi-user-role>">
                             <group name="users" />
                        </security-role-mapping>
                   </namespace-resource>
              </write-access>
         </namespace-access>
    </orion-application>
    And this is my principals.xml
    <?xml version="1.0"?>
    <!DOCTYPE principals PUBLIC "//ORACLE//DTD OC4J Principals 9.04//EN" "http://xmlns.oracle.com/ias/dtds/principals-9_04.dtd">
    <principals>
         <groups>
              <group name="users">
                   <description>users</description>
                   <permission name="rmi:login" />
              </group>
              <group name="guests">
                   <description>guests</description>
              </group>
              <group name="administrators">
                   <description>administrators</description>
                   <permission name="administration" />
              </group>
         </groups>
         <user username="admin" password="ADMIN">
              <description>The default administrator</description>
              <group-membership group="administrators" />
              <group-membership group="guests" />
              <group-membership group="users" />
         </user>
         <user username="SCOTT" password="TIGER">
              <description>no description</description>
              <group-membership group="users" />
              <group-membership group="administrators" />
         </user>
    </principals>
    Thanks in advance, please help me....

  • Java Bean scope when used with the JPDK

    Portal 3.0.9.8.4 and Jserv
    When using JSPs with Java Beans and the JPDK I have noticed problems when setting the scope attribute of the useBean action to something other than "page". For example, &lt;jsp:useBean id="provider" scope="session" class="MyClass" /&gt; causes a java.lang.ClassCastException when there are more than two JSP portlets than attempt to access the ProviderSession object.
    Does anyone know what value the JSP scope should be set to when you want the JSPs read/write to the ProviderSession?

    The behavior you report is an expected one as your keys of objects on session are not unique to the two portlet instances. Two portlets with the same session object (may have been deployed on the same Portal page), are sharing the same object put on session, thus resulting in thread conflicts. What you need to do is to generate unique keys for objects stored for each portlet instance.
    For example, instead of having the id as "provider", you should have it as <portlet instance name> + "provider".
    You are not experiencing the same behavior in "request" or "page" scope, as in these scopes, the objects are not shared across portlet instances.
    Please let me know if my interpretation of your issue is wrong.
    Regards,
    Abhinav

  • Java.lang.InstantiationException

    My class throws a java.lang.InstantiationException and I can't see why. my class extends an abstract class but should not be abstract itself.
    My Class_
    package com.propylon.core.tests;
    import org.eclipse.core.runtime.Plugin;
    import org.osgi.framework.BundleContext;
    * The activator class controls the plug-in life cycle
    public class Activator extends Plugin {
         // The plug-in ID
         public static final String PLUGIN_ID = "com.propylon.core.tests";
         // The shared instance
         private static Activator plugin;
         * The constructor
         public Activator() {
         * (non-Javadoc)
         * @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
         public void start(BundleContext context) throws Exception {
              super.start(context);
              plugin = this;
         * (non-Javadoc)
         * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
         public void stop(BundleContext context) throws Exception {
              plugin = null;
              super.stop(context);
         * Returns the shared instance
         * @return the shared instance
         public static Activator getDefault() {
              return plugin;
    Console Window_
    java-test:
    [echo] Running com.propylon.core.tests.testcase.AllTests. Result file: C:/eclipse3.3/results/com.propylon.core.tests.testcase.AllTests.xml.
    [java] org.osgi.framework.BundleException: The activator org.eclipse.core.runtime.Plugin for bundle com.propylon.core.Test is invalid
    [java]      at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadBundleActivator(AbstractBundle.java:141)
    [java]      at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:970)
    [java]      at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:346)
    [java]      at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:260)
    [java]      at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:400)
    [java]      at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:111)
    [java]      at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:417)
    [java]      at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:189)
    [java]      at org.eclipse.osgi.framework.internal.core.BundleLoader.findLocalClass(BundleLoader.java:340)
    [java]      at org.eclipse.osgi.framework.internal.core.BundleLoader.findClassInternal(BundleLoader.java:408)
    [java]      at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:369)
    [java]      at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:357)
    [java]      at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:83)
    [java]      at java.lang.ClassLoader.loadClass(Unknown Source)
    [java]      at org.eclipse.osgi.framework.internal.core.BundleLoader.loadClass(BundleLoader.java:289)
    [java]      at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:227)
    [java]      at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1269)
    [java]      at org.eclipse.test.EclipseTestRunner.loadSuiteClass(EclipseTestRunner.java:302)
    [java]      at org.eclipse.test.EclipseTestRunner.getTest(EclipseTestRunner.java:233)
    [java]      at org.eclipse.test.EclipseTestRunner.<init>(EclipseTestRunner.java:216)
    [java]      at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:200)
    [java]      at org.eclipse.test.CoreTestApplication.runTests(CoreTestApplication.java:35)
    [java]      at org.eclipse.test.CoreTestApplication.run(CoreTestApplication.java:31)
    [java]      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [java]      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    [java]      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    [java]      at java.lang.reflect.Method.invoke(Unknown Source)
    [java]      at org.eclipse.equinox.internal.app.EclipseAppContainer.callMethod(EclipseAppContainer.java:533)
    [java]      at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:155)
    [java]      at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106)
    [java]      at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76)
    [java]      at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363)
    [java]      at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176)
    [java]      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [java]      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    [java]      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    [java]      at java.lang.reflect.Method.invoke(Unknown Source)
    [java]      at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:504)
    [java]      at org.eclipse.equinox.launcher.Main.basicRun(Main.java:443)
    [java]      at org.eclipse.equinox.launcher.Main.run(Main.java:1169)
    [java]      at org.eclipse.equinox.launcher.Main.main(Main.java:1144)
    [java]      at org.eclipse.core.launcher.Main.main(Main.java:30)
    [java] Caused by: java.lang.InstantiationException
    [java]      at sun.reflect.InstantiationExceptionConstructorAccessorImpl.newInstance(Unknown Source)
    [java]      at java.lang.reflect.Constructor.newInstance(Unknown Source)
    [java]      at java.lang.Class.newInstance0(Unknown Source)
    [java]      at java.lang.Class.newInstance(Unknown Source)
    [java]      at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadBundleActivator(AbstractBundle.java:136)
    [java]      ... 41 more
    [java] Java Result: 2
    Is there anything obviously flawed with this class or am I going mad.
    thank you for your time
    slider

    I can't see anywhere in your code that tries to create an Activator object... i.e. there is nowhere that tries to use the new Activator() constructor, so I would suggest that the problem is not with your code.
    This is the description of Instantiation Exception from the API:
    Thrown when an application tries to create an instance of a class using the newInstance method in class Class, but the specified class object cannot be instantiated because it is an interface or is an abstract class.
    So, I would imagine, somewhere the Class.newInstance() method is being invoked on Plugin (the abstract class) rather than Activator (the non-abstract one)

  • Java.lang.InstantiationException / XMLEncoder error what's that?

    Hello there!
    After I received so much help from Joachim yesterday, I think I have to bother you again with a problem:
    I wrote this application for testing purposes. This app only counts an interger up and down from 0 to 10 and displays the value in a JTextBox as Strings like int = 3 means: "three". These Strings are all in an array. Additionally, I have implemented a localisation (german and english language). I read these properties from a .properties File and change the label of the buttons and the language of the value-strings. Also I serialize my app using the Beans-persistence.
    So far so good but I get an error in the following situation:
    When I change the language using a JMenuBar-entry and then close the app-window (now the app status is written to a xml-file (persistence)) I get:
    java.lang.InstantiationException: javax.swing.PopupFactory$HeavyWeightPopup$1
    Continuing ...
    java.lang.Exception: XMLEncoder: discarding statement XMLTest.addWindowListener(PopupFactory$HeavyWeightPopup$1);
    Continuing ...The status is saved to the file and the reconstruction from the file works fine. But this error annoys me and I have to get rid of it. More information: when I run the app and foolin' around with the buttons BUT DON'T CHANGE the language, the error doesn't appear.
    The app is working fine, but what does this error mean? I'm pretty new to Java and google doesn't help me...
    Here is my code: http://pastebin.com/m6b58751c
    Thanks for having a look...
    Thomas
    Edited by: king-al on Feb 10, 2009 11:57 AM

    ejp wrote:
    The error occurred because the XMLEncoder couldn't instantiate another XMLTest object. That would be because it didn't have a no-args constructor, which it must have to qualify as a Java Bean, which it must do to be XMLEncodable (or else have a PersistenceDelegate that can instantiate it). When you changed it to have-a JFrame instead of be-a JFrame you probably changed the constructor too.Okay BUT: I have a PersistenceDelegate because I have a args-constructor:
    public class XMLTestPersistenceDelegate extends DefaultPersistenceDelegate{
            @Override
        protected Expression instantiate(Object oldInstance,Encoder out){ // fure den übergabewert am kontruktor
            XMLTest t=(XMLTest)oldInstance;
            return new Expression(oldInstance,XMLTest.class,"new",new Object[]{t.width});
            @Override
        protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out){
            super.initialize(type, oldInstance, newInstance, out);
            XMLTest t=(XMLTest)oldInstance;
            out.writeStatement(new Statement(
                    oldInstance,"endisFunction", new Object[]{}));
            for(int i=0;i<t.value;i++) // so oft plusFunction aufrufen, wie value groß ist
                out.writeStatement(new Statement(
                    oldInstance,"plusFunction",new Object[]{}));
            if(!t.enabled)
               out.writeStatement(new Statement(
                    oldInstance,"endisFunction", new Object[]{}));
    }The width value is the int-value of the width of my JTextField. The Statements are for some other properties of my object.
    Right now, I still don't understand why it doesn't work when my Class XMLTest ist extended from JFrame.
    And when I changed it to have-a JFrame I only changed some properties in my constructor of the JFrame i.e.: this.setVisible(true) to f.setVisible(true)... but nothing more.
    Edited by: king-al on Feb 11, 2009 3:44 AM

  • Java.lang.NullPointerException when doing SQL on ms access

    I am trying to perform Insert and delete commands on an access database and I continue to get a java.lang.NullPointerException when performing the action. Everything is fine when i do a Select * FROM..., I am able to read all of the information I ask for, but when performing the Insert/Delete commands I get the error. Any help would be appreciated, I will copy and past a portion of my code below. All of the fields and variable types match with what is in the database.
    public void executeAddSecretary() throws SQLException{
    String a,b;
    a= txtSecLname.getText();
    b= txtSecFname.getText();
    statement.execute("INSERT INTO Contact_Sec (Sec_Lname,Sec_Fname) Values ('" + a + "', '" + b + "')");
    System.out.println("updated Secretary");
    public void executeDeleteContact() throws SQLException{
    String a = "a";
    statement.execute("DELETE FROM Contact WHERE Lname = ('" + a + "')");
    System.out.println("deleted contact");
    Thanks to anyone who can help me out.

    1) Use prepared statement instead of statement.
    2) Do like this ...
    PreparedStatement prepStmt = null;
    try
         String query="INSERT INTO Contact_Sec (Sec_Lname,Sec_Fname) Values (?,?)");
         prepStmt = connection.prepareStatement(query);
         prepStmt.setString(1, value1);
         prepStmt.setString(2, value2);
         prepStmt.executeUpdate();
    catch (SQLException e)
         throw e;
    catch (Exception e)
         throw e;
    finally
         try
              if (prepStmt != null)
                   prepStmt.close();
         } catch (Exception e) {}
         try
              if (connection != null)
                   connection.close();
         } catch (Exception e) {}
    }3) If you still get the null exception then put step wise System.out's
    and debug it.
    -Rohit

  • Exception: java.lang.InstantiationException.....

    Hi there,
    I have recently been playing around with converting an application to an applet. Everything seems great at my end, I have tried ir in 'Internet Explorer 6' & 'Netscape 6.2', they both show the applet, however 'Opera 5' does not. The annoying problem is that nobody else can see the applet in thier browser's. Because I can't experience what they are seeing it is proving really dificult to troubleshoot this error. The only indication I have to the route of this problem is the message:
    Exception: java.lang.InstantiationException.....
    I have even remove this class file from my own P.C. just to make sure that some how I am not viewing the local class on my computer instead of what I have uploaded. It had no effect on my results as I suspected. Could it be I need to use a H.T.M.L. convertor?
    I am a bit stumped. Does anyone know what trhis error message generally means.
    If you want the code I can e-mail, but in the mean time if anyone is familiar with this problem, HELP!!!

    the previous post pretty much explained what the Exception means exactly. To be more specific however, your compiler would not let you instantiate an interface or abstract class so either a) you are doing this incorrectly via reflection or b) there is some class conflict with client system. Is your applet enclosed in an applet tag that directs the browser to use the sun plugin? I would recomend that you have clients use the sun plugin- it will probably solve this problem (assumming it is not bad code) and you should run into less conflicts between different browser types.

  • Unreported Exception java.lang.InstantiationException

    Dear Friends,
    I am developing javabean connectivty for inserting records to mysql database from jsp. when i try to compile java bean program. It gives an error like unreported Exception java.lang.InstantiationException: Must be caught or declared to be thrown*. This is my mode. Please anyone help to solve this error. if you find any error in my code, please suggest me. Thanks in advance.
    package com.webdeveloper.servlets;
    import java.sql.*;
    import java.io.*;
    public class InsertBean {
    private String dbURL = "jdbc:mysql://localhost:3306/test";
    private Connection dbCon;
    private Statement st;
    String dbuser = "root";
    String dbpass = "admin";
    String Name = null;
    String Address = null;
    String Zip = null;
    public InsertBean() {
    super();
    public String getName() {
    return this.Name;
    public String getAddress() {
    return this.Address;
    public String getZip() {
    return this.Zip;
    public void setName(String pname) {
    this.Name = pname;
    public void setAddress(String paddress) {
    this.Address = paddress;
    public void setZip(String pzip) {
    this.Zip = pzip;
    public void doInsert() throws ClassNotFoundException, SQLException {
    Class.forName("com.mysql.jdbc.Driver").newInstance();//it gives error in this line
    dbCon = DriverManager.getConnection(dbURL,dbuser,dbpass);
    Statement s = dbCon.createStatement();
    String sql = "Insert into Person values ('" + this.Name;
    sql = sql + "', '" + this.Address + "', " + this.Zip;
    sql = sql + ")";
    int insertResult = s.executeUpdate(sql);
    dbCon.close();
    }

    Dear BalusC,
    Thanks for your suggestion. I used try catch block also. But it still gives same error. I have modified my following code. Is there any thing wrong in my code? Please give me your suggestion. Thankyou.
    // Java Document
    package com.webdeveloper.servlets;
    import java.sql.*;
    import java.io.*;
    public class InsertBean {
    private String dbURL = "jdbc:mysql://localhost:3306/test";
    private Connection dbCon;
    private Statement st;
    String dbuser = "root";
    String dbpass = "admin";
    String Name = null;
    String Address = null;
    String Zip = null;
    public InsertBean() {
    super();
    public String getName() {
    return this.Name;
    public String getAddress() {
    return this.Address;
    public String getZip() {
    return this.Zip;
    public void setName(String pname) {
    this.Name = pname;
    public void setAddress(String paddress) {
    this.Address = paddress;
    public void setZip(String pzip) {
    this.Zip = pzip;
    public void doInsert() throws ClassNotFoundException, SQLException {
         try{
         Class.forName("com.mysql.jdbc.Driver").newInstance();
    dbCon = DriverManager.getConnection(dbURL,dbuser,dbpass);
    Statement s = dbCon.createStatement();
    String sql = "Insert into Person values ('" + this.Name;
    sql = sql + "', '" + this.Address + "', " + this.Zip;
    sql = sql + ")";
    int insertResult = s.executeUpdate(sql);
         catch(Exception e){
         System.out.println("error occured :" + e);
         dbCon.close();
    }

Maybe you are looking for

  • Executable doesn't show up in programs list

    After the installation of my executable it doesn't appear in Windows All Programs list. I built a lot of executable and installers before but it is the first time I see this. The folder is created in the Program Files (x86) directory and the program

  • FCP 7 not working with Mountain Lion!!

    FCP 7 is not working!! Once I install FCP in Mountain Lion (10.8) My FCP 7 won't let me open or create new projects shot with a Sony Z5 using Sony HVR-MRC1 to ingest media. Prior to this I never had any problems with Snow Leopard. When I try to inges

  • ITunes Playlists - exporting list of songs from playlist to pdf

    I need to be able to print a playlist as a pdf - is there some external software that i should use? seems crazy to not have that option.

  • How can i access iPads 2 Mediathek in ATV2

    I can not see iPads Mediathek in Apple TV2 with the Home Sharing option, only Mac or Windows Computers running iTunes are shareable in ATV2. Is it not possible to HomeShare iPad2?

  • How to save inputText under a af:forEach/af:Iterator  loop?

    e.g. 11g, the following code: <af:forEach value="#{salaryList}" var="salary"> <af:inputText value="#{salary}" > </af:forEach> <af:commandButton text="Save Changes" action="#{backingBean.doSave}"/> How to read the user input in the inputText from scre