| Memory Leakage drawing Images from Stream - Minimum example |
|
 |
Index ‹ java-programmer
|
- Previous
- 2
- java.security.NoSuchAlgorithmException: No such algorithm: RSAI have this code
import java.io.*;
import java.security.*;
import javax.crypto.*;
class Encrypt {
private Cipher RSAtransform;
public Encrypt()
{
Provider rsajca = new com.sun.rsajca.Provider();
Security.addProvider(rsajca);
try
{
RSAtransform = Cipher.getInstance("RSA",rsajca);
}
catch (NoSuchAlgorithmException e) {
e.printStackTrace();
}
catch (NoSuchPaddingException e) {
e.printStackTrace();
}
}
...
...
But when I run it on winxp (using Java 1.4.2) I get:
java.security.NoSuchAlgorithmException: No such algorithm: RSA
at javax.crypto.SunJCE_b.c(DashoA6275)
at javax.crypto.SunJCE_b.a(DashoA6275)
at javax.crypto.Cipher.a(DashoA6275)
at javax.crypto.Cipher.getInstance(DashoA6275)
at keys.Encrypt.<init>(Encrypt.java:18)
at keys.Encrypt.main(Encrypt.java:115)
java.lang.NullPointerException
at keys.Encrypt.encrypt(Encrypt.java:73)
at keys.Encrypt.main(Encrypt.java:128)
Why is it not possible to use the RSA algorithm?
I would prefer to use an asymmetric algorithm instead of DES.
Hope someone can help
JOhs
- 5
- A java network sniffer for WindowsHi everybody,
If you want to listen or publish Ethernet packet with Java, please try
Jiffer.
You can download Jiffer here : http://aroche.free.fr
If you have any suggestion or experience problem to install Jiffer
please contact.
Have fun !!
Arnaud ROCHE
- 6
- Anyone using Studio 4 with MSAccess as DBMS?Is anyone using the Studio4 (Community version, Windows NT) IDE for
building forms using an MS Access database to supply a JTable via
net.beans palette components (nBCachedRowSet or nJcdbRowSet)? (Using
the JDBC-ODCB bridge). I can succesfully connect and initialize
components--can see the tables and columns in the Runtime explorer
connection--but when I execute the form, all columns are blank.
Also, when GUI editing, if I try to set the TableModel using the
TableEditor tab and select the nBCachedRowSet component, I get the
following error: "Unable to fetch columns; SQL-server rejected
establishment of SQL-connection. PointBase." Why is it still looking
at Pointbase?
Here's how components are set:
connectionSource1
Database URL = jdbc:odbc:IM_EDITOR (this works with MSQuery, so ODBC
is good)
Driver = sun.jdbc.odbc.JdbcOdbcDriver (ok here)
nBCachedRowSet1
command = select * from IM (this also works in MSQuery)
Database URL = jdbc:odbc:IM_EDITOR
jTable1
selection Model = nBCachedRowSet1
Need more code?
I give up! I really want to use Access for the DBM due to other
issues, but I am running out of patience!
TIA
Frustrated...
Mark
- 6
- [eclipse] export with referenced librariesHello,
I am trying to export a project in jar format so that I can run it on
different machines. . I got a NoClassDefFoundError exception because
it requires referenced libraries (in this case, it is the MINA). Would
anyone please tell me how to export with referenced libraries?
Thanks
-k
- 6
- Returning value from deep recursionI have the following code
***********************************
/**
* Recurses through schema finding the first instance of the
element name
* @param schemaElement - current element being compared from
schema
* @param checkElement - element to be checked against i.e. the
node selected in the gui
* @return the element in schema which matches the checkElement
*/
private Element findElementNameMatch(Element schemaElement, Element
checkElement)
{
// Get list of children
List listOfChildren = schemaElement.getChildren();
// If element has children
if(listOfChildren.size() != 0)
{
// Recurse through all elements under this one
for(int x=0; x < listOfChildren.size(); x++)
{
// Get child element
Element childElement = (Element) listOfChildren.get(x);
if(childElement.getName() == checkElement.getName())
{
return(childElement);
}
findElementNameMatch(childElement,checkElement);
}
}
return(null);
}
***********************************
The method is trying to find an element in an xml document that matches
a given name.
Can anyone give me tips on how to go about returning a value from deep
recursion to the first recursion of that particular method, so it can
return that value to the method that called it.
And also quite importantly how to stop any recursions after a match has
been found. EG a target element is found and returned, but how can i
stop the recursion going on to check elements under this element.
So far i have only achieved the two by creating a global variable and
flag, the variable is initialised when the match is found, and flag is
set to true so no more recursions are done afterwards.
- 6
- Resize JSplitPane ContanierHi all,
I want to resize the container which holds JSplitPane. The situation
is with right button pressed the container should be resized to the
size of left component of JSplitpane and with left button pressed
container should be expanded to the size of left component +
Jsplitpane + right component, unlike the default behaviour of
JSplitpane. How can i acheive this?
Thanks in advance.
Naveen.
- 6
- a simple java timerJust wondering, has anyone here ever used java.swing.timer if so, have you
got any examples? i cant seem to find many on google :s
- 9
- java.lang.NullPointerException at com.sun.kvem.midp.MIDP.run(MIDP.java:651)Hi Friends,
Does any one has any idea about the following StackTrace. I am using
CLDC1.1 and MIDP2.0 with Sun Java Studio Mobility. Any help will be
highly appreciated.
java.lang.NullPointerException
at com.sun.kvem.midp.MIDP.run(MIDP.java:651)
at
com.sun.kvem.environment.EmulatorInvoker.runEmulatorImpl(EmulatorInvoker.java:116)
at
com.sun.kvem.environment.EmulatorInvoker.runEmulatorSameVM(EmulatorInvoker.java:105)
at
com.sun.kvem.environment.EmulatorInvoker.runEmulator(EmulatorInvoker.java:63)
at com.sun.kvem.environment.ProfileEnvironment$KVMThread.runEmulator
(ProfileEnvironment.java:240)
at
com.sun.kvem.environment.ProfileEnvironment$KVMThread.run(ProfileEnvironment.java:262)
Greetings,
- 9
- Binary search Tree:HelpIs this implementation of a binary search tree correct ?
numbers from 0 to 14 arranged in a binary tree (binary search tree). Is
this correct ? (left node is less, right node is greater than the
current node)
7
6 8
5 9 2 12
4 10 3 11 1 13 0 14
- 10
- Reflection with Java and Oracle 10gHi everyone,
We have change oracle 8i to oracle 10g, now we have problems with the
reflection in JAVA.
I've got an IllegalAccessException:
Object value;
value = infoResultSetAndData.getResultSetMethodGet().invoke(rs, new
Object[] {new Integer(infoResultSetAndData.getResultSetIndice())});
thanks for suggestions,
fourmi
- 12
- simple STRUTS appi want to realize a simple struts app for creation of polls, can you
help me with ideas or examples?
a very very simple app but with "area" containers...and a simple
graphical representetion of the results...
tnx
- 12
- question about compiling java with textpadHow do i set a classpath in the javac? its not paying attention to the
classpath I have set at the environment level. This is windows 2000.
I go to configure->preferences->tools->compile java
I see $file in the parameters. Not able to do this:
-classpath <path> $file
and i get the standard javac error where it lists the options.
- 12
- Back To College Is Here!Big, Big Savings!
College '07. Live. Study. Save. Back To College is one of our largest
campaigns of the year! Help our customers find the essentials they
need for college living at unbeatable prices.
Most See!
Click: http://ashopper.net
Donot miss out!
- 14
- servlet and threadi am connecting to a servlet. i am passing some values from JSP to
servlet. the servlet gets those values from JSP by
request.getParameter(). then the servlet creates Threads as much as
values gives to it.
if the servlet is given 3 values from the JSP, then it would create 3
threads to calculate.
if the servlet is given 10 values from the JSP, then it would create 10
threads to calculate.
each Thread would return results to the JSP.
PROBLEM :
=========
how does my JSP would get the results from the threads. JSP would
refresh in 5 secs interval and would display the latest threads result.
- 16
- McDonalds/RoundTable, design&farm (was: I'm still waiting for ...)> From: email***@***.com (Michael Sullivan)
> ... instead of looking for exactly and precisely the kind of work
> that you have done in the distant past, ...
You're displaying a serious misconception. I'm available for any legal
work where I'd be doing something actually useful so that it would be
worth paying me to do it. It's the employers who refuse to even
consider people who haven't done exactly the same kind of work before.
> Go work at McDonalds
I tried that, when I had less than one year work experience. The
manager at the McDonalds on El Monte near El Camino Real told me that
because I have a college degree he won't consider me for employment
because he'd waste two months training me and then I'd find a better
job elsewhere and he'd be out the expense of training. Later that year
I got a job at Round Table Pizza on University in Palo Alto, where a
ditzy redhead Mrs. Masinter wasn't watching where she was going and
collided with my car and then freaked out seeing the car parts strewn
on the pavement, apologizing, exchanging insurance info, then she drove
off before giving me a chance to inspect the damage and see that all
the damage was to *her* car, not mine. Anyway, Round Table fired me
because I suffer a learning disability, unable to memorize the prices
on the menu. A year or two later I was sitting at a terminal at the
A.I. lab doing my usual work for free, and occasionally running FINGER
to see who else was around, when I saw Larry Masinter logged in, so I
wwnt over and asked if he was in any way related to that ditzy driver,
and indeed that was his former wife. He showed me Lisp for the first
time, impressed me, and after Hans Moravec explained the REP loop to me
I was forever going strong with Lisp.
> or a factory
That's not a good idea. I have very poor muscle coordination, can't
write legibly, can't do sports at all, take ten times as long as anyone
else to do a simple mechanical task in metal/wood shop in school and
still the result is cruddy, need extra space on both sides of car when
I'm driving because I can't judge distance between car and parket cars,
break almost anything physical I try to work on, did I tell you about
the disaster when I tried to do work on my car (tune-up, and lubricate
the air-duct wire-in-sleeve control cables)?
> a lot more brainpower goes into defining the problems that explicitly
> than into the actual coding,
Much of my work at Stanford was like that. Unfortunately there's no way
to express that with buzzwords on a resume, so you're not aware of that
from reading my resumes.
> and once you've done that part -- Indians and Chinese can and will
I'd be glad to design the software, farm it out to I&C, then check what
comes back to make sure it does the job that was required. Do you know
any such software-design jobs available now? I've never seen any such
jobs advertised anywhere, ever in all the years since I started
programming.
|
| Author |
Message |
E. Naubauer

|
Posted: 2006-2-22 23:54:00 |
Top |
java-programmer, Memory Leakage drawing Images from Stream - Minimum example
Ok folks
I posted this a number of times ago,but never posted a minimum code
example for people to look at.
I was trying to load and draw images from a Mjpeg-Stream, reading from
the stream in a different thread.
This is the thread where the images are read by:
public class Axis2420
{
private HttpURLConnection hurlconnection = null;
private DataInputStream datainstream = null;
private String serialNumber = null;
private boolean connected = false;
private Frame dummy = null;
private Image image = null;
private String MJpegStreamUrl = null;
Runnable decodingThread = null;
public void SetURL(String url)
{
MJpegStreamUrl = url;
}
public boolean Connect()
{
if(MJpegStreamUrl == null)
{
System.out.println("Error: Empty Camera URL String");
return false;
}
try
{
URL streamurl = new URL(MJpegStreamUrl);
hurlconnection = (HttpURLConnection)streamurl.openConnection();
hurlconnection.setReadTimeout(10000);
//hurlconnection.setUseCaches(false);
InputStream instream = hurlconnection.getInputStream();
connected = true;
BufferedInputStream bis = new BufferedInputStream(instream);
datainstream = new DataInputStream(bis);
} catch(IOException e)
{
System.out.println("Fehler");
try
{
hurlconnection.disconnect();
Thread.sleep(60);
}
catch(InterruptedException ie)
{
hurlconnection.disconnect();
Connect();
}
catch(Exception ex)
{return false; }
System.out.println(e.getMessage());
return false;
}
return true;
}
//run method of the reading thread
public void run()
{
//test if still connected
if(!connected)
return;
try
{
//decode stream
if(connected)
{
Image i = null;
//ImageIO.setUseCache(false);
long before,after;
while(!Thread.currentThread().isInterrupted())
{
i = null;
String header;
int k = 0;
do
{
header = datainstream.readLine();
//System.out.println("Zeile: " +header);
}
while(++k < 3);
int j = (new Integer(header.substring("Content-Length:
".length()))).intValue();
datainstream.readByte();
datainstream.readByte();
// datainstream.readLine();
imageJPG = new byte[j];
datainstream.readFully(imageJPG, 0, j);
byte tail[] = new byte[4];
datainstream.readFully(tail,0,4);
i =
Toolkit.getDefaultToolkit().createImage(imageJPG,0,imageJPG.length);
image = i;
i = null;
fireChange(); //calls the stateChanged() method in
the class 'MainProgram' below
image = null;
i = null;
Thread.currentThread().sleep(10);
}
}
}
catch(Exception ex)
{
ex.printStackTrace();
}
finally
{
try {
datainstream.close();
} catch(Exception ex)
{
ex.printStackTrace();
}
}
}
//for the listening objects so they can fetch the latest image
public Image getLatestImage()
{
return image;
}
<....>
}
Once a new image has arrived, the fireChange() method calls this method
on the MainProgram class:
class MainProgram
extends JFrame
implements Runnable,ChangeListener
{
public static String WINDOW_TITLE = "BINO GESTENERKENNUNG";
public static int WINDOW_WIDTH = 640;
public static int WINDOW_HEIGHT = 480;
public static final int CAMERA_LEFT = 0;
public static final int CAMERA_RIGHT = 1;
//public static final String leftCameraURL =
"http://192.168.1.51/axis-cgi/mjpg/video.cgi?resolution=704x576&compression=25&clock=0&date=1&fps=10";
//public static final String rightCameraURL =
"http://192.168.1.51/axis-cgi/mjpg/video.cgi?resolution=704x576&compression=25&clock=0&date=1&fps=10";
public static final String leftCameraURL =
"http://192.168.1.51/axis-cgi/mjpg/video.cgi?resolution=352x288&compression=70&date=1&fps=5";
public static final String rightCameraURL =
"http://192.168.1.51/axis-cgi/mjpg/video.cgi?resolution=352x288&compression=100&date=1&fps=5";
Image currentLeftImage;
Image currentRightImage;
Graphics leftImageGraphics;
Graphics rightImageGraphics;
Graphics leftCameraGraphics;
Graphics rightCameraGraphics;
byte[] currentLeftImageJPG;
byte[] currentRightImageJPG;
BufferedImage testImage;
Axis2420 leftCamera = null;
Axis2420 rightCamera = null;
CameraCanvas leftCameraCanvas = null;
CameraCanvas rightCameraCanvas = null;
Runnable drawThread = null;
boolean readyToDraw = false;
boolean newImage = false;
long frameRateLeft = 0,frameRateRight = 0;
long frameTimesLeft[],frameTimesRight[];
//vPointerDetector leftImagePointer;
//vPointerDetector rightImagePointer;
vPointerDetector imagePointer;
boolean updateLeftImage,updateRightImage;
<.....lots of meaningless stuff.......>
public void stateChanged(ChangeEvent e)
{
currentRightImage = rightCamera.getLatestImage();
rightCameraCanvas.SetUpdate(true); //otherwise paintComponent()
of the JCanvas won't draw the image
rightCameraCanvas.SetImage(currentRightImage);
rightCameraCanvas.repaint();
currentRightImage = null;
currentRightImageJPG = null;
}
}
}
} //end of MainProgram class
Basically, all the stateChange method does is getting the image from the
image-reading thread ('rightCamera' of type Axis2420) after
rightCamera called fireChange(). The image is passed to an object of the
class CameraCanvas which derieves from JCanvas. After that, we cast
repaint() on the CameraCanvas (rightCameraCanvas.repaint() ).
This is the CameraCanvas that is responsible for drawing:
public class CameraCanvas extends JPanel
{
private Image image = null;
boolean drawNext = false;
boolean readyForNext;
public void paintComponent(Graphics g)
{
if(drawNext == true)
{
readyForNext =
g.drawImage(image,0,0,getSize().width,getSize().height,this);
//image.flush();
image = null;
//g.dispose();
//imageBuffered.flush();
drawNext = false;
}
}
//indicates that there is a new image
public void SetUpdate(boolean up)
{
drawNext = up;
}
//passes a new image to the Canvas
public void SetImage(Image i)
{
image = i;
}
}
The program draws the stream correctly and is smooth like butter.
However, there is a HUGE memory leak somewhere that raises the memory
usage by about 40MBytes per second. If I remove the call to
readyForNext = g.drawImage(image,0,0,getSize().width,getSize().height,this);
in the CameraCanvas thread, the leak will go down to about 40 kbyte /
second. If I leave it in and post a System.gc() call afterwards, the
leak will also go down.
I think that I'm somewhat polling the AWTEvent thread which lots of
copies of images waiting to be drawn. Also using
Toolkit.getDefaultToolkit().createImage(imageJPG,0,imageJPG.length);
spawns abouth 4 ImageFetcher threads which I think are the reason for
the small memory leak.
Now the question: What can I do about it?
It seems that the garbage collection isn't called after drawing an image
and casting it manually via System.gc() slows everything down a lot.
Using ImageIO.read)() instead of the Toolkit seems to remove the small
leak, but not the big one for drawing. And it tends to be slower since
it's blocking and keeping the Axis2420 thread from reading from the stream.
My thesis is due soon, so pleease have a look at it again.!!
Thanks in advance!!!
|
| |
|
| |
 |
Andrey Kuznetsov

|
Posted: 2006-2-23 0:21:00 |
Top |
java-programmer >> Memory Leakage drawing Images from Stream - Minimum example
> I posted this a number of times ago,but never posted a minimum code
> example for people to look at.
>
> I was trying to load and draw images from a Mjpeg-Stream, reading from
> the stream in a different thread.
I would use only _one_ image.
set MemoryImageSource animated.
Read every image to MemoryImageSource's data array and call newpixels();
--
Andrey Kuznetsov
http://uio.imagero.com Unified I/O for Java
http://reader.imagero.com Java image reader
http://jgui.imagero.com Java GUI components and utilities
|
| |
|
| |
 |
E. Naubauer

|
Posted: 2006-2-23 0:57:00 |
Top |
java-programmer >> Memory Leakage drawing Images from Stream - Minimum example
But MemoryImageSource only works with RGB pixel data and not JFIF data,
doesn't it? It would require me to convert it to pixel data first via
BufferedImage via ImageIO and thats what I'm trying to avoid. By the
way: I tried using another thread which does the decoding instead of the
Axis2420 thread with ImageIO and it leaked as well. It seems like
everything depends on the Axis2420 thread not bringing in new images too
fast. If for example I run the program with JProfiler (which drops
performance due to the whole analyzing stuff) the memory-leak doesn't
appear. It is slow, however.
|
| |
|
| |
 |
E. Naubauer

|
Posted: 2006-2-23 11:43:00 |
Top |
java-programmer >> Memory Leakage drawing Images from Stream - Minimum example
Ok, it seems that I have a semi-stable version running now with what
Andrey mentioned and frames dropping. Thanks for your help!
|
| |
|
| |
 |
Roedy Green

|
Posted: 2006-2-24 0:42:00 |
Top |
java-programmer >> Memory Leakage drawing Images from Stream - Minimum example
On Wed, 22 Feb 2006 17:56:46 +0100, "E. Naubauer"
<email***@***.com> wrote, quoted or indirectly quoted someone who
said :
>But MemoryImageSource only works with RGB pixel data and not JFIF data,
>doesn't it?
is there document that gives say a 5 page overview of what all the
Java classes for image processing are FOR perhaps with some recipes
for how you do the usual things?
It is all a blur. How do you know which classes to use for what sorts
of problem? How do you know when you glue them together there is not
some much cleaner way?
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
|
| |
|
| |
 |
E. Naubauer

|
Posted: 2006-2-24 4:32:00 |
Top |
java-programmer >> Memory Leakage drawing Images from Stream - Minimum example
Roedy Green schrieb:
> On Wed, 22 Feb 2006 17:56:46 +0100, "E. Naubauer"
> <email***@***.com> wrote, quoted or indirectly quoted someone who
> said :
>
>> But MemoryImageSource only works with RGB pixel data and not JFIF data,
>> doesn't it?
>
> is there document that gives say a 5 page overview of what all the
> Java classes for image processing are FOR perhaps with some recipes
> for how you do the usual things?
>
> It is all a blur. How do you know which classes to use for what sorts
> of problem? How do you know when you glue them together there is not
> some much cleaner way?
>
>
>
Do you mean something like this?
http://java.sun.com/developer/technicalArticles/Media/imagestrategies/index.html
Although you might already know it.
Ok, let me do a short summary about my experiences of the last weeks
regarding reading images from an (Axis) network camera:
Images arrive at a framerate of ~25 frames per second, meaning every
frame has to be processed within about 40 ms to process them all.
However, the fashion in which Java deals with those is quite different
depending on the classes used under the hood, the threading strategy etc. :
- the best method if it comes only to drawing the images is decoding the
image with Toolkit.createImage and draw it using a double-buffer
strategy. The thread, that fetches and decodes the images (and casts
repaint on the drawing component) should run with the lowest priority,
or you might cause a memory leak since the images don't get garbage
collected correctly.
- ImageIO loads images synchronously and causes less memory problems,
but keeps the fetching/decoding thread busy which might drop the
framerate critically.
- images drawn with drawImage don't seem to be garbage collected
correctly if repaint() is called too often.
|
| |
|
| |
 |
Roedy Green

|
Posted: 2006-2-24 16:58:00 |
Top |
java-programmer >> Memory Leakage drawing Images from Stream - Minimum example
On Thu, 23 Feb 2006 21:31:36 +0100, "E. Naubauer"
<email***@***.com> wrote, quoted or indirectly quoted someone who
said :
>http://java.sun.com/developer/technicalArticles/Media/imagestrategies/index.html
that's great. I used that article to construct a table I call "let me
count the ways" which enumerates all the ways you can create various
Image related objects.
See http://mindprod.com/jgloss/image.html#CREATING
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
|
| |
|
| |
 |
| |
 |
Index ‹ java-programmer |
- Next
- 1
- sysdeo plugin for tomcat/eclipse gone?Hello,
does anybody still have a copy of the latest pluging of sysdeo for
tomcat/eclipse integration? The link to
http://www.sysdeo.com/eclipse/tomcatPlugin.html
does not work anymore...
And I really liked this integration.
Thanks for hints.
- 2
- model to xmlHi,
We have "Objects" that relate to each other in a parent-child
relationship. Also these objects can have references to ther objects
that is not a parent. Let me give you all an example.
I have the following parent-child relationship between objects,
Object A=1
|
-------------
| |
Object B=1 Object C=1
|
-------------
| |
Object D=1 Object D=2
Note: The number is the identity when we have more than one object of
the same type.
"Object A=1" is parent to child "Object B=1".
We have the same relationship for "Object D=1". "Object A=1" is parent
to "Object B=1" which is parent to "Object D=1". The path to "Object
D=1" is "Object A=1,Object C=1,Object D=1".
Also "Object B=1" can have a reference to "Object D=2". The
"reference"-attribute in "Object B=1" has the following path,
"Object A=1,Object C=1,Object D=2"
My question is if there is a tool where I can graphically create my
model ( see my nice one !!!) and from that generate an xml file ( or
xmi).
Requirements:
* It is important that when I create "Object B=1" it must be possible
for "Object B=1" to know that it's parent is
"Object A=1". When the hirarchy grows the child at the end should know
the whole path to itself.
* It is also important that a reference to an Object D=2 is created as
"Object A=1,Object C=1,Object D=2"
Has anyone done something similar? Any open-source tools for this? All
ideas/questions are welcome.
BR
//Mikael
- 3
- Null pointer exception while trying to repaint the component that displays a buffered image when the component is scrolled using scroll barI am trying to repaint a component that displays a buffered image when
the component is scrolled. I get the following error:
[java] java.lang.NullPointerException: NullSD does not handle
this operation
[java] at sun.java2d.NullSurfaceData.getRaster(Unknown Source)
[java] at sun.java2d.loops.OpaqueCopyAnyToArgb.Blit(Unknown
Source)
[java] at sun.java2d.loops.GraphicsPrimitive.convertFrom(Unknown
Source)
[java] at sun.java2d.loops.MaskBlit$General.MaskBlit(Unknown
Source)
[java] at sun.java2d.loops.Blit$GeneralMaskBlit.Blit(Unknown
Source)
[java] at sun.java2d.pipe.AlphaPaintPipe.renderPathTile(Unknown
Source)
[java] at sun.java2d.pipe.SpanShapeRenderer
$Composite.renderBox(Unknown Source)
[java] at sun.java2d.pipe.SpanShapeRenderer.spanClipLoop(Unknown
Source)
[java] at sun.java2d.pipe.SpanShapeRenderer.renderSpans(Unknown
Source)
[java] at sun.java2d.pipe.SpanShapeRenderer.renderPath(Unknown
Source)
[java] at sun.java2d.pipe.SpanShapeRenderer.fill(Unknown Source)
[java] at sun.java2d.pipe.ValidatePipe.fill(Unknown Source)
[java] at sun.java2d.SunGraphics2D.fill(Unknown Source)
[java] at
i3dea.ditto.DocumentImageDisplay.paintZone(DocumentImageDisplay.java:
256)
[java] at
i3dea.ditto.DocumentImageDisplay.paintComponent(DocumentImageDisplay.java:
467)
[java] at javax.swing.JComponent.paint(Unknown Source)
[java] at javax.swing.JComponent.paintChildren(Unknown Source)
[java] at javax.swing.JComponent.paint(Unknown Source)
[java] at javax.swing.JViewport.paint(Unknown Source)
[java] at javax.swing.JComponent.paintChildren(Unknown Source)
[java] at javax.swing.JComponent.paint(Unknown Source)
[java] at javax.swing.JComponent.paintWithOffscreenBuffer(Unknown
Source)
[java] at javax.swing.JComponent.paintDoubleBuffered(Unknown
Source)
[java] at javax.swing.JComponent._paintImmediately(Unknown
Source)
[java] at javax.swing.JComponent.paintImmediately(Unknown Source)
[java] at javax.swing.RepaintManager.paintDirtyRegions(Unknown
Source)
[java] at javax.swing.SystemEventQueueUtilities
$ComponentWorkRequest.run(Unknown Source)
[java] at java.awt.event.InvocationEvent.dispatch(Unknown Source)
[java] at java.awt.EventQueue.dispatchEvent(Unknown Source)
[java] at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
[java] at
java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
[java] at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
[java] at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
[java] at java.awt.EventDispatchThread.run(Unknown Source)
Thanks
Mangai
- 4
- AXIS attachment problemHi,
Currently i tried to make attachment with AXIS .
I have following error message
Exception in thread "main" AxisFault
faultCode: {http://xml.apache.org/axis/}Server.NoService
faultSubcode:
faultString: The AXIS engine could not find a target service to invoke! target
Service is null
faultActor:
faultNode:
faultDetail:
I think i could resolve my problem if i found a little attachment sample ?
Where could i found it, or a tutorial ?
Regards
Philippe
- 5
- IndexOf for whitespaceWhat if you wanted the indexOf either a space or a \n whichever came
first. Have you a slick way to code that?
Pedestrian possibilities include:
1. pair of indexOfs , take minimum ignoring <0s.
2. Write a loop that uses charAt
3. write a regex
Is there a slick way to handle it?
--
Roedy Green, Canadian Mind Products
The Java Glossary, http://mindprod.com
- 6
- Hibernate on delete cascadeI use Hibernate and I am not able to do cascade delete.
After I create a project I have:
select * from project;
uid | name | shortdescription
-----+------+-----------------
1 | nc | NC Web application
(1 row)
After I subscribe to the project I have:
select * from subscription;
uid | account | project | role
-----+---------+---------+------
1 | 1 | 1 | 1
(1 row)
When I delete the project with a simple session.delete
try {
session.delete(project);
session.flush();
} catch (HibernateException e) {...
the row is deleted in the table "project"
but the row stays in table "subscription". Only the column entry "project" is set to null.
select * from subscription;
uid | account | project | role
-----+---------+---------+------
1 | 1 | | 1
(1 row)
I want the row to be deleted, how do I do that?
My two tables one for Projects and one for Subscriptions
<hibernate-mapping>
<class name="org.cobra.persistence.Project" table="project">
<id name="id" column="uid" type="long">
<generator class="increment"/>
</id>
<property name="name">
<column name="name" sql-type="char(32)" not-null="true"/>
</property>
<property name="shortDescription">
<column name="shortDescription" sql-type="char(256)" not-null="true"/>
</property>
<set name="subscriptions" table="subscription" cascade="all-delete-orphan">
<key column="project"/>
<one-to-many class="org.cobra.persistence.Subscription"/>
</set>
<set name="subscriptionsRequested" table="subscriptionRequest" cascade="all-delete-orphan">
<key column="project"/>
<one-to-many class="org.cobra.persistence.SubscriptionRequest"/>
</set>
</class>
</hibernate-mapping>
<hibernate-mapping>
<class name="org.cobra.persistence.Subscription" table="subscription">
<id name="id" column="uid" type="long">
<generator class="increment"/>
</id>
<many-to-one name="account" column="account" cascade="all" class="org.cobra.persistence.Account" />
<many-to-one name="project" column="project" cascade="all" class="org.cobra.persistence.Project" />
<many-to-one name="role" column="role" cascade="all" class="org.cobra.persistence.Role" />
</class>
</hibernate-mapping>
- 7
- ports/81272: JDK 1.5 port doesn't build.Synopsis: JDK 1.5 port doesn't build.
Responsible-Changed-From-To: freebsd-amd64->freebsd-java
Responsible-Changed-By: arved
Responsible-Changed-When: Fri Nov 25 16:57:03 GMT 2005
Responsible-Changed-Why:
Refile, this looks like a ports issue.
Assign to port maintainers
http://www.freebsd.org/cgi/query-pr.cgi?pr=81272
- 8
- Changing Tomcat configurationHello everyone having a slight issue with the java.home variable for
tomcat. It is pointing at the JRE instead of the JDK and I have no idea
where it is set at. If anyone knows where I can change it please inform me.
Thanks,
Jerry
- 9
- 10
- Doctors Use This Too SSBfa5
"Ci-ialis Softabs" is better than Pfizer Viiagrra
and normal Ci-ialis because:
- Guaaraantees 36 hours lasting
- Safe to take, no side effects at all
- Boost and increase se-xual performance
- Haarder e-rectiions and quick recharge
- Proven and certified by experts and doctors
- only $3.99 per tabs
Cllick heree:
http://ossifies.com/cs/?ronn
o-ut of mai-lling lisst:
http://ossifies.com/rm.php?ronn
eD
--
To UNSUBSCRIBE, email to email***@***.com
with a subject of "unsubscribe". Trouble? Contact email***@***.com
- 11
- pornn piictures!
contentt!
http://thecowboyfft.com
--
To UNSUBSCRIBE, email to email***@***.com
with a subject of "unsubscribe". Trouble? Contact email***@***.com
- 12
- Is this a ZipInputStream Bug?
I just got thru tracking down what was happening, but I still don't know
WHY.
Im using ZipInput & Output Stream classes to make a compressed file
(actually it's an image). I create it via ZipOutputStream using a 1K
buffer for writing i.e.:
...
try { // Create the ZIP file
zos = new ZipOutputStream(new FileOutputStream(zipfname)); }
catch (IOException e) {
System.out.println("ZipOutputStream error on open.");
return null; }
try { zos.putNextEntry(new ZipEntry(imgfname)); }
catch (IOException e) {
System.out.println("ZipOutputStream error on put-entry.");
return null; }
...
try { zos.write(bbuf, 0, bix); }
catch(IOException e) {
System.out.println("ZipOutputStream error on write.");
error = true;
break;
}
...
Here bbuf is 1K.
All is ok - WinZip can extract it and the image is fine. Then I try to
read it back via ZipInputStream - i.e.:
...
try { zis = new ZipInputStream(new FileInputStream(filespec)); }
catch (IOException e) {
System.out.println("ZipInputStream error on open.");
return pixels; }
try { zent = zis.getNextEntry(); }
catch (IOException e) {
System.out.println("ZipInputStream error on get-entry.");
return pixels; }
...
while ( cnt > 0 ) {
try { rcnt = zis.read(bbuf, rcnt, cnt); }
catch(IOException ex) {
System.out.println("ex: " +ex.getMessage());
error = true; }
cnt -= rcnt;
}
...
Here is where the problem occurs. If bbuf is 128 or 256 bytes the image
returns just like it should. But if I increase it to 1K junk starts to
show up within the picture at 4K the picture is barely viewable because
of the junk and at 32K I get ArrayOutOfBounds exception during the read
(NOT related to my code). I've verified that the "junk" is data that did
not come out of the zip, the way it went in.
I'm running JDK 1.3.1 on an NT4.0 platform.
Have others seen this behavior ?
Any ideas on why ?
TIA
Don Sykes
- 13
- starting a weblogic servlet?Hello,
I have written a basic servlet of the form
public final class MyServlet extends HttpServlet
{
public void init(ServletConfig config) throws ServletException
{
super.init(config)
/* do other stuff */
}
}
My question is, what do I need to do so that the "init" method is
invoked upon servlet (i.e. Weblogic) startup? I'm using Weblogic 5.1
sp 12 on Sun Solaris.
Thanks for your help, - Dave
- 14
- API 1.5.0 DownloadHi all,
I am new to the Mac and am looking for a download of the
jdk 1.5.0 api. I cannot find a tarball or zip file on the
Sun site that I can download so I can use the reference when
I am offline.
Suggestions?
Thanks,
Bob
- 15
- java vs ircHi
Im at a crossroad as to how to implement a webchat. I have the option of
building a chat using a standard IRC server saving me the trouble of
implementing it myself, OR i can write the server myself in Java giving me
full customizability. I would tend to go with the latter approach however im
rather concerned about performance. By performance im thinking bandwidth and
server load. So my question is: is it possible to build a chat server in
Java that is
a) better or equal to an IRC server utilizing bandwidth, and
b) better or equal to an IRC servers server load?
Im thinking performance wise that IRC would be better, but im not sure
whether this is true so im asking if anyone can give me some input as to why
one solution would be better than the other.
Thanx
Mike
|
|
|