Wrapper class ?? what that ??
please anybody could give me an example of utilisation of a "wapper class" ? (I don t know what is this)
thanks....
then the next (and the main) question is :
I am displaying a frame which contains canvas. when I invoc the method g1.drawRenderedImage (from api Java Advancing Imaging), the console java prints the message :
could not find mediaLid Accelerator Wrapper Classes. Continuing in pure java mode
do you thing that the problem is that there isnt any Keystroke ?
thanks....
Similar Messages
-
Why to use wrapper class?
hello,
can anybody please tell me why wrapper class are used in JAVA and what are exactly wrapper class?
reply me soon....I want to give an example and then explain why it is for. Primitives will be good example for this situation.
Example:
Below are the primitive types and their wrapper classes...
Primitive to Wrapper Class
byte - Byte
short - Short
int - Integer
long - Long
char - Character
float - Float
double - Double
boolean - Boolean
USING OBJECT CREATION
Think a situation when you create an integer object using this code:
---> Integer intVar = new Integer();
you have the methods and constants:
1 MAX_VALUE ,
2 MIN_VALUE ,
3 byteValue() ,
4 compareTo(Integer anotherInteger) ,
5 compareTo(Object o) ,
6 decode(String nm) ,
7 doubleValue() ,
8 equals(Object obj) ,
9 floatValue() ,
10 getInteger(String nm) ,
11 getInteger(String nm, int val) ,
12 getInteger(String nm, Integer val) ,
13 hashCode() ,
14 intValue() ,
15 longValue() ,
16 parseInt(String s) ,
17 parseInt(String s, int radix) ,
18 shortValue() ,
19 toBinaryString(int i) ,
20 toHexString(int i) ,
21 toOctalString(int i) ,
22 toString(),
23 toString(int i) ,
24 toString(int i, int radix) ,
25 valueOf(String s) ,
26 valueOf(String s, int radix)
now you have an object with 2 constants and 24 methods.
USING WRAPPER CLASS
and think using wrapper class of Integer..
CODE ---> int intVar = Integer.parseInt((String)someStringData);
In this case your Integer object have the methods and constants
1 MAX_VALUE ,
2 MIN_VALUE ,
3 parseInt(String s) ,
4 parseInt(String s, int radix) ,
5 toBinaryString(int i) ,
6 toHexString(int i) ,
7 toOctalString(int i) ,
8 toString(int i) ,
9 toString(int i, int radix) ,
10 valueOf(String s) ,
11 valueOf(String s, int radix)
as you in this situation you have 2 constants and 9 methods.
AS YOU SEE THERE ARE 15 METHODS DIFFERENCE FROM THE OBJECT AND THE WRAPPER CLASS OF INTEGER OBJECT.
NOW TALKING ABOUT PRIMITIVE TYPES ALL PROGRAMMERS USED THIS TYPES FOR THEIR CODES AND THEY ALWAYS NEED SOME THIS KIND OF CASTING. IN MY EXAMPLE I TAKE THE VALUE OF AN STRING VARIABLE. AND THERE ARE LOTS OF THINGS SIMILIAR TO THIS EXAMPLE.
IDEA OF THIS WRAPPER CLASSES IS THAT USE AS YOU NEED NOTHING MORE. IN THE WRAPPER CLASS YOU DONT HAVE INTEGER OBJECT. YOU ONLY NEED THE PARSEINT METHOD OF INTEGER OBJECT INSTEAD OF CREATING THE INTEGER OBJECT YOU USE THE WRAPPER CLASS OF THIS TYPE...
OBJECTS ARE STORED IN A MEMORY PLACE CALLED HEAP WHICH IS PLACED ON RAM AND GARBAGING OF THIS OBJECTS TAKES MORE TIME TO ALLOCATE FROM HEAP STORAGE.
AND ANOTHER NOTE FOR THIS WRAPPER CLASSES if you want to store an int inside a container such as an ArrayList (which takes only Object references), you can wrap your int inside the standard library Integer class
EX:
import java.util.*;
public class ImmutableInteger {
public static void main(String[] args) {
List v = new ArrayList();
for(int i = 0; i < 10; i++)
v.add(new Integer(i));
// But how do you change the int inside the Integer?
} ///:~
GOOD LUCK...
REALKINGTA.... -
Hello, i was looking for a ivi-com driver for the keithley 2410, and there exist only for IVI-C, but i need to write a program in visual c# in order to control the 2410, doing some research i read that i can use the ivi-C driver using a wrapper class, but that is generated in labwindows, which i don't have.
So i kindly request someone who can provide me with such wrapper class and (if possible) an example of use, i would really appreciate your help.
Thanks.Sorry i meant measurement studio instead of cvi, my bad, a mistake, and well i couldnt find a .net ivi driver for my device, just ivi-c.
i cannot call the ivi-c in visual c#, cannot add a reference.
http://www.ni.com/mstudio/esa/. -
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] -
What is the advantage of using Wrapper Classes ?
Hi friends,
I am happy to join Java/J2EE tech. My project is scaled over the network. MVC-II struts, EJB based architecture, we are using.
We are asked to use Wrapper Classes in in Java programs and not the primitive data types. I could not understand the reason.
Pls tell me what is the advantage of using Wrapper Classes over the primitive data types ?
means Integer instead of int, etc....Hi friends,
I am happy to join Java/J2EE tech. My project is
scaled over the network. MVC-II struts, EJB based
architecture, we are using.
We are asked to use Wrapper Classes in in Java
programs and not the primitive data types. I could
not understand the reason.
Pls tell me what is the advantage of using Wrapper
Classes over the primitive data types ?
means Integer instead of int, etc....I am not sure why use Integer over int; but Wrapper classes are used to remove coupling between classes and create one hand doesn't know what the other hand does effect.
for example:
when you have a SFTP java package but doesn't do everything that your application needs to do in one step and you need to do sftp stuff at many places in your application, it would be wise not to use SFTP java package directly from all the classes that need to do sftp stuff. Because if you were to change the SFTP package later due to say some bug fix or newer version or ... you would have to go and modify all the classes that had sftp stuff to update.
Instead you could write a custom sftp wrapper that handles all the sftp stuff for your application needs and that wrapper deals with the SFTP java package. So all the classes don't need to know which SFTP java package is being used only the custom-wrapper needs to know. -
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,
JohnAn 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 are Wrapper classes and what are they used for ?
What are Wrappter classes and what are they used for ?..Also, any examples would be great to understand this concept
Wrapper classes are used to enclose primitive data
types so that they can be used in instances where an
object is required. For example, if you want to add an
integer to an ArrayList, you can't use this:java.util.List al = new ArrayList();
int i=123;
al.add(i);because the ArrayList expects data of type object. In
order to all the integer to the ArrayList, you must wrap
it in the Integer wrapper class. This works:java.util.List al = new ArrayList();
int i=123;
al.add(new Integer(i));Hope that helps.
Mark -
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");
} -
Revision: 1384
Author: [email protected]
Date: 2008-04-24 07:54:58 -0700 (Thu, 24 Apr 2008)
Log Message:
Splitting DefineFont into the various DefineFont 1, 2, 3, etc SWF tag formats but retaining a common base DefineFont class so that embedded fonts are still retained as symbols for the SWF dictionary no matter what version of the SWF tag is used.
Also improving [Embed] so that it can recognize .TTC files as assets (previously these were only recognized through CSS @font-face rules).
QE: Yes, please add a test case for using [Embed] to embed fonts from a TTC file in addition to our tests for @font-face. Note that the AFEFontManager must be configured for this scenario.
Doc: No
Checkintests: Pass
Mxunit: AtEmbed Font suite: Pass
Modified Paths:
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/media/AbstractTranscoder.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/media/FontTranscoder.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/MimeMappings.java
flex/sdk/trunk/modules/compiler/src/java/flex2/tools/PreLink.java
flex/sdk/trunk/modules/swfutils/src/java/flash/fonts/CachedFontManager.java
flex/sdk/trunk/modules/swfutils/src/java/flash/swf/Dictionary.java
flex/sdk/trunk/modules/swfutils/src/java/flash/swf/MovieEncoder.java
flex/sdk/trunk/modules/swfutils/src/java/flash/swf/TagDecoder.java
flex/sdk/trunk/modules/swfutils/src/java/flash/swf/TagEncoder.java
flex/sdk/trunk/modules/swfutils/src/java/flash/swf/TagHandler.java
flex/sdk/trunk/modules/swfutils/src/java/flash/swf/TagValues.java
flex/sdk/trunk/modules/swfutils/src/java/flash/swf/builder/tags/FontBuilder.java
flex/sdk/trunk/modules/swfutils/src/java/flash/swf/tags/DefineFont.java
flex/sdk/trunk/modules/swfutils/src/java/flash/swf/tags/DefineFontAlignZones.java
flex/sdk/trunk/modules/swfutils/src/java/flash/swf/tags/DefineFontInfo.java
flex/sdk/trunk/modules/swfutils/src/java/flash/swf/tools/SwfxPrinter.java
Added Paths:
flex/sdk/trunk/modules/swfutils/src/java/flash/fonts/DefineFont3Face.java
flex/sdk/trunk/modules/swfutils/src/java/flash/swf/tags/DefineFont1.java
flex/sdk/trunk/modules/swfutils/src/java/flash/swf/tags/DefineFont2.java
flex/sdk/trunk/modules/swfutils/src/java/flash/swf/tags/DefineFont3.java
flex/sdk/trunk/modules/swfutils/src/java/flash/swf/tags/DefineFont4.java
Removed Paths:
flex/sdk/trunk/modules/swfutils/src/java/flash/fonts/DefineFontFace.javaRunning the script by python2 solves it for me:
su - mythtv -c "nice -n 19 python2 /usr/bin/tv_grab_nl_py --output ~/listings.xml"
Best regards,
Cedric -
Could someone please explain to me what a wrapper class is in Java. I have tried the net, but to no avail.
Thankssometimes the term is also used to refer to glue code, which adds no functionality but allows existing code to be used in a new place.
For example, an anonyous inner classs used to invoke an existing class's functionality as an event handler, is sometimes referred to as a wrapper class. -
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,
PatrickPatrick,
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 -
Advantages and disadvantages of wrapper classes
Hi ,
will you please let me know what are the advantages and disadvantages of wrapper classes.
please do needful ASAP.
thanks in advanceHi Anil,
Wrapper classes are classes that allow primitive types to be accessed as objects.
Refer the foll Link:
http://www.cs.wustl.edu/~schmidt/PDF/Reactor1-93.pdf
http://whitepapers.silicon.com/0,39024759,60104914p,00.htm
Regards,
Sunil -
Advantages and disadvantages of wrapper class
Hi ,
will you please let me know what are the advantages and disadvantages of wrapper classes.
please do needful ASAP.
thanks in advanceHi Anil,
Wrapper classes are classes that allow primitive types to be accessed as objects.
Refer the foll Link:
http://www.cs.wustl.edu/~schmidt/PDF/Reactor1-93.pdf
http://whitepapers.silicon.com/0,39024759,60104914p,00.htm
Regards,
Sunil -
Hi,
I'm creating a class to my SCJD cert impl that has a protected RandomAccessFile reference member. I've designed this member as protected since subclasses really need to access it.
My dilema is that I thought of this class as a wrapper to that member, but, the way it is, classes from the same package can access it too, and I didn't really need/want that. I think of a wrapper as something that really encapsulates something, so...
Am I breaking any rules with the definition of wrapper classes? Does anyone know if any Java class has the same dilema?
thanks in advance,
Talessubclasses
really need to access it.Unlikely. I don't think I've ever created a protected member variable in 8 or 9 years of writing Java code.
My dilema is that I thought of this class as a
wrapper to that member,I would think the thing being wrapped would be private.
but, the way it is, classes
from the same package can access it too,Yes. Protected access allows classes in the same package to access it.
and I didn't
really need/want that.Then I think you're misunderstanding packages and/o subclassing. A package is a "closer" relationship than a parent/child relationship. It's perfectly natural for classes in the same package to be able to access a protected member. If it's a problem that they're able to access that member, then they probably shouldn't be in that package.
Am I breaking any rules with the definition of
wrapper classes? I'm not sure what the formal definition is--or if there is one--but I think making the wrapped thing non-private does violate the spirit of wrapper classes.
Also, I don't know if it's a good idea for a wrapper class not to be final.
Maybe you are looking for
-
Work center change in Service order not happening
Hi Experts, I am facing a problem when i try to Call a function module in update task where the Function module contains a call to BAPI_ALM_ORDER_MAINTAIN without COMMIT WORK. This is done in order to update the Work Center while there are changes to
-
I have an aluminium MacBook and have just connected an external Samsung HD monitor. The image is blurry and I cannot seem to fix it. The MacBook display is 1280x800 but the maximum for the external monitor is much higher. Also the external monitor so
-
2.Monitor an Dockingstation bleibt schwarz (T540p)
Hallo, wir haben einige T540p-Notebooks in Benutzung mit Dockingstations. Auf einem Arbeitsplatz musste ich die Dockingstation austauschen. Nur bekomme ich den 2. Monitor jetzt nicht mehr zum laufen. Dieser lief vorher über DVI, über DP oder VGA funk
-
When I close Firefox it will not open another window when you click on icons or manually try to open new window. I have to open Task Manager find Firefox program and manually close program. Then when you open a new Firefox window it try's to restore
-
Strange behavior when trying to change backgrounds after Aperture install
Running 10.5.1 on my MacBook Pro without a hitch until today. Installed Aperture 1.5 and updated it to 1.5.6 last night and it too works fine. However, today when I went to change my background image in System Preferences I encountered some strange v