troubleshooting Question

Help with javax.imageio.ImageIO.write problem getting java.lang.IllegalArgumentException:

Avatar of lasanac
lasanac asked on
JavaJava EE
11 Comments1 Solution4857 ViewsLast Modified:
I am getting this error when I try to write my tiff to disk.  I get the file from an e-mail attachment.  It is not null but when I read it in, but when I do an it is null after that.  Not sure what is going on here, but it is very confusing.  Any help would be great.  

Here is the full stack trace:

java.lang.IllegalArgumentException: im == null!
      at javax.imageio.ImageIO.write(Unknown Source)
      at javax.imageio.ImageIO.write(Unknown Source)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.mule.model.resolvers.AbstractEntryPointResolver.invokeMethod(
      at org.mule.model.resolvers.ReflectionEntryPointResolver.invoke(
      at org.mule.model.resolvers.DefaultEntryPointResolverSet.invoke(
      at org.mule.component.DefaultLifecycleAdapter.intercept(
      at org.mule.component.AbstractJavaComponent.invokeComponentInstance(
      at org.mule.component.AbstractJavaComponent.doOnCall(
      at org.mule.component.AbstractComponent.onCall(
      at org.mule.model.seda.SedaService$
      at Source)

String attContentType = handler.getContentType();
		            System.out.println("Some Data " + attContentType);
		            File f = new File("c:\\TempMail" + dte + ".tif");
		            	//TIFFWriter writer = new TIFFWriter();
		            	//java.awt.image.BufferedImage [] images  = new java.awt.image.BufferedImage[2];
		            	//images [0] = writer.getBufferedImageFromImage(;
		            	InputStream input = handler.getInputStream();
		            	System.out.println("help Ako: " +input.available());
		            	java.awt.image.BufferedImage im =;
		            	System.out.println("help: ");
		            	ImageIO.write(, "tiff", f);
		            	//writer.createTIFFFromImages(images , f);
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 11 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 11 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros