Passing Wrapper Classes as arguments

I have a main class with an Integer object within it as an instance variable. I create a new task that has the Integer object reference passed to it as an argument, the task then increases this objects value by 1. However the objects value never increases apart from within the constructor for the task class, it's as if it's treating the object as a local variable. Why?
mport java.util.concurrent.*;
public class Thousand {
     Integer sum = 0;
     public Thousand() {
          ExecutorService executor = Executors.newCachedThreadPool();
          for(int i = 0; i < 1; i++) {
               executor.execute(new ThousandThread(sum));
          executor.shutdown();
          while(!executor.isTerminated()) {
          System.out.println(sum);
     public static void main(String[] args) {
          new Thousand();
     class ThousandThread implements Runnable {
          public  ThousandThread(Integer sum) {
                    sum = 5;
                    System.out.println(sum);
          public void run() {
               System.out.println("in Thread : ");
}

AlyoshaKaz wrote:
here's the exact queston
(Synchronizing threads) Write a program that launches one thousand threads. Each thread adds 1 to a variable sum that initially is zero. You need to pass sum by reference to each thread.There is no pass by reference in Java
In order to pass it by reference, define an Integer wrapper object to hold sum. This is not passing by reference. It is passing a reference by value.
If the instructor means that you are to define a variable of type java.lang.Integer, this will not help, as Integer is immutable.
If, on the other hand, you are meant to define your own Integer class (and it's not a good thing to use a class name that already exists in the core API), then you can do so, and make it mutable. In this case, passing a reference to this Integer class will allow your method to change the contents of an object and have the caller see that change. This ability to change an object's state and have it seen by the caller is why people mistakenly think that Java passes objects by reference. It absolutely does not.
Bottom line: Your instructor is sloppy with terminology at best, and has serious misunderstanding about Java and about CS at worst. At the very least, I'd suggest getting clarification on whether he means for you to use java.lang.Integer, which might make the assignment impossible as worded, or if you are supposed to create your own Integer wrapper class.
Edited by: jverd on Oct 27, 2009 3:38 PM

Similar Messages

  • Passing primitive Wrapper class by reference

    Hello,
    Can we pass int value by reference?
    At least by passing it's wrapper class.
    class Test
         public static void main(String args[])
              Integer myInt = 0;
              Test.testInteger(myInt, 5);
              System.out.println("MyInt: " + myInt);
         static void testInteger(Integer val, int value)
              Integer newVal = value;
              val = newVal;
    }The code above surprisingly instead of outputting '5', it outputs '0'.
    Isn't it passing object is always by reference?
    Why it's not the case for primitive Wrapper class?
    Is there any way to do this (pass by reference)?
    Regards,
    Heru

    No! References to objects are passed by copy soif
    you chage the copy you do not change theoriginal.
    All values in Java are passed by copy. But when it's an object of a class, it works "by
    reference".Java references are like pointer in C++ and not
    references in C++. They are just called references
    even though they are pointers.Yeah, but Integer is "just the same" with other class created by me (subclass of Object), why is the behavior different?

  • Passing Inner class name as parameter

    Hi,
    How i can pass inner class name as parameter which is used to create object of inner class in the receiving method (class.formane(className))
    Hope somebody can help me.
    Thanks in advance.
    Prem

    No, because an inner class can never have a constructor that doesn't take any arguments.
    Without going through reflection, you always need an instance of the outer class to instantiate the inner class. Internally this instance is passed as a parameter to the inner class's constructor. So to create an instance of an inner class through reflection you need to get the appropriate constructor and call its newInstance method. Here's a complete example:import java.lang.reflect.Constructor;
    class Outer {
        class Inner {
        public static void main(String[] args) throws Exception{
            Class c = Class.forName("Outer$Inner");
            Constructor cnstrctr = c.getDeclaredConstructor(new Class[] {Outer.class});
            Outer o = new Outer();
            Inner i = (Inner) cnstrctr.newInstance(new Object[]{o});
            System.out.println(i);
    }

  • Pass dynamic Command line arguments

    Hi,
    I tried to pass dynamic command line argument to Web start using the method :
    "javaws URL -D foo -D bar"
    as explained in the "Unofficial JWS/JNLP FAQ" that " You can pass your own system properties to your app using -D switch ....", but I got the following error at the start;
    error occurred while launching/running the application.
    Category: Invalid Argument error
    Too many arguments supplied: {http://...URL/my.jnlp, -Did=123 }
    p.s. I already added the"<property name='' value=''/> in the <resourse>, and modified the main class to get the parameter using System. getProperty();
    Did anyone try to this method before? What's wrong of this?
    Thanks in advance for your help.

    Thanks.
    here below is the jnlp file:
    <jnlp spec="1.0+" href="$$name" codebase="$$codebase">
    <information>
    <title>GUI Application</title>
    <vendor>PS</vendor>
    <description>PS GUI WebStart Version</description>
    <icon href="logo.jpg" />
    <offline-allowed />
    </information>
    <resources>
    <j2se version="1.3" />
    <jar href="lib/gui.jar" />
    <property name="id" value="zbc" />
    <jar href="lib/classes12.zip" />
    <jar href="lib/j2ee.jar" />
    <jar href="lib/jaas.jar" />
    <jar href="lib/jce1_2_1.jar" />
    <jar href="lib/jdom.jar" />
    <jar href="lib/xerces.jar" />
    <jar href="lib/local_policy.jar" />
    <jar href="lib/log4j.jar" />
    <jar href="lib/orion.jar" />
    <jar href="lib/sunjce_provider.jar" />
    <jar href="lib/US_export_policy.jar" />
    </resources>
    <security>
    <all-permissions />
    </security>
    <application-desc main-class="GUIFrame">
    </application-desc>
    and in the main class "GUIFrame", i use System.getProperty("id") t get the parameter, if I hardcode the value of the "id" in this jnlp file and use javaws URL, everything's fine, but not the "javaws URL -Did=value" which will return the error as mentioned.
    Thanks again for your help.

  • How to write a wrapper class

    I am new to the concept of wrapper classes. I have a small spell checker program that I need to access via a servlet by passing a string in and getting a string out with spelling suggestions. I could really use some advice on how to write a servlet that would do such a thing. TIA

    grin1dan wrote:
    I am new to the concept of wrapper classes. I have a small spell checker program that I need to access via a servlet by passing a string in and getting a string out with spelling suggestions. I could really use some advice on how to write a servlet that would do such a thing. TIABasically, a wrapper class is a class that "wraps" another - otherwise referred to as a "HAS-A" relationship (as opposed to a sub-class, which involves an "IS-A" relationship). It does this by including an instance of the wrapped class as one of its fields.
    In many cases, wrapping is actually superior to inheritance.
    I don't know how this fits with your servlet, but - assuming that your SpellChecker is implemented as a class - all you need to do is have your servlet define a "spellchecker" field; perhaps something like:
    private final SpellChecker spellCheck = new SpellChecker();Probably worth reading up on though. Google "wrapper classes" and "forwarders".
    Winston

  • Could not load mediaLib accelerator wrapper classes. Continuing in pure Jav

    Can anyone provide an explanation/solution to the following error message:
    "Could not load mediaLib accelerator wrapper classes. Continuing in pure Java mode."

    This problem seems to occur if only the JAI JAR files are installed without the native DLL's. Is there some property that can be passed in to JAI so that it doesn't look for the DLL's? The lookup is causing quite a delay in initial server response time. We don't want to include the DLL's since they are a big pain for our customers to install and the performance issue is not a concern.
    Thanks for any help!
    -Matt

  • How to invoke adobe life cycle webservice using c++ (how to pass blob structure as argument)

    We already wrote sample code (.NET C#) to access livecycle webservice(this convert the input file into pdf file) using below link from adobe
    http://livedocs.adobe.com/livecycle/8.2/programLC/programmer/help/wwhelp/wwhimpl/common/ht ml/wwhelp.htm?context=sdkHelp&file=000088.html
    We want to write c++ client to invoke adobe life cycle webservice. I have sample code to invoke the given webservice using plain c++ but I am stuck up with 'how to pass BLOB structure as argument to CreatePDF() method' and
    plus 'how to get ouput as mapItem[]' . Is the code to convert to pdf works fine with .NET and java only? Not with c++ or VB?

    In this case the LiveCycle services are exposed as web services that can be consumed by any application language that can interact with web services. While the sample published are for c# and Java there is no reason that other web service aware languages (C++, Perl, etc) wouldn't work.
    I'm not a Microsoft C++ expert, but as far as I understand all you need to do is create a web reference and then have your C++ classes interact via the generated proxy classes. The syntax will be different, but the concept is the same

  • What exactly is a wrapper class?

    In so far as Integer, Byte, Double et al. are concerned I understand that those wrapper classes are a way to handle primitive types as objects. But I've come across references to wrapper classes in documentation and other technical articles and I don't think I really understand what they are really used for. Why do you need a wrapper class for an object?
    Could someone shed me some light on this issue?
    Thanks,
    John

    An instance of a wrapper class holds a pointer to and instance of some other class or interface and provides access to it, typically supplying methods equivalent to all the methods of the underlying type.
    The basic wrapper class a functional replacement for the underlying object.
    When you're passed an object from some code outside your control you often don't know what exact class it is, or have access to it's class definition.
    A wrapper object allows you to modify the functionality of such an object. You can extend the wrapper class, for example, adding extra methods. Or you can modify the methods, for example to provide logging of calls made.
    As a concrete example, I have a wrapper class LoggedConnection which wraps a java.sql.Connection object. It also implements java.sql.Connection. If you ask a LoggedConnection for a Statement or PreparedStatement it fetches the appropriate object and returns a wrapped version which logs the SQL and the execution times etc..
    My "get me a connection" routine can return either a raw Connection or a LoggedConnection according to whether a SQL log file is provided.
    The main program doesn't need to know if it's using a genuine Connection object or the wrapped version.
    Part of the definition would look like:
    public class LoggedConnection implements Connection {
      private Connection wrappee;
      public LoggedConnection(Connection con) {
        wrapee = con;
      public createStatement() throws SQLExeception {
        return new LoggedStatement(wrappee.createStatement())
    }(Of course this was tedious to write by hand because Connection has so many methods, all of which the wrapper must implement. Later I wrote a java program to generate Wrapper classes).

  • What is meant by a wrapper class ?

    What is meant by a wrapper class ?

    java uses simple types such as int and char. these data type r not part of object hierarchy. they r passed by value to methods and cannot b directly passed by reference. there is no way for 2 methods to refer to the same instance of an int. at times u will need an object representation for one of these simple types.wrapper classes encapsulate or wrap the simple types within a class. thus, they r commonly referred to as type wrapper.
    java provides classes that correspond to each of the simple types

  • What is the proper way to code a "wrapper" class?

    Basically I want to replace an existing Action with a custom Action, but I want the custom Action to be able to invoke the existing Action.
    The following code works fine. I can create a custom Action using the existing action and the text on the button "paste-from-clipboard" is taken from the existing Action. So everything works great as long as the existing Action extends from AbstractAction.
    However the Action interface does not support the getKeys() method which I used to copy the key/value information from the existing action to the wrapped action. So if you try to create a button from some class that strictly implements the Action interface the key/value data in the wrapped Action will be empy and no text will appear on the button.
    So as the solution I thought I would need to override all the methods in the wrapped Action class to invoke the methods from the originalAction object. That is why all the commented code in the class is there. But then the protected methods cause a problem as the class won't compile.
    Do I just not worry about overriding those two methods? Is this a general rule when creating wrapper classes, you ignore the protected methods?
    import java.awt.*;
    import java.awt.event.*;
    import java.beans.*;
    import javax.swing.*;
    import javax.swing.text.*;
    public class WrappedAction extends AbstractAction
         private Action originalAction;
         public WrappedAction(JComponent component, KeyStroke keyStroke)
              Object key = getKeyForActionMap(component, keyStroke);
              if (key == null)
                   String message = "no input mapping for KeyStroke: " + keyStroke;
                   throw new IllegalArgumentException(message);
              originalAction = component.getActionMap().get(key);
              if (originalAction == null)
                   String message = "no Action for action key: " + key;
                   throw new IllegalArgumentException(message);
              //  Replace the existing Action with this class
              component.getActionMap().put(key, this);
              //  Copy key/value pairs to
              if (originalAction instanceof AbstractAction)
                   AbstractAction action = (AbstractAction)originalAction;
                   Object[] actionKeys = action.getKeys();
                   for (int i = 0; i < actionKeys.length; i++)
                        String actionKey = actionKeys.toString();
                        putValue(actionKey, action.getValue(actionKey));
         private Object getKeyForActionMap(JComponent component, KeyStroke keyStroke)
              for (int i = 0; i < 3; i++)
              InputMap inputMap = component.getInputMap(i);
              if (inputMap != null)
                        Object key = inputMap.get(keyStroke);
                        if (key != null)
                             return key;
              return null;
         public void invokeOriginalAction(ActionEvent e)
              originalAction.actionPerformed(e);
         public void actionPerformed(ActionEvent e)
              System.out.println("custom code here");
              invokeOriginalAction(e);
         public void addPropertyChangeListener(PropertyChangeListener listener)
              originalAction.addPropertyChangeListener(listener);
         protected Object clone()
              originalAction.clone();
         protected void firePropertyChange(String propertyName, Object oldValue, Object newValue)
              originalAction.firePropertyChange(propertyName, oldValue, newValue);
         public Object[] getKeys()
              return originalAction.getKeys();
         public PropertyChangeListener[] getPropertyChangeListeners()
              return originalAction.getPropertyChangeListeners();
         public Object getValue(String key)
              return originalAction.getValue(key);
         public boolean isEnabled()
              return originalAction.isEnabled();
         public void putValue(String key, Object newValue)
              originalAction.putValue(key, newValue);
         public void removePropertyChangeListener(PropertyChangeListener listener)
              originalAction.removePropertyChangeListener(listener);
         public void setEnabled(boolean newValue)
              originalAction.setEnabled(newValue);
         public static void main(String[] args)
              JTextArea textArea = new JTextArea(5, 30);
              JFrame frame = new JFrame("Wrapped Action");
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              frame.add(new JScrollPane(textArea), BorderLayout.NORTH);
              frame.add(new JButton(new WrappedAction(textArea, KeyStroke.getKeyStroke("control V"))));
              frame.pack();
              frame.setLocationRelativeTo( null );
              frame.setVisible( true );

    I can't get the PropertyChangeListener to fire with any source. Here is my test code. Note I am able to add the PropertyChangeListener to the "Paste Action", but I get no output when I add it to the WrappedAction. I must be missing something basic.
    import java.awt.*;
    import java.awt.event.*;
    import java.beans.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.text.*;
    public class WrappedAction3 implements Action, PropertyChangeListener
         private Action originalAction;
         private SwingPropertyChangeSupport changeSupport;
          *  Replace the default Action for the given KeyStroke with a custom Action
         public WrappedAction3(JComponent component, KeyStroke keyStroke)
              Object actionKey = getKeyForActionMap(component, keyStroke);
              if (actionKey == null)
                   String message = "no input mapping for KeyStroke: " + keyStroke;
                   throw new IllegalArgumentException(message);
              originalAction = component.getActionMap().get(actionKey);
              if (originalAction == null)
                   String message = "no Action for action key: " + actionKey;
                   throw new IllegalArgumentException(message);
              //  Replace the existing Action with this class
              component.getActionMap().put(actionKey, this);
              changeSupport = new SwingPropertyChangeSupport(this);
            originalAction.addPropertyChangeListener(this);
            addPropertyChangeListener(this);
          *  Search the 3 InputMaps to find the KeyStroke binding
         private Object getKeyForActionMap(JComponent component, KeyStroke keyStroke)
              for (int i = 0; i < 3; i++)
                  InputMap inputMap = component.getInputMap(i);
                  if (inputMap != null)
                        Object key = inputMap.get(keyStroke);
                        if (key != null)
                             return key;
              return null;
         public void invokeOriginalAction(ActionEvent e)
              originalAction.actionPerformed(e);
         public void actionPerformed(ActionEvent e)
              System.out.println("actionPerformed");
    //  Delegate the Action interface methods to the original Action
         public Object getValue(String key)
              return originalAction.getValue(key);
         public boolean isEnabled()
              return originalAction.isEnabled();
         public void putValue(String key, Object newValue)
              originalAction.putValue(key, newValue);
         public void setEnabled(boolean newValue)
              originalAction.setEnabled(newValue);
         public void xxxaddPropertyChangeListener(PropertyChangeListener listener)
              originalAction.addPropertyChangeListener(listener);
         public void xxxremovePropertyChangeListener(PropertyChangeListener listener)
              originalAction.removePropertyChangeListener(listener);
         public void addPropertyChangeListener(PropertyChangeListener listener)
            changeSupport.addPropertyChangeListener(listener);
        public void removePropertyChangeListener(PropertyChangeListener listener)
            changeSupport.removePropertyChangeListener(listener);
         public void propertyChange(PropertyChangeEvent evt)
             changeSupport.firePropertyChange(evt.getPropertyName(), evt.getOldValue(), evt.getNewValue());
         public static void main(String[] args)
              JTable table = new JTable(15, 5);
              WrappedAction3 action = new WrappedAction3(table, KeyStroke.getKeyStroke("TAB"));
              action.addPropertyChangeListener( new PropertyChangeListener()
                   public void propertyChange(PropertyChangeEvent e)
                        System.out.println(e.getSource().getClass());
              action.putValue(Action.NAME, "name changed");
              Action paste = new DefaultEditorKit.PasteAction();
              paste.addPropertyChangeListener( new PropertyChangeListener()
                   public void propertyChange(PropertyChangeEvent e)
                        System.out.println(e.getSource().getClass());
              paste.putValue(Action.NAME, "name changed");
    }

  • What are the uses of Void wrapper class?

    Hi,
    Similar to other Wrappers, Void is a wrapper class for the primitive ' void ' . We all know that Void is a final class , we can't instantiate it.
    My Question is what are the uses of Void?
    thanks,

    kajbj wrote:
    I have at times used it in reflection and jmx.I have used them with SwingWorker if I didn't have anything interesting to return. There is also an example in the tutorial: [http://java.sun.com/docs/books/tutorial/uiswing/concurrency/simple.html]

  • Developing the Wrapper class to log the message in XI server

    Hi All,
    We are trying to develop  wrapper class on the SAP Logging API, in that I am unable to log the message in the log file(whose path is mentioned in the properties file).
    We use this for storing when exception raised during message transformation due to certain error conditions...
    Procedure:
    My Wrapper class will take the parameters from Property file and store/log the message in the specified location,
    This is working outside of XI environment
    Please suggest how to make to work in XI environment
    Also suggest do I need to do any configurations in SAP web As
    Thanks,
    venu.

    HI,
    With the above blog ref by Michal , see the below links also,
    /people/alessandro.guarneri/blog/2006/03/27/sap-xi-lookup-api-the-killer
    /people/amjad-ali.khoja/blog/2005/12/16/slaw-a-new-logging-tracing-framework-for-xi
    /people/amjad-ali.khoja/blog/2006/02/07/using-dom4j-in-xi--a-more-sophisticated-option-for-xml-processing-than-sap-xml-toolkit
    Also my be useful..
    /people/community.user/blog/2007/01/09/enterprise-soa-explorations-reflections-on-database-integration
    /people/anne.tarnoruder/blog/2006/10/26/reusing-code-with-pdk-for-net
    /people/piers.harding/blog/2006/05/18/ruby-on-rails-with-ajax
    Regards
    Chilla

  • How to pass a command line argument to a jsp file...

    Hi guys,
    I'm writing a jsp file in which I have some java codes. I want to pass some command line arguments to that jsp file. In other words, I have some files located somewhere on my C drive and I want to pass the path to these files to my jsp file. How can it be done? I have never done before.
    Any suggestion will be very hepful...
    Thanks....

    I dont know if I truly understand your problem...
    For instance, when you place the url of your jsp you can add, at the end some parameters. For example:
    http://myserver/myapp/myjsp.jsp?MyParameter=C:\Temp\JavaTutorial.html
    In your JSP, you can place this code on a scriplet to get the value:
    String path = request.getParameter("MyParameter");
    Hope it helps.

  • How to get SDKODBC Wrapper class for indesign cs3

    Hi,
         I have to implement the mysql database with my indesign plugin. I didn't have a SDKODBC Wrapper class. Can any one say how to get SDKODBC Wrapper class from adobe.
    Regards,
    saravanan.

    I doubt if change documents are generated for SE78 transaction.
    For list of change documents defined, please check table: TCDOB.
    Hope this helps.
    Kind Regards
    Eswar

  • Failed to Generate Wrapper Class Error With Postgresql

    Hello,
    Sorry if this comes across twice, I posted it first through the Google Groups interface, but I haven't seen it show up on the dev2dev forum interface. So here it is again.
    I've read the following threads that seem to be related to this
    question:
    http://groups-beta.google.com/group/weblogic.developer.interest.jdbc/browse_thread/thread/dc8f0a9ee03e9b9f/f0a70a673db3bb52
    http://groups-beta.google.com/group/weblogic.developer.interest.jdbc/browse_thread/thread/4f3b71c77dca30c4/4ed2e1c7b76a0c7b
    I also followed the links in the second post ( I also found them via
    Google as well ). I've been very sure the Postgresql JDBC driver is
    definitely in the class path. I'm able to load it with Class.forName()
    from a JSP page and then use DriverManager to get a connection that
    works. So that definitely means the driver is found.
    What else can cause this?
    The only really odd thing I am doing is running Weblogic on OS X,
    10.3.7 with all the updates. I know that this Weblogic setup works
    since I work on Oracle all day (using the provided Weblogic driver in
    8.1SP3). Just when I try to create a Postgresql connection for testing
    our app against Postgresql.
    I've tried it on Windows with Weblogic 8.1SP3 and it works, so I know
    Weblogic is capable of using this driver.
    My exact stacktrace is:
    java.lang.RuntimeException: Failed to Generate Wrapper Class
    at
    weblogic.utils.wrapper.WrapperFactory.createWrapper(WrapperFactory.java:183)
    at
    weblogic.jdbc.wrapper.JDBCWrapperFactory.getWrapper(JDBCWrapperFactory.java:171)
    at weblogic.jdbc.pool.Driver.allocateConnection(Driver.java:248)
    at weblogic.jdbc.pool.Driver.connect(Driver.java:164)
    at weblogic.jdbc.jts.Driver.getNonTxConnection(Driver.java:507)
    at weblogic.jdbc.jts.Driver.connect(Driver.java:139)
    at
    weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:305)
    at jsp_servlet.__direct._jspService(direct.jsp:13)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
    at
    weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:996)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:419)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:463)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:315)
    at
    weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6452)
    at
    weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at
    weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
    at
    weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3661)
    at
    weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2630)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
    at weblogic.jdbc.jts.Driver.wrapAndThrowSQLException(Driver.java:458)
    at weblogic.jdbc.jts.Driver.getNonTxConnection(Driver.java:511)
    at weblogic.jdbc.jts.Driver.connect(Driver.java:139)
    at
    weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:305)
    at jsp_servlet.__direct._jspService(direct.jsp:13)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
    at
    weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:996)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:419)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:463)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:315)
    at
    weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6452)
    at
    weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at
    weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
    at
    weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3661)
    at
    weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2630)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
    What is going on at the place where this crashes? Is there a way find
    out what class it really can't find?
    Thanks,
    Patrick

    Patrick,
    1. Could you try to test the postgress connection pool using
    "Test Connection" on the pool set up page?
    2. Could you compare config.xml for broken and working installations
    in part of the connection pool settings?
    Regards,
    Slava Imeshev
    "Patrick Burleson" <[email protected]> wrote in message
    Sorry if this comes across twice, I posted it first through the Google Groups interface, but I haven't seen it show up on thedev2dev forum interface. So here it is again.
    >
    I've read the following threads that seem to be related to this
    question:
    http://groups-beta.google.com/group/weblogic.developer.interest.jdbc/browse_thread/thread/dc8f0a9ee03e9b9f/f0a70a673db3bb52
    http://groups-beta.google.com/group/weblogic.developer.interest.jdbc/browse_thread/thread/4f3b71c77dca30c4/4ed2e1c7b76a0c7b
    I also followed the links in the second post ( I also found them via
    Google as well ). I've been very sure the Postgresql JDBC driver is
    definitely in the class path. I'm able to load it with Class.forName()
    from a JSP page and then use DriverManager to get a connection that
    works. So that definitely means the driver is found.
    What else can cause this?
    The only really odd thing I am doing is running Weblogic on OS X,
    10.3.7 with all the updates. I know that this Weblogic setup works
    since I work on Oracle all day (using the provided Weblogic driver in
    8.1SP3). Just when I try to create a Postgresql connection for testing
    our app against Postgresql.
    I've tried it on Windows with Weblogic 8.1SP3 and it works, so I know
    Weblogic is capable of using this driver.
    My exact stacktrace is:
    java.lang.RuntimeException: Failed to Generate Wrapper Class
    at
    weblogic.utils.wrapper.WrapperFactory.createWrapper(WrapperFactory.java:183)
    at
    weblogic.jdbc.wrapper.JDBCWrapperFactory.getWrapper(JDBCWrapperFactory.java:171)
    at weblogic.jdbc.pool.Driver.allocateConnection(Driver.java:248)
    at weblogic.jdbc.pool.Driver.connect(Driver.java:164)
    at weblogic.jdbc.jts.Driver.getNonTxConnection(Driver.java:507)
    at weblogic.jdbc.jts.Driver.connect(Driver.java:139)
    at
    weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:305)
    at jsp_servlet.__direct._jspService(direct.jsp:13)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
    at
    weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:996)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:419)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:463)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:315)
    at
    weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6452)
    at
    weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at
    weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
    at
    weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3661)
    at
    weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2630)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
    at weblogic.jdbc.jts.Driver.wrapAndThrowSQLException(Driver.java:458)
    at weblogic.jdbc.jts.Driver.getNonTxConnection(Driver.java:511)
    at weblogic.jdbc.jts.Driver.connect(Driver.java:139)
    at
    weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:305)
    at jsp_servlet.__direct._jspService(direct.jsp:13)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
    at
    weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:996)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:419)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:463)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:315)
    at
    weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6452)
    at
    weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at
    weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
    at
    weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3661)
    at
    weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2630)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
    What is going on at the place where this crashes? Is there a way find
    out what class it really can't find?
    Thanks,
    Patrick

Maybe you are looking for

  • Error getting,while generating the Webi report

    hi, while  i am generatign the Webi report, i am getting below error. com.jpmorgan.extraclear.reportservice.BOException:  :generateReport :: Exception com.businessobjects.rebean.wi.ServerException: The number of simultaneous report jobs was limited t

  • Monitor out of focus

    I have recently purchased a MacBook Pro referb which has worked fine for two months. Suddenly the monitor has started to go out of focus (esp type) in patchy areas. Oddly, when i move the cursor halfway down the monitor it appears to move up one pixe

  • Operation on waveform during acquisition

    Hi I make an acquisition of 6 channels by daqmx. After a first acquisition where i obtain 6 means values, i need to make a continuous acquisition with a waveform. And i need at each loop to substract on each channel each mean value from data from wav

  • Itunes sign in help

    i changed my email addres.  i updated my itunes account with my new email address (username).  however, on my iphone, whenever i need to update and app or purchase something, my username comes up as my old email address instead of my new one so i can

  • MPEG Streamclip or iSquint?

    Just got the wife the 5G iPod and we're taking a test drive on MPEG Streamclip. I know video conversions take hours, and the conversion of a 700MB Pink Panther AVI will not spare us this ordeal. We're getting down to the 8th hour on MPEG Streamclip,