| showdocument() problem (or bug?) |
|
 |
Index ‹ java-programmer
|
- Previous
- 2
- dynamic instanciation of a generic classHi,
I've a question about Tiger (Java 5), genercity and dynamic instanciation
of class.
I can't found tutorial or sample via the Net.
By exemple :
public class A<T>
{
private T v;
public A(T v)
{
this.v=v;
}
public void test()
{
System.out.println(v.getClass().getName());
}
}
I'd like instanciate the A class with something like that : Class.forName
("A").... but why can I specified T parameter ?
Please, send me some sample or URL.
Thanks,
Arnaud.
- 5
- in PARAM NAME causing problemsHello,
I have an application that generates a HTML document that contains an
applet. It places raw data into the PARAM NAME tag. Well, once in a blue
moon it places the numeric character reference into the data. When my
Java applet imports this using the getParameter command, it reacts
differently between different version of IE. One solution is to not let my
original application generate the sequence , however, this does not fix
the HTML documents that have already been generated in the past. It would be
nice to just fix the Java applet so it can import this raw data without
having to recognize as a numeric character reference.
Is this possible?
Here is my HTML code:
<CENTER><APPLET CODE="graphics.class" ALIGN=RIGHT HEIGHT=420 WIDTH=220>
<PARAM NAME=Graphics VALUE="
>=>.>/(%<!<!>((6<0>%(#(!(+>%(!(>(!>%(%>%>!(&/<(*<&>*/6>0>((!>+(%(<()<&(!>!(=(><!>#/)(#(6>+/=(.>+/1>&>#16<!/>(*(#/!(*(!/!(//#((>=1(/=/01)(/1=/!(=1//61!!6/>!61=>1!>/+!(!./!!+1%//./1*1<.&//./%.1!.+%*..<#&.%/.%%1.1/.&//.*.>1=!01*1=!!(.!1!<(&!)/*/(1#(+1+1!/)1!<!(11>>./#1)(>/%/*(//!>%/#/#((1<(/(616(&/)/<>#>.(%(1(+(<(+>1>+(>(%>&(+>((0(%((((>+(0(6>>()(/>+(&>%<%>.(6>#>>(!<.()(%<!>((!>!<&(!()<!(=(<>/>1<#??
"></APPLET></CENTER>
- 6
- AWT Cursor in vista problemHi,
i have an applet with a black background.
when i set the Cursor to Cursor.TEXT_CURSOR in Vista the cursor is
displayed also in black, and it is not seen.
any idea???
- 6
- How does one combine the Adapter and Factory design patterns in a memory efficient way?I'm using the adapter pattern, and I've got a factory to generate adapters
for passed in adaptees. Let's call the class of the objects getting adapted
"Foo", and the Adapter class itself "Bar".
So here are some details specific to my situation:
1) the constructor for Bar is private and visible to the factory (Bar is
acting as its own factory), so I can completely control when and how Bar
gets instantiated.
2) If an existing adapter for a given instance of Foo doesn't exist yet,
I'll want to create a new Bar which matches with it.
3) If there already is a adapter h for Foo, I have to return that existing
match, and NOT generate a new one.
4) upon a request for an adapter for null, I return null.
This is relatively easy to do if I have infinite memory. I just create a
Map<Foo,Bar>, like so:
<code>
public class Bar {
private final Foo f;
private Bar(Foo f) {
this.f = f;
}
private final static Map<Foo,Bar> mapping = new
ConcurrentHashMap<Foo,Bar>();
public static Bar make(Foo f) {
if (impl == null) {
return null;
}
synchronized (mapping) {
if (!mapping.containsKey(f)) {
mapping.put(f, new Bar(f));
}
Bar b = mapping.get(f);
assert returnValue != null;
return returnValue;
}
}
public void newInterfaceWhichModifiesState() {
this.f.oldInterfaceWhichModifiesState();
}
public int newInterfaceWhichGetsState() {
return this.f.oldInterfaceWhichGetsState();
}
}
</code>
However, it's possible that the calling code is generating billions and
billions of instances of Foo, and then throwing them away after their first
use. My Map would prevent the garbage collector from being able to reclaim
those instances. I can safely delete those "throwaway Foos" and their
matches from my Map, because if there doesn't exist a reference to some
instance of Foo anywhere else in the JVM, then it can't possibly ever occur
that that instance will ever get passed into my make(Foo) method, in which
case, I would never need to return its corresponding Bar.
The two potential-solutions I looked at, Maps of WeakReferences and
WeakHashMap, turned out not to satisfy my requirements.
If instead of a Map<Foo,Bar>, I had a Map<Foo,WeakReference<Bar>>, then it's
possible that the matching Bar would get garbage collected, but the instance
of Foo would get passed in again, and there's no way for me to recover its
matching pair, thus violating condition (3) mentioned above.
If I replace Map<Foo,Bar> with WeakHashMap<Foo,Bar>, none of the keys will
get GCed, because instances of Bar contain a strong reference to Foo, via
the private field f. If I change that field to a weak reference, then it's
possible the instance of Foo that's being adapted will get GCed while the
corresponding adapter is still in use, resulting in the newInterface()
method failing.
I think what I need is some sort of special PairOfWeakReference class such
that if there are any references to either an instance of Foo or its
corresponding Bar, then BOTH remain uncollectable. However, once there do
not exist any strong references to either instances, then the pair become
collectable simultaneously.
Using a pair class, as in:
<code>
public class Pair<A,B> {
public final A a;
public final B b;
public Pair(A a, B b) {
this.a = a;
this.b = b;
}
}
</code>
WeakReference<Pair<Foo,Bar>> won't work either, because the WeakReference
class is checking against references to instances of the Pair class, rather
than references to the instances of Foo and Bar.
This adapter-factory combination doesn't sound like something that unusual
or obscure, so I figure I must be missing something simple from effectively
implementing it. Can anyone tell me what that is?
- Oliver
- 7
- 8
- How to place a window in the center of the screen ?I would like to open a window and to placed it at a certain position on a screen
(e.g. in the center).
How do I do this? My (simplified) current code looks like:
public class testGBL extends JFrame implements ActionListener {
JLabel lab1;
....
JButton butBack;
public testGBL() {
...
Container contentPane = getContentPane();
GridBagLayout gridbag = new GridBagLayout();
GridBagConstraints c = new GridBagConstraints();
contentPane.setLayout(gridbag);
c.fill = GridBagConstraints.HORIZONTAL;
butBack = new JButton("Back");
c.gridx = 0;
c.gridy = 0;
c.weightx = 1.0;
c.gridwidth = 2;
gridbag.setConstraints(butBack, c);
butBack.setEnabled(false);
butBack.addActionListener(this);
contentPane.add(butBack);
....
}
public static void main(String args[]) {
testGBL window = new testGBL();
window.setTitle("test");
window.pack();
window.setVisible(true); }
}
- 8
- JFace getting startedHi
I try to run a simple SWT/Jface example. I am running this from inside
eclipse 3.2.0 and I have included the following in my classpath:
swt.jar - Taken from swt-3.3M3-win32-win32-x86.zip
jface.jar - Taken from program files\eclipse\plugins and Renamed from
org.eclipse.jface_3.2.0.I20060605-1400.jar
Here is the class:
import org.eclipse.jface.window.*;
import org.eclipse.swt.widgets.*;
public class MyJFaceExample1 extends Window {
public MyJFaceExample1() {
// super(null); //Wont compile with null as the beginner example says
it should
super(new Shell()); //Compiles
}
public static void main(String[] args) {
MyJFaceExample1 demo = new MyJFaceExample1();
demo.setBlockOnOpen(true);
demo.open();
Display.getCurrent().dispose();
}
------------------------------------------------------------
This compiles fine but when I try to run this I get:
java.lang.NoClassDefFoundError:
org/eclipse/core/commands/common/EventManager
I then copy c:\program
files\eclipse\plugins\org.eclipse.core.commands_3.2.0.I20060605-1400.jar
and rename it to core.jar.
I then get the following error: java.lang.NoClassDefFoundError:
org/eclipse/core/runtime/ListenerList
Then I am stuck.
Please help me with getting started with JFace.
- 11
- JTable refresh problemI have a JTable where I paint some of the cell backgrounds with
a custom renderer. getTableCellRendererComponent() paints with
drawLine() and fillRect() and that sort of thing. It's all working
fine but when I drag another window over the JTable, or when I
scroll it, sometimes it's not getting repainted correctly.
Any ideas how to make it refresh or repaint itself at the right
times?
I looked in the group archives and there were a lot of other messages
but they were about when a table's content changes dynamically.
I'm not changing the content, I'm just trying to get the table
to keep the correct content when scrolled and when other windows
pass over it.
Thanks in advance,
- Mitch Gart
- 11
- Java NIO selector close idle connections?I have an object attached to all selectionKeys with a timestamp
showing last activity
on the connection. So how/when do i run through the keys to find
connections
that have been idle too long? Can i do it in the same main selector
loop that handles accept/read etc like this:
while (true) {
selector.select(sometimeout);
Iterator selectedKeys = selector.selectedKeys().iterator();
while (selectedKeys.hasNext()) {
..process the selected key... accept/read etc..
}
if (timeToCheckForIdleConnections) {
Set<SelectionKey> k = selector.keys();
.. get attachment of all keys and check their timestamp for last
activity.. if idle for too long then close them!
}
}
or should I use a timethread that signals back to the main selector
thread which connections to close?
- 14
- I'm looking for jsp hostingHello
I'm looking for reliable jsp web hosting. I won't be using mysql, I'm
more interested in postgres or other robust rdms
Thanks
Peter Mount
email***@***.com
- 14
- using ClassDep to reduce rt.jari have been trying to use the JINI tool ClassDep to create a list of the
dependencies of a program i have written, but have been unsuccessful. when
i run it i output a list of classes that ClassDeps says my program needs,
but when i create an rt.jar file containing only those classes (yes, in the
appropriate package directories) i get the following:
NoClassDefFoundError: java.lang.ArrayStoreException.
i figured maybe it was a fluke, and just manually included the class.
after doing so i got the following, more confusing error:
error: java.lang.Error: java.io.UnsupportedEncodingException: Cp1252
Cp1252 is not something i specifically make reference to in my program, and
have only a nebulous idea of what it even is/does.
anyway, though, that's beside the point: i would really like to make a
slimmed down version of rt.jar to fit my specific needs according to the
classes that are needed by my app.
is there any way to do this that works, or am i just using ClassDep
incorrectly?
Please Help!
Thank You!
-Voltaic
- 14
- Java Swing font anti-aliasing w/o desktop environmentHello all,
With the newer versions of Java your Swing apps can look extra pretty
thanks to font smoothing. When using Ubuntu (as I am) the builtin
desktop environment configurations set this up for you - when running
GNOME, KDE, or XFCE it looks great. But I choose to run my .xsession
file instead, which loads FVWM. And somewhere along the line something
isn't set right and I don't get pretty smoothed fonts in my Swing apps.
I checked environment variables and I can't see it there, so I'm
thinking it may be an X resource? I don't know; if anybody has any
ideas on which knob I can twiddle to get the pretty fonts back, I'd
greatly appreciate it!
Best regards.
--
Taylor Venable
email***@***.com
http://real.metasyntax.net:2357/
- 15
- Compile error help (linking a class library)Hi,
I set the CLASSPATH correctly but still get the following compile error. I
also tried the "-classpath" alternative and get the same error message.
/home/yao/eh/jython-20.class(org/python/core/PyInteger.java):4:
class PyInteger is public, should be declared in a file named
PyInteger.java
(source unavailable)
But the class PyInteger is in a file PyInteger.java, just it is in the
class jython-20.class but no a .java source file. I use to do things like
this (linking with a class library and use the classes provided in it) a
lol before. But why this time, it's not working? Did I missing something?
Thanks,
Stan
- 15
- What is the difference between a BMP EntityBean and a DAO ?As I read in a couple of articles a BMP (Bean Managed Persistence is an EntityBean
where the programmer has to care about the SQL statements.
On the other side a DAO implements the direct access to an SQL database.
But isn't that the same?
What are the differences ?
Lars
- 15
- Clarification of JavaLive delegates criticism?Back when the new J2SE1.5 features were announced, there was a
JavaLive community chat
(http://java.sun.com/developer/community/chat/JavaLive/2003/jl0729.html)
in which Neal Gafter explains the Sun stance on lack of support for
delegates:
... There are serious semantic problems with trying to add delegates
to a language in a consistent way. The main problem is that once you
call the delegate, the original class instance is no longer part of
the call chain, so overriding in the original class no longer takes
precedence over the delegate. ...
Could someone please explain this to me a little more fully? It
sounds like he's saying that delegates cannot follow a subclass call
chain if they are created from an object stored in a superclass
reference, but I can't tell if he means overriding delegates
themselves. I would like to know:
1) What exactly does he mean in less ambiguous terms? (Or maybe just
simpler terms; it's been a while since my college programming
languages course.)
2) What an example of delegates 'failing' like this would look like.
3) What is so significant about this problem.
I am already familiar with the 'Truth about Delegates' dialogue
between Sun and MS and the lack of true type safety of C# delegates,
but not understanding this criticism bothers me. Any help would be
greatly appreciated.
Thanks,
Jeff
|
| Author |
Message |
maxmike

|
Posted: 2005-6-3 4:43:00 |
Top |
java-programmer, showdocument() problem (or bug?)
I have a trusted applet that is supposed to generate a pdf file and
save it as a temporary file on the local machine, then display it.
Since display of such an animal can only happen with showDocument(URL,
type) I am trying to build the url using :
URL url = new URL("file:" + File.separator + File.separator +
"filename.pdf");
and this does indeed work IFF I run the applet locally. However, if the
bloody thing is running connected to the server, it does not. Then the
only command that works is
URL url = new URL(getCodeBase(), "filename.pdf");
so I had to bytestream the pdf down to server, have it install it in a
file and make the call. A real waste, considering I'm supposed to be
writing non-polluting software. Any ideas as to what's wrong with this?
Thanks.
|
| |
|
| |
 |
Roland

|
Posted: 2005-6-3 18:56:00 |
Top |
java-programmer >> showdocument() problem (or bug?)
On 2-6-2005 22:42, maxmike wrote:
> I have a trusted applet that is supposed to generate a pdf file and
> save it as a temporary file on the local machine, then display it.
> Since display of such an animal can only happen with showDocument(URL,
> type) I am trying to build the url using :
> URL url = new URL("file:" + File.separator + File.separator +
> "filename.pdf");
>
> and this does indeed work IFF I run the applet locally. However, if the
> bloody thing is running connected to the server, it does not. Then the
> only command that works is
> URL url = new URL(getCodeBase(), "filename.pdf");
> so I had to bytestream the pdf down to server, have it install it in a
> file and make the call. A real waste, considering I'm supposed to be
> writing non-polluting software. Any ideas as to what's wrong with this?
> Thanks.
>
I'd say your browser doesn't allow you to open a file from the local
file system.
When your applet is hosted on a remote server, the applet opening a
local filesystem file would be like a page from this remote server wants
to open a link like <a href="file:///C:/AUTOEXEC.BAT"> or <a
href="file:///etc/passwd">. Don't know for Internet Explorer, but
Mozilla does not allow this for security reasons.
--
Regards,
Roland de Ruiter
___ ___
/__/ w_/ /__/
/ \ /_/ / \
|
| |
|
| |
 |
maxmike

|
Posted: 2005-6-4 23:16:00 |
Top |
java-programmer >> showdocument() problem (or bug?)
Roland wrote:
> I'd say your browser doesn't allow you to open a file from the local
> file system.
> When your applet is hosted on a remote server, the applet opening a
> local filesystem file would be like a page from this remote server wants
> to open a link like <a href="file:///C:/AUTOEXEC.BAT"> or <a
> href="file:///etc/passwd">. Don't know for Internet Explorer, but
> Mozilla does not allow this for security reasons.
> --
> Regards,
>
> Roland de Ruiter
Thanks, Roland - what you say makes sense; it happens to me in IE,
Netscape and Firefox. It's just that there are no complaints from
either Java or the browser.
Mike.
|
| |
|
| |
 |
Andrew Thompson

|
Posted: 2005-6-5 8:22:00 |
Top |
java-programmer >> showdocument() problem (or bug?)
On 4 Jun 2005 08:15:43 -0700, maxmike wrote:
> ...there are no complaints from either Java or the browser.
Really?! You're not swallowing exceptions* by any chance
are you? Your code should be throwing (big, fat, juicy)
SecurityException's.
* <http://www.physci.org/codes/javafaq.jsp#stacktrace>
--
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.LensEscapes.com/ Images that escape the mundane
|
| |
|
| |
 |
John Currier

|
Posted: 2005-6-5 14:15:00 |
Top |
java-programmer >> showdocument() problem (or bug?)
Andrew, I can vouch that showDocument() can silently fail with no
indication that anything went wrong. It's a royal pain to debug when
it fails like that.
John
|
| |
|
| |
 |
Andrew Thompson

|
Posted: 2005-6-5 16:08:00 |
Top |
java-programmer >> showdocument() problem (or bug?)
On 4 Jun 2005 23:15:22 -0700, John Currier wrote:
> Andrew, I can vouch that showDocument() can silently fail with no
> indication that anything went wrong.
Yes, I am aware of the problem with the showDocument() method*,
but this browser has displayed that it will act on showDocument().
So that is apparently not the problem here.
OTOH, when something in an applet works for an URL but not a file,
it is most often because the applet does not have the necessary
file permissions or, less common, the programmer has mistaken
the server <-> client filesystems.
* <http://www.physci.org/test/showdoc/>
--
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.LensEscapes.com/ Images that escape the mundane
|
| |
|
| |
 |
Roland

|
Posted: 2005-6-6 3:53:00 |
Top |
java-programmer >> showdocument() problem (or bug?)
On 4-6-2005 17:15, maxmike wrote:
>
> Roland wrote:
>
>
>>I'd say your browser doesn't allow you to open a file from the local
>>file system.
>>When your applet is hosted on a remote server, the applet opening a
>>local filesystem file would be like a page from this remote server wants
>>to open a link like <a href="file:///C:/AUTOEXEC.BAT"> or <a
>>href="file:///etc/passwd">. Don't know for Internet Explorer, but
>>Mozilla does not allow this for security reasons.
>>--
>>Regards,
>>
>>Roland de Ruiter
>
>
> Thanks, Roland - what you say makes sense; it happens to me in IE,
> Netscape and Firefox. It's just that there are no complaints from
> either Java or the browser.
>
> Mike.
>
When you're using Firefox, open the Javascript console (menu Tools ->
JavaScript Console). It may contain an error message like
Security Error: Content at http://yourserver/path/to/YourApplet.html
may not load or link to file:///C:/path/to/your.PDF.
AFAIK, Netscape also has a Javascript console, but for IE I'm don't know
to display this kind of messages.
--
Regards,
Roland de Ruiter
___ ___
/__/ w_/ /__/
/ \ /_/ / \
|
| |
|
| |
 |
Andrew Thompson

|
Posted: 2005-6-6 4:04:00 |
Top |
java-programmer >> showdocument() problem (or bug?)
On Sun, 05 Jun 2005 21:53:05 +0200, Roland wrote:
> ..open the Javascript console..
'Javascript'?!? Did I miss something, where did JS come into it?
--
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.LensEscapes.com/ Images that escape the mundane
|
| |
|
| |
 |
Roland

|
Posted: 2005-6-6 4:38:00 |
Top |
java-programmer >> showdocument() problem (or bug?)
On 5-6-2005 2:22, Andrew Thompson wrote:
> On 4 Jun 2005 08:15:43 -0700, maxmike wrote:
>
>
>>...there are no complaints from either Java or the browser.
>
> ... Your code should be throwing (big, fat, juicy)
> SecurityException's.
Really?! I've created an applet and hosted it on a webserver. When it
runs in Firefox and tries to showDocument a file://-URL, nothing seems
to be happening. *Java* neither throws a "big, fat, juicy
SecurityException" nor any other exception. The only message is shown in
the Firefox *Javascript* console (a security error).
--
Regards,
Roland de Ruiter
___ ___
/__/ w_/ /__/
/ \ /_/ / \
|
| |
|
| |
 |
Roland

|
Posted: 2005-6-6 4:51:00 |
Top |
java-programmer >> showdocument() problem (or bug?)
On 5-6-2005 22:04, Andrew Thompson wrote:
> On Sun, 05 Jun 2005 21:53:05 +0200, Roland wrote:
>
>
>>..open the Javascript console..
>
>
> 'Javascript'?!? Did I miss something, where did JS come into it?
>
"Javascript console", not "Javascript".
--
Regards,
Roland de Ruiter
___ ___
/__/ w_/ /__/
/ \ /_/ / \
|
| |
|
| |
 |
Andrew Thompson

|
Posted: 2005-6-6 6:27:00 |
Top |
java-programmer >> showdocument() problem (or bug?)
On 2 Jun 2005 13:42:31 -0700, maxmike wrote:
It seems I have missed some important points thus far in this thread.
> I have a trusted ..
Missed that extremely important bit! That means the Java
'SecurityExceptions' I have been going on about should not
be happening (just as all have been trying to convince me).
[ Ooops, sorry! ]
Further, I managed to partially replicate the problem, as described
by the OP and reiterated by Roland. But that leads me to further
questions..
>..applet that is supposed to generate a pdf file and
> save it as a temporary file
So you must possess a File object of this file at one stage, right? [1]
>..on the local machine, then display it.
> Since display of such an animal can only happen with showDocument(URL,
> type) I am trying to build the url using :
> URL url = new URL("file:" + File.separator + File.separator +
> "filename.pdf");
[ I suspect 'File.separator' is wrong for this context, note that
the separator character for URL's is '/'*, and that is the same
across platforms. * <http://www.gbiv.com/protocols/uri/rfc/rfc3986.html> ]
[1] Why are you not using URL url = tempFile.toURL(); to get the
URL of the file? (..and does that work any better/differently?)
Just how 'temporary' is this temp file to which you wrote the PDF?
If it is closed & all references discarded, it may have been GC'd
by the VM and deleted by the VM/OS.
--
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.LensEscapes.com/ Images that escape the mundane
|
| |
|
| |
 |
maxmike

|
Posted: 2005-6-6 6:30:00 |
Top |
java-programmer >> showdocument() problem (or bug?)
Roland wrote:
> When you're using Firefox, open the Javascript console (menu Tools ->
> JavaScript Console). It may contain an error message like
> Security Error: Content at http://yourserver/path/to/YourApplet.html
> may not load or link to file:///C:/path/to/your.PDF.
>
> AFAIK, Netscape also has a Javascript console, but for IE I'm don't know
> to display this kind of messages.
Roland,
Thanks for this hint - didn't realize there was such a console. I was
relying on the Java console to report errors.
The big thing I forgot to mention is that I can read and write files
from/to the local file system with this applet while connected to the
server IFF I use the file open/saveas dialog. Just can't seem to do it
with showDocument().
Mike.
|
| |
|
| |
 |
Andrew Thompson

|
Posted: 2005-6-6 6:56:00 |
Top |
java-programmer >> showdocument() problem (or bug?)
On Sun, 05 Jun 2005 22:50:50 +0200, Roland wrote:
> On 5-6-2005 22:04, Andrew Thompson wrote:
>
>> On Sun, 05 Jun 2005 21:53:05 +0200, Roland wrote:
>>
>>>..open the Javascript console..
>>
>> 'Javascript'?!? Did I miss something, where did JS come into it?
>>
> "Javascript console", not "Javascript".
I was just surpised to hear the errors appeared in the JS console,
rather than the Java console. (But yes, I am finally clear on that now,
after seeing it for myself - I did a little test of my own using Mozilla,
which uses the fundamentally same engine as both NN and FF).
Interestingly, but veering off topic, I have noticed that Moz.
cannot even tell you it's own version number if JS is disabled.
It sounds as though the common rendering engine of all three is
heavily reliant on using JS behind the scenes.
--
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.LensEscapes.com/ Images that escape the mundane
|
| |
|
| |
 |
Mickey Segal

|
Posted: 2005-6-6 9:17:00 |
Top |
java-programmer >> showdocument() problem (or bug?)
"Roland" <email***@***.com> wrote in message
news:42a3580a$0$44696$email***@***.com...
> When you're using Firefox, open the Javascript console (menu Tools ->
> JavaScript Console). It may contain an error message
But the JavaScript console does not contain output from non-error
System.out.println methods. Is there some way to get a Java Console in
Firefox other than using the Windows Java Control Panel to display the Java
Console icon all the time?
|
| |
|
| |
 |
maxmike

|
Posted: 2005-6-6 12:20:00 |
Top |
java-programmer >> showdocument() problem (or bug?)
Andrew Thompson wrote:
\
> Further, I managed to partially replicate the problem, as described
> by the OP and reiterated by Roland. But that leads me to further
> questions..
>
> >..applet that is supposed to generate a pdf file and
> > save it as a temporary file
>
> So you must possess a File object of this file at one stage, right? [1]
Yes.
> >..on the local machine, then display it.
> > Since display of such an animal can only happen with showDocument(URL,
> > type) I am trying to build the url using :
> > URL url = new URL("file:" + File.separator + File.separator +
> > "filename.pdf");
>
> [ I suspect 'File.separator' is wrong for this context, note that
> the separator character for URL's is '/'*, and that is the same
> across platforms. * <http://www.gbiv.com/protocols/uri/rfc/rfc3986.html> ]
Then why don't I get a malformedURLException() ?
> [1] Why are you not using URL url = tempFile.toURL(); to get the
> URL of the file? (..and does that work any better/differently?)
>
> Just how 'temporary' is this temp file to which you wrote the PDF?
> If it is closed & all references discarded, it may have been GC'd
> by the VM and deleted by the VM/OS.
I wanted to overwrite the "temp" file (always at the same location) so
the user can just look at the doc and then decide if she wants to save
it.
> Andrew Thompson
> http://www.PhySci.org/codes/ Web & IT Help
> http://www.PhySci.org/ Open-source software suite
> http://www.1point1C.org/ Science & Technology
> http://www.LensEscapes.com/ Images that escape the mundane
|
| |
|
| |
 |
Roland

|
Posted: 2005-6-6 17:13:00 |
Top |
java-programmer >> showdocument() problem (or bug?)
On 6-6-2005 0:30, maxmike wrote:
>
> Roland wrote:
>
>
>>When you're using Firefox, open the Javascript console (menu Tools ->
>>JavaScript Console). It may contain an error message like
>> Security Error: Content at http://yourserver/path/to/YourApplet.html
>> may not load or link to file:///C:/path/to/your.PDF.
>>
>>AFAIK, Netscape also has a Javascript console, but for IE I'm don't know
>>to display this kind of messages.
>
>
> Roland,
>
> Thanks for this hint - didn't realize there was such a console. I was
> relying on the Java console to report errors.
> The big thing I forgot to mention is that I can read and write files
> from/to the local file system with this applet while connected to the
> server IFF I use the file open/saveas dialog. Just can't seem to do it
> with showDocument().
>
> Mike.
>
By using showDocument(URL), Java hands the display of the URL over to
the browser. The URL leaves the Java security sandbox (with its
restrictions, lifted if you've signed the applet), and enters the
browser's security system. Then it's entirely up to the browser to
determine if it is safe to display it.
I'm not sure, but in IE the Security Zones may affect this (Tools ->
Internet Options -> Security).
In Firefox/Mozilla/Netscape displaying a local filesystem file (a
file://-URL) by a remote server (a http://-URL) is not allowed by
default. FF/Moz/NS have configurable security policies but there's no UI
interface for configuring them (there is an extension, though). I'm not
sure either if it is possible to allow a site accessing a local
filesystem file.
--
Regards,
Roland de Ruiter
___ ___
/__/ w_/ /__/
/ \ /_/ / \
|
| |
|
| |
 |
Roland

|
Posted: 2005-6-6 17:32:00 |
Top |
java-programmer >> showdocument() problem (or bug?)
On 6-6-2005 3:17, Mickey Segal wrote:
> "Roland" <email***@***.com> wrote in message
> news:42a3580a$0$44696$email***@***.com...
>
>>When you're using Firefox, open the Javascript console (menu Tools ->
>>JavaScript Console). It may contain an error message
>
>
> But the JavaScript console does not contain output from non-error
> System.out.println methods. Is there some way to get a Java Console in
> Firefox other than using the Windows Java Control Panel to display the Java
> Console icon all the time?
>
>
Firefox's Javascript console only displays messages from the browser,
not Java's exceptions or System.out/System.err messages. These are shown
in Java's own console.
There's an extension "Open Java Console" that allows to open the Java
console by a toolbar button, from the Tools menu or by Ctrl+Shift+J.
<http://www.extensionsmirror.nl/index.php?showtopic=317>
[To get the toolbar button, you have to customize your toolbar (View ->
Toolbars -> Customize) and drag the button to your toolbar.]
--
Regards,
Roland de Ruiter
___ ___
/__/ w_/ /__/
/ \ /_/ / \
|
| |
|
| |
 |
Andrew Thompson

|
Posted: 2005-6-6 21:05:00 |
Top |
java-programmer >> showdocument() problem (or bug?)
On 2 Jun 2005 13:42:31 -0700, maxmike wrote:
> I have a trusted applet that is supposed to generate a pdf file and
> save it as a temporary file on the local machine, then display it.
> Since display of such an animal can only happen with showDocument(URL,
> type) ..
Since your applet is trusted, you might invoke a tool
such as BrowserLauncher* to display the PDF file.
* BrowserLauncher determines the default browser and
launches it pointing to any URL you specify.
--
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.LensEscapes.com/ Images that escape the mundane
|
| |
|
| |
 |
maxmike

|
Posted: 2005-6-6 23:03:00 |
Top |
java-programmer >> showdocument() problem (or bug?)
Andrew Thompson wrote:
> On 2 Jun 2005 13:42:31 -0700, maxmike wrote:
>
> > I have a trusted applet that is supposed to generate a pdf file and
> > save it as a temporary file on the local machine, then display it.
> > Since display of such an animal can only happen with showDocument(URL,
> > type) ..
>
> Since your applet is trusted, you might invoke a tool
> such as BrowserLauncher* to display the PDF file.
>
> * BrowserLauncher determines the default browser and
> launches it pointing to any URL you specify.
>
Thanks, Andrew - might give that a try even though people are
complaining about problems with it in some OS's like Win2K.
In my mind - the bottom line on this story is that the browsers seem to
have taken it upon themselves to block local file system acces to
trusted server applets. In other words, they are unaware of the
applet's level of trust. I suppose too much caution is better than
none, but it's a dumb situation that should be fixed.
|
| |
|
| |
 |
Andrew Thompson

|
Posted: 2005-6-6 23:40:00 |
Top |
java-programmer >> showdocument() problem (or bug?)
On 6 Jun 2005 08:03:27 -0700, maxmike wrote:
(browser change page)
> ..In other words, they are unaware of the
> applet's level of trust.
It is more likely they are beyond caring.
>..I suppose too much caution is better than
> none, but it's a dumb situation that should be fixed.
It won't. Not unless there is a paradigm shift in the thinking
of the browser makers. Browser makers are much more concerned
with ensuring that 'pop-up' windows never happen than that page
changes can be effected by 'some plug-in', trusted or not.
Personally, I cannot blame them, though it is frustrating
when you are delivering (attempting to deliver) content
the user specifically wants.
--
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.LensEscapes.com/ Images that escape the mundane
|
| |
|
| |
 |
| |
 |
Index ‹ java-programmer |
- Next
- 1
- Authentication in different tiersHi
How can I access authentication information in different tiers of a
project? We are working on a multi tier J2EE project, and we want to
authenticate user (we are not sure whether using JAAS or not). Is
there any simple way to have access to authentication information in
all tiers including Service Facade, Business Doman, and Data Access
tiers?
If it was just a web tier we could save authentication information in
user session, but it is not good to couple business tier, data access
tier and ... to web specification (including HttpSession).
A solution is passing authentication object using method parameters
but it is not a very good, solution, and all the inter-tier method
calls should contain authentication information.
Note: we are working on a multi-tier and potentialy distributed
project, so I think attaching authentication info to Thread is not a
good solution.
Amir Pashazadeh
- 2
- Clipped image when g.drawImage(img, -3, -4, this)Hello,
I've created a class (full source code at the bottom)
which extends java.awt.Component and is supposed to
represent a playing card. If the card is being dragged,
I'd like to draw a shadow underneath it. And the card
itself should be drawn a little bit displaced - to make
the impression that it has been lifted:
public void paint(Graphics g) {
if (this == dragged) {
g.drawImage(shadow, 0, 0, this);
g.drawImage(cardImg, -3, -4, this);
} else {
g.drawImage(cardImg, 0, 0, this);
}
}
My problem is however that the cardImg is being
clipped. Does anybody please have an idea how
to workaround this?
Thank you
Alex
PS: Here is the full source code:
// $Id: Card.java,v 1.2 2007/07/18 10:10:33 afarber Exp $
import java.awt.*;
import java.awt.image.*;
import java.awt.event.*;
class Card extends Component implements MouseListener,
MouseMotionListener
{
public static final int WIDTH = 70;
public static final int HEIGHT = 100;
public static final int SPADE = 0;
public static final int CLUB = 1;
public static final int DIAMOND = 2;
public static final int HEART = 3;
public static final int NOTRUMP = 4;
private static Card dragged;
private static Image[][] faces;
private static Image back;
private static Image shadow;
public byte rank, suit;
public boolean opened;
public int whose;
public Card(int rank, int suit) {
setSize(WIDTH, HEIGHT);
addMouseListener(this);
addMouseMotionListener(this);
this.rank = (byte) rank;
this.suit = (byte) suit;
}
public Card(char ch) {
setSize(WIDTH, HEIGHT);
addMouseListener(this);
addMouseMotionListener(this);
rank = (byte) (ch >> 8);
suit = (byte) ch;
}
public boolean equals(Card card) {
return (rank == card.rank && suit == card.suit);
}
public char toChar() {
return (char) ((rank << 8) | suit);
}
public void paint(Graphics g) {
if (this == dragged) {
g.drawImage(shadow, 0, 0, this);
// XXX the image below is clipped :-(
g.drawImage(opened ? faces[rank][suit] : back,
-3, -4, this);
} else {
g.drawImage(opened ? faces[rank][suit] : back,
0, 0, this);
}
}
public static void prepImages(Image big) {
ImageProducer source = big.getSource();
// create 32 card images
faces = new Image[8][4];
for (int rank = 0; rank < 8; rank++)
for (int suit = SPADE; suit <= HEART; suit++) {
ImageFilter filter =
new CropImageFilter(rank * WIDTH,
suit * HEIGHT, WIDTH, HEIGHT);
ImageProducer producer = new
FilteredImageSource(source, filter);
faces[rank][suit] = Toolkit.getDefaultToolkit()
.createImage(producer);
}
// create the image of a card's back
ImageFilter filter =
new CropImageFilter(560, 0, WIDTH, HEIGHT);
ImageProducer producer =
new FilteredImageSource(source, filter);
back = Toolkit.getDefaultToolkit().createImage(producer);
// use a card shape to create shadow
int[] pixels = new int[WIDTH * HEIGHT];
PixelGrabber grabber = new PixelGrabber(big, 0, 0,
WIDTH, HEIGHT, pixels, 0, WIDTH);
try {
grabber.grabPixels();
} catch (InterruptedException ex) {
ex.printStackTrace();
}
// turn non-transparent pixels to shadow
for (int i = 0; i < pixels.length; i++)
if (0 != (pixels[i] & 0xFF000000))
pixels[i] = 0x60000000;
shadow = Toolkit.getDefaultToolkit().createImage(
new MemoryImageSource(WIDTH, HEIGHT, pixels, 0, WIDTH));
}
public void mouseExited(MouseEvent event) {
System.out.println("mouseExited:" + event);
dragged = null;
getParent().repaint();
}
public void mouseReleased(MouseEvent event) {
System.out.println("mouseReleased" + event);
dragged = null;
getParent().repaint();
}
public void mousePressed(MouseEvent event) {
System.out.println("mousePressed" + event);
dragged = this;
getParent().repaint();
}
public void mouseEntered(MouseEvent event) {
System.out.println("mouseEntered" + event);
}
public void mouseClicked(MouseEvent event) {
System.out.println("mouseClicked" + event);
}
public void mouseMoved(MouseEvent event) {
System.out.println("mouseMoved" + event);
}
public void mouseDragged(MouseEvent event) {
System.out.println("mouseDragged" + event);
}
public static int randomRank() {
return (int) Math.floor(8.0 * Math.random());
}
public static int randomSuit() {
return (int) Math.floor(4.0 * Math.random());
}
public static void main(String args[]) {
Frame frame = new Frame("Card Test");
frame.setForeground(Color.white);
frame.setBackground(Color.gray);
frame.setLayout(null);
final String PATH = "media/cards.gif";
Image big = Toolkit.getDefaultToolkit().getImage(PATH);
MediaTracker tracker = new MediaTracker(frame);
tracker.addImage(big, 0);
try {
tracker.waitForAll();
} catch (Exception ex) {
ex.printStackTrace();
}
if (tracker.isErrorAny()) {
System.err.println("Image " + PATH + " not found");
return;
}
Card.prepImages(big);
Card card = new Card(randomRank(), randomSuit());
card.opened = true;
frame.add(card);
frame.validate();
card.setLocation(200, 100);
frame.setSize(400, 300);
frame.setVisible(true);
}
}
- 3
- MIDP JVM for Palm and Pocket PCStephan Erlank wrote:
> I've heard of J9 that comes with Visual Age Micro Edition, but I don't have
> time to download 122mb over a 56k dial-up connection.
VAME is discontinued and has been replaced by WebSphere Studio Device
Developer.
http://www-3.ibm.com/software/wireless/wsdd/
But maybe that's what you meant.
--
Josef Garvi
"Reversing desertification through drought tolerant trees"
http://www.eden-foundation.org/
new income - better environment - more food - less poverty
- 4
- Socket latenciesHi all,
I am working on a Java project and I am interested in measuring TCP
performance over long delay links. Do you know if there is any way to
simulate delay using Sockets, keeping the TCP protocol behaviour
intact? I wrote a FilterInputStream that waits for some time and then
reads from the stream, but I am afraid it could be not very accurate.
Thank you.
Daniela B
- 5
- java.io.Exception: Too many open files on sun OS 5.6I'm operating on sun OS 5.6
I ping a host every 10 seconds to get knowlegde wheather it is running
or not. After about one and a half hour I get this Exception:
java.io.IOException: Too many open files
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.<init>(UNIXProcess.java:54)
at java.lang.Runtime.execInternal(Native Method)
at java.lang.Runtime.exec(Runtime.java:546)
at java.lang.Runtime.exec(Runtime.java:413)
at java.lang.Runtime.exec(Runtime.java:356)
at java.lang.Runtime.exec(Runtime.java:320)
at de.optimare.VRX8100.MainControl.pingRecorder(MainControl.java:226)
... and so on.
I set rlim_fd_max = 1024 in /etc/system
I tried to set the ulimit -n 1024 in my script
but it had no effect.
Here is my code: The pingRecorder is called every 10 seconds from a
swing.Timer.
runtime is the Runtime.getRuntime().
// used on unix system
private void pingRecorder() {
logDate = new Date();
try {
ping = runtime.exec(pingPath);
ping.waitFor();
exitValue = ping.exitValue();
switch (exitValue) {
case 0:
// stop the ping timer
if (pingTimer != null) {
pingTimer.stop();
}
if (! processIsInitialized) {
System.out.println(logDate.toString() + " Recorder alive. Now
wait " + initialWaitTime/1000 + " seconds to initialize");
//wait for recorder is booting
Thread.sleep(initialWaitTime);
// now init the VRX8100 process!
initProcess();
}
break;
case 1:
System.out.println(logDate.toString() + " Recorder off.
Memory: " + runtime.totalMemory());
break;
default:
System.out.println(logDate.toString() + " Recorder off.
Memory: " + runtime.totalMemory());
break;
}
} catch (IOException io) {
io.printStackTrace();
} catch (InterruptedException ie) {
ie.printStackTrace();
}
}
I would be very happy if anyone knows about anything due to this
problem.
Is it a specific sun problem? Is it possible to control the number of
open files by Java?
Many thanks for any help
Gert
- 6
- Non-text based source code. I don't have much to add above what's said at the blog entry, so I'll
just link to it:
http://www.realityinteractive.com/rgrzywinski/archives/cat_ideas.html
It's not a particularly novel idea (Roedy has mentioned it often in this
newsgroup, for example; calls it "SCID" I believe), but it's interesting
because (assuming those screenshots weren't doctored), it looks like we'll
be seeing IDEs with practical support for non-text based source code in the
near future (on the order of single-digit years?)
- Oliver
- 7
- pattern matching help on logical ORI'm using Java 1.4.2_05 and need some help getting a logical OR to work
within my pattern matcher.
I'm trying to get both string A and B to be recognized by one pattern?
String strA = "04/14:03,blahblahblah\u007F";
String strB = "04/14:03,blahblahblah";
So I'm trying to match:
Two numerals followed by slash followed by 2 numerals followed by a
colon followed by 2 numerals followed by a comma followed by anything
followed by a one or 0 delete character OR the end of the line/string.
Here is the regex:
Pattern.compile("[0-9]{2}[\u002F][0-9]{2}[\u003A][0-9]{2}[\u002C].+[\u007F?]|[$]",
Pattern.DOTALL);
The logical OR doesn't work though. And I've tried the OR a few other
ways as well.
... [\u007F|$]
... [\u007F?|$]
... [\u007f]?|[$]
These don't work either.
I'd appreciate any suggestions.
Thanks,
Shawna
- 8
- Problems with Java Server Faces in JRun4 (and Tomcat)Hi!
I have downloaded Java Server Faces (jsf-1_0.zip) to have a look at
them. First I tried to install them in my JRun4 server, which supports
J2EE 1.3. When starting the server after that I get the following
Exception (and I can't run the JSF application):
"04/23 18:26:57 error Could not pre-load servlet: JSPServlet
[2]jrun.jsp.compiler.JRunTagLibraryInfo$InvalidTLDElementException:
The tag function on line 14 is not a valid TLD element
at
jrun.jsp.compiler.JRunTagLibraryInfo$TLDParser.startElement(JRunTagLibraryInfo.java:627)
at
jrunx.util.SAXReflectionHandler.startElement(SAXReflectionHandler.java:24)
at
org.xml.sax.helpers.XMLReaderAdapter.startElement(XMLReaderAdapter.java:333)"
Then I tried to install them in the Tomcat 4.0.6 server embedded in
Netbeans 3.5.1. I guess it also follows the J2EE 1.3 specification but
without the EJB:s. There when i start the server I get the message:
"Apache Tomcat/4.0.6
PARSE error at line 6 column 19
org.xml.sax.SAXParseException: Element type 'taglib' must be
declared."
I can however run the faces application in Tomcat. The only problem is
when I run the 'jsf-components' demonstration and try to 'view jsp' or
'view source' with ShowSource.jsp. Then I get a compile-error:
"org.apache.jasper.JasperException: This absolute uri
(http://java.sun.com/jstl/core) cannot be resolved in either web.xml
or the jar files deployed with this application"
I've also tried with java.sun.com/jsp/jstl/core, which it says in the
JSTL-documentation, but the same result. It seems that the
JSTL-taglibraries referenced are not found or the server doesn't
support external URI:s. I saw in the documentation that JSF is tested
with J2SE 1.3.1_04 and later (I have 1.4.2_01), but does it need J2EE
1.4 as well? I don't have J2EE 1.4 yet, so must I download another
server as well?
/Erik D
- 9
- decoding utf8I've got a J2ME application that is doing a writeUTF() of a byte array
that I need to decode and store in a flat file (it's a jpeg) from my
perl socket application. I can't seem to find a way to have Perl
decode it into it's byte representation.
As a test I put a byte array of just control-A's on the wire using
writeUTF. The length of the scalar I get in Perl is exactly twice (128)
as I sent (64). I've tried doing: $decoded =
Encode::decode_utf8($netbuf) and it doesn't convert the data at all.
Obviously, I must be missing how Perl handles a scalar that contains
UTF-8 data.
Can someone point me in a direction? Thanks.
- 10
- Function for removing Accents?On Wed, 17 May 2006 11:52:25 +0200, I waved a wand and this message
magically appeared from Domagoj Klepac:
> Because internationalization was always expensive, and the IT industry
> was based in the Western countries, and it had no incentive to adapt
> to the new, small markets. For example, I would guess that there is no
> Esperanto Windows version. Or Esperanto Office. Not enough people
> would buy it. And if even mighty Microsoft can't afford to do it,
> other software vendors certainly can't.
Microsoft can afford to. They just aren't interested.
--
http://www.munted.org.uk
Take a nap, it saves lives.
- 11
- 12
- 13
- source compilation problem.when I try to compile a file called check.java which uses file.jar like this
c:\javac -classpath .;file.jar check.java
on PC using MS Windows XP it gives me the following crap:
An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : EXCEPTION_ACCESS_VIOLATION occurred at PC=0x6D32797D
Function=ZIP_Open+0x369
Library=h:\jdk\jre\bin\zip.dll
Current Java thread:
at java.util.zip.ZipFile.getNextEntry(Native Method)
at java.util.zip.ZipFile.access$400(ZipFile.java:26)
at java.util.zip.ZipFile$2.nextElement(ZipFile.java:301)
at com.sun.tools.javac.v8.code.ClassReader.openArchive(ClassReader.java:
972)
at com.sun.tools.javac.v8.code.ClassReader.list(ClassReader.java:1199)
at com.sun.tools.javac.v8.code.ClassReader.listAll(ClassReader.java:1320
)
at com.sun.tools.javac.v8.code.ClassReader.fillIn(ClassReader.java:1340)
at com.sun.tools.javac.v8.code.ClassReader.complete(ClassReader.java:104
9)
at com.sun.tools.javac.v8.code.Symbol.complete(Symbol.java:332)
at com.sun.tools.javac.v8.comp.Enter.visitTopLevel(Enter.java:467)
at com.sun.tools.javac.v8.tree.Tree$TopLevel.accept(Tree.java:390)
at com.sun.tools.javac.v8.comp.Enter.classEnter(Enter.java:442)
at com.sun.tools.javac.v8.comp.Enter.classEnter(Enter.java:456)
at com.sun.tools.javac.v8.comp.Enter.complete(Enter.java:588)
at com.sun.tools.javac.v8.comp.Enter.main(Enter.java:574)
at com.sun.tools.javac.v8.JavaCompiler.compile(JavaCompiler.java:334)
at com.sun.tools.javac.v8.Main.compile(Main.java:520)
at com.sun.tools.javac.Main.compile(Main.java:36)
at com.sun.tools.javac.Main.main(Main.java:27)
Dynamic libraries:
0x00400000 - 0x00407000 h:\jdk\bin\javac.exe
0x77F50000 - 0x77FF6000 C:\WINDOWS\System32\ntdll.dll
0x77E60000 - 0x77F45000 C:\WINDOWS\system32\kernel32.dll
0x77DD0000 - 0x77E5B000 C:\WINDOWS\system32\ADVAPI32.dll
0x78000000 - 0x7806F000 C:\WINDOWS\system32\RPCRT4.dll
0x77C10000 - 0x77C63000 C:\WINDOWS\system32\MSVCRT.dll
0x6D330000 - 0x6D45A000 h:\jdk\jre\bin\client\jvm.dll
0x77D40000 - 0x77DC6000 C:\WINDOWS\system32\USER32.dll
0x77C70000 - 0x77CAE000 C:\WINDOWS\system32\GDI32.dll
0x76B40000 - 0x76B6C000 C:\WINDOWS\System32\WINMM.dll
0x629C0000 - 0x629C8000 C:\WINDOWS\System32\LPK.DLL
0x72FA0000 - 0x72FFA000 C:\WINDOWS\System32\USP10.dll
0x5CD70000 - 0x5CD77000 C:\WINDOWS\System32\serwvdrv.dll
0x5B0A0000 - 0x5B0A7000 C:\WINDOWS\System32\umdmxfrm.dll
0x6D1D0000 - 0x6D1D7000 h:\jdk\jre\bin\hpi.dll
0x6D300000 - 0x6D30D000 h:\jdk\jre\bin\verify.dll
0x6D210000 - 0x6D229000 h:\jdk\jre\bin\java.dll
0x6D320000 - 0x6D32D000 h:\jdk\jre\bin\zip.dll
0x76C90000 - 0x76CB2000 C:\WINDOWS\system32\imagehlp.dll
0x6D510000 - 0x6D58C000 C:\WINDOWS\system32\DBGHELP.dll
0x77C00000 - 0x77C07000 C:\WINDOWS\system32\VERSION.dll
0x76BF0000 - 0x76BFB000 C:\WINDOWS\System32\PSAPI.DLL
Local Time = Tue Aug 03 02:35:56 2004
Elapsed Time = 2
#
# The exception above was detected in native code outside the VM
#
# Java VM: Java HotSpot(TM) Client VM (1.4.1_01-b01 mixed mode)
#
# An error report file has been saved as hs_err_pid2592.log.
# Please refer to the file for further information.
#
what should I do to compile this code.
- 14
- CLOB.createTemporary throws ClassCastException...I am also having the same problem. Does anyone have a solution? I read
that the workaround is to somehow extract the underlying connection to
give to the createTemporary method. Problem is I'm not sure how to do
that!
bartleby <email***@***.com> wrote in message news:<email***@***.com>...
> I got the same probleme, have you fond out how to solve the problem ?
- 15
- xmlencoder/decoder persistence delegateHi,
I am using the xmlencoder/decoder classes to save objects, some of
which do not have no-argument constructors. I understand that one could
use something like:
String[] prop = {"param1", "param2"};
MyEncoder.setPersistenceDelegate(MyClass.class
new DefaultPersistenceDelegate(prop);
My question is, what if one has a class like:
class A{
-----
B objB = new B(C c, D d);
-----
}
class B{
-----
E objE = new E(F f, G g);
-----
}
I need to save an object of A that contains an object of B that does
not have a default constructor and B in turn needs to store an object
of E which again does not have a default constructor. Assuming that all
attributes of all classes that need to be saved do have the required
setter and getter methods, I couldn't find a way to save all those
objects because I can set the persistence delegate for only one class.
Is it possible to save all the objects?
TIA.
--Jo
|
|
|