tags:

views:

92

answers:

2

Dear all, i am getting following exception in this code, please do help me ,

javax.imageio.IIOException: Can't create output stream! 

de.laures.cewolf.ChartRenderingException: Can't create output stream! 

javax.servlet.jsp.JspException: Can't create output stream! 

 at de.laures.cewolf.taglib.tags.ChartMapTag.doStartTag(ChartMapTag.java:117) 

the code is as below

 try {
   Dataset dataset = PageUtils.getDataset(chartId, pageContext);
   Writer out = pageContext.getOut();
   final boolean isIE = BrowserDetection.isIE((HttpServletRequest) pageContext.getRequest());
   if (hasToolTips()) {
    enableToolTips(out, isIE);
   }
   out.write("<MAP name=\"" + chartId + "\">\n");
   ChartRenderingInfo info = (ChartRenderingInfo) root.getRenderingInfo();
   Iterator entities = info.getEntityCollection().iterator();
   while (entities.hasNext()) {
    ChartEntity ce = (ChartEntity) entities.next();
    out.write("\n<AREA shape=\"" + ce.getShapeType() + "\" ");
    out.write("COORDS=\"" + ce.getShapeCoords() + "\" ");
          if (ce instanceof XYItemEntity)
          {
            dataset = ((XYItemEntity)ce).getDataset();
          }
    if (!(ce instanceof LegendItemEntity)) {
     if (hasToolTips()) {
      writeOutToolTip(dataset, out, isIE, ce);
     }
     if (hasLinks()) {
      writeOutLink(linkGenerator, dataset, out, ce);
     }
    }
    out.write(">");
   }
A: 

That's most likely a user access rights problem. The user (the server?) needs to have modify permissions on the output file. Some chart renderes create the files in the/in a temp folder so the user/the server needs permission to create and modify files on this folder too.

I think, the full stack trace includes an underlying IOException with a detailed description of the cause (like "access denied" or so).

Edit

To solve the issue, run the application in a debugger and set a breakpoint on javax.imageio.IIOException. Then, when the application stops on that breakpoint, look at the variables (you may have to move down the stacktrace) for the name of the file that can't be used for writing. Then look at the file system and check, if the file or the enclosing foder is write protected.

Andreas_D
the stack trace does not include any more usefull information, i am using oracle 10 server, can you please tell me how give access right and where will be this temp folder
manoj
hello, can you tell me about access right, and where i have to give the access rights?
manoj
+1  A: 

I'm the maintainer of the cewolf project, and I've just uploaded a new version (1.1.1) that may solve this issue. Give it a spin and let us know how it works out. If the problems persist, head over to the "Other Open Source Projects" forum on JavaRanch; that's where I support cewolf.

Ulf