We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Error when trying to integrate to Web Application

Hi,


I’m evaluating the Aspose.Diagram product using Java and encountered a problem when trying to integrate to my Web Application. I encountered same error when using either Struts Action and even a normal Servlet.

I used the com.aspose.diagram.examples.diagrams.AddConnectShapes
as sample code but encountered below error (This is not a structured storage file).

[7/31/15 8:53:24:209 CDT] 0000005c SystemErr R java.lang.IllegalStateException: This is not a structured storage file.
[7/31/15 8:53:24:209 CDT] 0000005c SystemErr R at com.aspose.diagram.iw.(Unknown Source)
[7/31/15 8:53:24:209 CDT] 0000005c SystemErr R at com.aspose.diagram.gx.b(Unknown Source)
[7/31/15 8:53:24:209 CDT] 0000005c SystemErr R at com.aspose.diagram.gx.(Unknown Source)
[7/31/15 8:53:24:209 CDT] 0000005c SystemErr R at com.aspose.diagram.av.(Unknown Source)
[7/31/15 8:53:24:209 CDT] 0000005c SystemErr R at com.aspose.diagram.gr.a(Unknown Source)
[7/31/15 8:53:24:209 CDT] 0000005c SystemErr R at com.aspose.diagram.gr.a(Unknown Source)
[7/31/15 8:53:24:209 CDT] 0000005c SystemErr R at com.aspose.diagram.Diagram.(Unknown Source)

Thanks in advance!

Hi


Thank you for contacting support. Please provide us complete your sample code and source diagram in this forum thread. So that we could reproduce the error message on our side as well. We’re looking forward to help you.

Here is my code.

public class AsposeDiagramServlet extends HttpServlet {

private String message;

public void init() throws ServletException

{

// Do required initialization

message = “Hello World”;

}

public void doGet(HttpServletRequest request,

HttpServletResponse response)

throws ServletException, IOException

{

// Load masters from any existing diagram, stencil or template

// and add in the new diagram

String visioStencil = “C:\Props\Basic Shapes.vss”;

// Names of the masters present in the stencil

String rectangleMaster = “Rectangle”, starMaster = “Star 7”,

hexagonMaster = “Hexagon”, connectorMaster = “Dynamic connector”;

int pageNumber = 0;

double width = 2, height = 2, pinX = 4.25, pinY = 9.5;

// Create a new diagram

Diagram diagram = new Diagram(visioStencil);

// Add a new rectangle shape

long rectangleId = diagram.addShape(

pinX, pinY, width, height, rectangleMaster, pageNumber);

// Set the new shape’s properties

Shape shape = diagram.getPages().getPage(pageNumber).getShapes().getShape(rectangleId);

shape.getText().getValue().add(new Txt(“Rectangle text.”));

shape.setName(“Rectangle1”);

shape.getXForm().getLocPinX().getUfe().setF(“Width*0.5");*

*shape.getXForm().getLocPinY().getUfe().setF("Height*0.5”);

shape.getLine().getLineColor().setValue(“7”);

shape.getLine().getLineWeight().setValue(0.03);

shape.getFill().getFillBkgnd().setValue(“1”);

shape.getFill().getFillForegnd().setValue(“3”);

shape.getFill().getFillPattern().setValue(31);

// Add a new star shape

pinX = 2.0;

pinY = 4.5;

long starId = diagram.addShape(

pinX, pinY, width, height, starMaster, pageNumber);

// Set the star shape’s properties

shape = diagram.getPages().getPage(pageNumber).getShapes().getShape(starId);

shape.getText().getValue().add(new Txt(“Star text.”));

shape.setName(“Star1”);

shape.getXForm().getLocPinX().getUfe().setF(“Width*0.5");*

*shape.getXForm().getLocPinY().getUfe().setF("Height*0.5”);

shape.getLine().getLineColor().setValue("#ff0000");

shape.getLine().getLineWeight().setValue(0.03);

shape.getFill().getFillBkgnd().setValue("#ff00ff");

shape.getFill().getFillForegnd().setValue("#0000ff");

shape.getFill().getFillPattern().setValue(31);

// Add a new hexagon shape

pinX = 7.0;

long hexagonId = diagram.addShape(

pinX, pinY, width, height, hexagonMaster, pageNumber);

// Set the hexagon shape’s properties

shape = diagram.getPages().getPage(pageNumber).getShapes().getShape(hexagonId);

shape.getText().getValue().add(new Txt(“Hexagon text.”));

shape.setName(“Hexagon1”);

shape.getXForm().getLocPinX().getUfe().setF(“Width*0.5");*

*shape.getXForm().getLocPinY().getUfe().setF("Height*0.5”);

shape.getLine().getLineWeight().setValue(0.03);

shape.getFill().getFillPattern().setValue(31);

// Add master to dynamic connector from the stencil

diagram.addMaster(visioStencil, connectorMaster);

// Connect rectangle and star shapes

Shape connector1 = new Shape();

long connecter1Id = diagram.addShape(connector1, connectorMaster, 0);

diagram.getPages().getPage(0).connectShapesViaConnector(rectangleId, ConnectionPointPlace.BOTTOM,

starId, ConnectionPointPlace.TOP, connecter1Id);

// Connect rectangle and hexagon shapes

Shape connector2 = new Shape();

long connecter2Id = diagram.addShape(connector2, connectorMaster, 0);

diagram.getPages().getPage(0).connectShapesViaConnector(rectangleId, ConnectionPointPlace.BOTTOM,

hexagonId, ConnectionPointPlace.LEFT, connecter2Id);

// Save the diagram

diagram.save(“Output.vdx”, SaveFileFormat.VDX);

System.out.println(“Process Completed Successfully”);

}

}

I’m using the Basic Shapes.vss file from this URL - https://github.com/aspose-diagram/Aspose.Diagram-for-Java

Thanks in advance!

Hi

Thank you for posting the source code. We could not reproduce the error message said. We need to be more specific. Please provide the complete details of your working environment. It'll help us, please reply to the following questions:

  • What is the Operating System name, edition and 32 & 64 bit (e.g. Windows 7 Ultimate 64 bit)
  • What is the Java Servlets version?
  • Which IDE are you using and what is the build version and edition e.g. Netbeans, Eclipse or IntelliJ.
  • What is the local language and settings, etc.?
  • What is the JDK version?
  • Any other information that you think is necessary.

It would be great if can please prepare a sample project which reproduces this error message and attach its zip file in this forum thread. We're looking forward to help you.

What is the Operating System name, edition and 32 & 64 bit (e.g. Windows 7 Ultimate 64 bit)
- Windows Vista 32-Bit
What is the Java Servlets version?
- Java Servlet 2.5 / Java EE
Which IDE are you using and what is the build version and edition e.g. Netbeans, Eclipse or IntelliJ.
- I'm using RAD 7.0
What is the local language and settings, etc.?
- English
What is the JDK version?
- JDK 7.0
Any other information that you think is necessary.
- I'm trying to integrate it to our application as part of our evaluation.
Do you have a sample web application (I'm good with a link then will generate the visio file) that we can check and use as reference?

Hi


Thank you for providing these details. We’re preparing an environment and will get back to you at the end of this week or earlier next week. Unfortunately, there is no public web app which can be used for diagram online generation purposes. Please spare us a little time to replicate the issue said.

Hi


Thank you for being patient. We have logged an investigation under ticket id DIAGRAMJAVA-50212 in our issue tracking system. Your post has been linked to this issue. We’ll keep you informed regarding any available updates. We’re sorry for the inconvenience caused.

Hi


Thank you for being patient. From the specifics of issue id DIAGRAMJAVA-50212, we think, it may not belong to Aspose.Diagram APIs. Please comment all the code part of Aspose.Diagram APIs and then check if the IllegalStateException error occurred. Please also check this helping web page and let us know about your precious feedback.