Jump to content
Excelsior Forums
Piotr

Problem with JAI?

Recommended Posts

Hi Guys!

I've developed an application at a customer, which I deliver as a Fat Jar.

(which is an executable jar which contains all the application files)

For security reasons, because Java can be easily decompiled, at this customer it was decided that Java applications should be transformed to a Windows executable using Jet, which works fine.

Until we discovered that a certain bug showed only in the Jet-packed (;D) executable, not in the original application. (the executable jar)

I think it's something to do with the use of the JAI package. I've read some stuff on this forum about that, but I'm not sure how to get rid of this malfunction.

From the loggings I can see that the application freezes/starts to dead-cycle when I want to display a JAI-based Jpanel called DisplayJAI, which contains a JAI created image. Some code highlights:

private RenderedOp image;
private byte[] buffer;

public JaiHandler(byte[] buffer) {
	try {
		this.buffer = buffer; 
		image = JAI.create("stream", new ByteArraySeekableStream(buffer));
	} catch (IOException e) {
		LogPanel.log(e);
	} 
}

        public JPanel getPanel(int width, int height) {
	float wf = new Float(width) / image.getWidth();
	float hf = new Float(height) / image.getHeight();
	if ((wf < 1.0f) || (hf < 1.0f)) {
		float scale = Math.min(wf, hf);
		ParameterBlock pb = new ParameterBlock();
		pb.addSource(image);
		pb.add(scale); //x scale factor
		pb.add(scale); //y scale factor
		pb.add(0.0f); //x translate
		pb.add(0.0f); //y translate
		pb.add(new InterpolationNearest()); //interpolation method
		image = JAI.create("scale", pb);
	}
	return new DisplayJAI(image);
}

JAI wil create the image, but I'm not yet sure whether the creation of the DisplayJAI never returns, or the panel gets returned but the screen rendering fails. But I am sure the application get's to the return statement of getPanel.

Again; in my original, un-Jetted application there is no problem, only in the Jet-packed version.

What could I try? Do I have a dll problem, as some other topics covering JAI problems suggest?

I've run the Jet Windows executable with the JAI dll's in the bin directory (which Jet creates, which as I saw also contains other Java specific dll's) or right next to the executable, but that's not helping.

Any suggestions?

Help would be highly appreciated! :rolleyes:

 

Share this post


Link to post
Share on other sites

Ahhh... and of course:

Java version: 1.6.0_03

Jet version: 6.0 (I'm told)

I'm not sure what OS/machine the Jet 6.0 application is running on.

Is that of significance?

Created application runs on:

OS: MS Windows XP professional version 2002 SP2

Machine: Dell Dimension DV051 Intel Pentium 4 CPU 2.80 GHz, 0,99 GB

Share this post


Link to post
Share on other sites

I've searched the JAI forums for answers, but none were found.

The only thing I found is that the DLLs are only needed if I need to use platform specific acceleration, but I'm not using that, so this is not a problem in the direction of missing DLLs, as I thought might be the case.

Is really nobody able to give me at least a clue about in which direction to search for a solution?

Share this post


Link to post
Share on other sites

Piotr, does your JET compiled application work improperly just after compilation (before packaging by JetPackII)? This might be a bug in Excelsior JET optimizer.

Please contact our Support Dept.: java at excelsior-usa.com.

It would be also helpful if you provided us some sample that behaves incorrectly when compiled with Excelsior JET.

Share this post


Link to post
Share on other sites

Is really nobody able to give me at least a clue about in which direction to search for a solution?

Just in case, we had a long weekend due to a national holiday. Sorry.

Share this post


Link to post
Share on other sites

No harm done, nothing wrong with holidays B)

Has the weather been good?

In the meantime, the application users have found some settings in the tools with which they save the problematic gif files (e.g. Photoshop) which make the problem disappear.

So we found a workaround, if you will.

Share this post


Link to post
Share on other sites

Has the weather been good?

The weather was rainy unfortunately :-\

In the meantime, the application users have found some settings in the tools with which they save the problematic gif files (e.g. Photoshop) which make the problem disappear.

So we found a workaround, if you will.

Good news, but if the problem becomes a showstopper please do not hesitate to contact Support Dept. directly.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×