@rgrtht,
I’ve tried to open the files using java 1.8 and Aspose.Tasks for Java v. 22.8 on Windows 10 and it worked for me.
What is your OS ?
Could you also provide full stack trace (the picture [exemplo]aspose-tasks-22.8-jdk18.png is truncated) so we can try to determine the cause of the error.
Aug 25, 2022 6:41:29 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [jsp] in context with path [/webserv] threw exception [An exception occurred processing JSP page /aspose/Tasks/sandbox/exemplo2022.jsp at line 40
37: // SETA DIRETORIO DE TRABALHO
38: String dataDir = “/opt/novell/teaming/apache-tomcat/webapps/webserv/aspose/Tasks/sandbox/”;
39:
40: Project project = new Project(dataDir + “exemplo2022.mpp”);
41: /*
42: ChildTasksCollector collector = new ChildTasksCollector();
43:
Stacktrace:] with root cause
java.lang.NoClassDefFoundError: Could not initialize class com.aspose.tasks.HeaderFooterInfo
at com.aspose.tasks.PageInfo.(Unknown Source)
at com.aspose.tasks.View.(Unknown Source)
at com.aspose.tasks.View.(Unknown Source)
at com.aspose.tasks.bdm.a(Unknown Source)
at com.aspose.tasks.axo.m(Unknown Source)
at com.aspose.tasks.bcu.ad(Unknown Source)
at com.aspose.tasks.bcu.s(Unknown Source)
at com.aspose.tasks.bcu.a(Unknown Source)
at com.aspose.tasks.bta.a(Unknown Source)
at com.aspose.tasks.Project.a(Unknown Source)
at com.aspose.tasks.Project.(Unknown Source)
at com.aspose.tasks.Project.(Unknown Source)
at org.apache.jsp.aspose.Tasks.sandbox.exemplo2022_jsp._jspService(exemplo2022_jsp.java:95)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:439)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.filters.HttpHeaderSecurityFilter.doFilter(HttpHeaderSecurityFilter.java:106)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:683)
at org.apache.catalina.valves.RequestFilterValve.process(RequestFilterValve.java:334)
at org.apache.catalina.valves.RemoteAddrValve.invoke(RemoteAddrValve.java:119)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:423)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1079)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
@rgrtht,
could you print the value of your ‘line.separator’ environment variable using the following code:
String s = System.getProperty("line.separator");
System.out.println("Separator: ");
if (s == null) {
System.out.println("null");
}
else {
char[] c = s.toCharArray();
for (char ch : c)
{
System.out.println((int)ch);
}
}
please. consider again reeding the problem.
I said that version 20.7 works with java 1.7, with file exemplo.mpp.
With any other newer version of aspose Tasks, not even exemplo.mpp works. The same happens when trying to open exemplo2022.mpp but with every version is a different error.
I think you should consider 2 things:
1st) what changed from version 20.7 to the next?
2nd) is there anything else besides the jar file and my code that could cause this issue? perhaps my region which is Brazil
Thanks
Edit: when i first posted here, i was just trying with java 1.8 to see if it would work. but the main version i use is 1.7
thank you for attaching the output.
Looks like we are not handling newlines in environment variables properly.
So this is a cause of ‘ExceptionInitializeError’.
А ticket with ID ** TASKSJAVA-1742** has been created to further fix the issue. This thread has been linked with the issue so that you may be notified once the issue will be fixed.
@rgrtht,
I’ve tried to use code ‘Project p = new Project(“exemplo2022.mpp”)’ with jdk 1.8 and Aspose.Tasks v. 22.8 and it works.
With previous version of Aspose.Tasks it will throw exception because this mpp file was saved using latest (16.0.15427.20210) update of MS Project and its internal structure was changed.
We fixed the issue in 22.8.
For example, Aspose.Tasks for Java v.22.7 will throw java.lang.NegativeArraySizeException: -2013265680.
Could you check that you use v. 22.8 and attach a sample application which can be used to reproduce the issue?
Sure. I have verified that i have the file aspose-tasks-22.8-jdk18.jar under the apache-tomcat/lib folder, which is the way i install java lib files on this server.
exempleForum.7z (361 Bytes)
In this attachment you will find the test application.
org.apache.jasper.JasperException: An exception occurred processing JSP page /aspose/Tasks/sandbox/exempleForum.jsp at line 6
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:575)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:462)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)
javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
org.apache.catalina.filters.HttpHeaderSecurityFilter.doFilter(HttpHeaderSecurityFilter.java:106)
root cause
javax.servlet.ServletException: java.lang.NoClassDefFoundError: Could not initialize class com.aspose.tasks.HeaderFooterInfo
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:916)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:845)
org.apache.jsp.aspose.Tasks.sandbox.exempleForum_jsp._jspService(exempleForum_jsp.java:79)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:439)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)
javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
org.apache.catalina.filters.HttpHeaderSecurityFilter.doFilter(HttpHeaderSecurityFilter.java:106)
root cause
“Attempted to seek before start of MemoryStream.”: with the test application i sent you before and the file exemplo2022.mpp this error occurs on java 1.8 with aspose tasks 22.8
Here the variable BASH_FUNC_mc%% contains new line character before close bracket ‘}’:
Screenshot_11.png (6.1 KB)
So if we are talking about ExceptionInitializeError (‘Could not initialize class com.aspose.tasks.HeaderFooterInfo’) error, the removal of new line characters in values of environment variables should fix the error.
For example, for the given output, the value of ‘BASH_FUNC_mc%%’ variable could be set to
‘() { . /usr/share/mc/mc-wrapper.sh }’
Hello @vasiliysinitsyn. Thanks for the directions.
We are working on a version of linux where this environment variable is created by the operating system itself and it is not possible to delete or modify it. Would it be feasible to request that a new version of aspose-task could deal with this issue without having to make a correction in the linux operating system (or we will have to change the linux of the server)?