Error when opening mpp file

@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.

@vasiliysinitsyn
OS:
NAME=openSUSE
VERSION=“13.2 (Harlequin)”
VERSION_ID=“13.2”
PRETTY_NAME=“openSUSE 13.2 (Harlequin) (x86_64)”
ID=opensuse
ANSI_COLOR=“0;32”
CPE_NAME=“cpe:/o:opensuse:opensuse:13.2”
BUG_REPORT_URL=“https://bugs.opensuse.org
HOME_URL=“https://opensuse.org/
ID_LIKE=“suse”

Stacktrace from apache logs:

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);
            }
        }

Separator:
10

@rgrtht,
could you attach archive with your test application?

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

@rgrtht,
looks like the issue is in code which interacts with environment variables, but we could find the exact cause.

Could you provide a remaining piece of stack trace (see the red arrow).

(the stack trace is from file ‘[exemplo]aspose-tasks-22.8-jdk18.png’).

Could you also execute ‘env’ command on your environment and attach the output (please remove any sensitive data first)?

Correction: i have tested again the file exemplo.mpp works with java1.8 and aspose tasks 22.8.

although, with file exemplo2022.mpp, the following error occurs:

org.apache.jasper.JasperException: class com.aspose.tasks.private_.h.p: Attempted to seek before start of MemoryStream.
com.aspose.tasks.private_.h.r.a(Unknown Source)
com.aspose.tasks.akp.l(Unknown Source)
com.aspose.tasks.akp.a(Unknown Source)
com.aspose.tasks.akw.d(Unknown Source)
com.aspose.tasks.avm.n(Unknown Source)
com.aspose.tasks.baq.s(Unknown Source)
com.aspose.tasks.baq.a(Unknown Source)
com.aspose.tasks.bop.a(Unknown Source)
com.aspose.tasks.Project.a(Unknown Source)
com.aspose.tasks.Project.a(Unknown Source)
com.aspose.tasks.Project.(Unknown Source)
com.aspose.tasks.Project.(Unknown Source)
org.apache.jsp.aspose.Tasks.sandbox.exemplo2022_jsp._jspService(exemplo2022_jsp.java:86)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:386)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
java.lang.Thread.run(Thread.java:745)
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:500)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:428)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
root cause

class com.aspose.tasks.private_.h.p: Attempted to seek before start of MemoryStream.
com.aspose.tasks.private_.h.r.a(Unknown Source)
com.aspose.tasks.akp.l(Unknown Source)
com.aspose.tasks.akp.a(Unknown Source)
com.aspose.tasks.akw.d(Unknown Source)
com.aspose.tasks.avm.n(Unknown Source)
com.aspose.tasks.baq.s(Unknown Source)
com.aspose.tasks.baq.a(Unknown Source)
com.aspose.tasks.bop.a(Unknown Source)
com.aspose.tasks.Project.a(Unknown Source)
com.aspose.tasks.Project.a(Unknown Source)
com.aspose.tasks.Project.(Unknown Source)
com.aspose.tasks.Project.(Unknown Source)
org.apache.jsp.aspose.Tasks.sandbox.exemplo2022_jsp.jspService(exemplo2022_jsp.java:86)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:386)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
java.lang.Thread.run(Thread.java:745)
com.aspose.tasks.private
.h.r.a(Unknown Source)
com.aspose.tasks.akp.l(Unknown Source)
com.aspose.tasks.akp.a(Unknown Source)
com.aspose.tasks.akw.d(Unknown Source)
com.aspose.tasks.avm.n(Unknown Source)
com.aspose.tasks.baq.s(Unknown Source)
com.aspose.tasks.baq.a(Unknown Source)
com.aspose.tasks.bop.a(Unknown Source)
com.aspose.tasks.Project.a(Unknown Source)
com.aspose.tasks.Project.a(Unknown Source)
com.aspose.tasks.Project.(Unknown Source)
com.aspose.tasks.Project.(Unknown Source)
org.apache.jsp.aspose.Tasks.sandbox.exemplo2022_jsp._jspService(exemplo2022_jsp.java:86)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:386)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

env command output:

LESSKEY=/etc/lesskey.bin
NNTPSERVER=news
MANPATH=/usr/share/man:/usr/local/man:/usr/local/share/man
XDG_SESSION_ID=18213
HOSTNAME=sandbox
XKEYSYMDB=/usr/X11R6/lib/X11/XKeysymDB
HOST=sandbox
TERM=xterm-256color
SHELL=/bin/bash
PROFILEREAD=true
HISTSIZE=1000
SSH_CLIENT=179.124.197.127 8073 5432
MORE=-sl
SSH_TTY=/dev/pts/0
JRE_HOME=/usr/java/jdk1.8.0_202/jre
USER=root
LS_COLORS=no=00:fi=00:di=01;34:ln=00;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=41;33;01:ex=00;32:.cmd=00;32:.exe=01;32:.com=01;32:.bat=01;32:.btm=01;32:.dll=01;32:.tar=00;31:.tbz=00;31:.tgz=00;31:.rpm=00;31:.deb=00;31:.arj=00;31:.taz=00;31:.lzh=00;31:.lzma=00;31:.zip=00;31:.zoo=00;31:.z=00;31:.Z=00;31:.gz=00;31:.bz2=00;31:.tb2=00;31:.tz2=00;31:.tbz2=00;31:.xz=00;31:.avi=01;35:.bmp=01;35:.fli=01;35:.gif=01;35:.jpg=01;35:.jpeg=01;35:.mng=01;35:.mov=01;35:.mpg=01;35:.pcx=01;35:.pbm=01;35:.pgm=01;35:.png=01;35:.ppm=01;35:.tga=01;35:.tif=01;35:.xbm=01;35:.xpm=01;35:.dl=01;35:.gl=01;35:.wmv=01;35:.aiff=00;32:.au=00;32:.mid=00;32:.mp3=00;32:.ogg=00;32:.voc=00;32:*.wav=00;32:
XNLSPATH=/usr/X11R6/lib/X11/nls
HOSTTYPE=x86_64
CONFIG_SITE=/usr/share/site/x86_64-unknown-linux-gnu
PAGER=less
CSHEDIT=emacs
XDG_CONFIG_DIRS=/etc/xdg
LIBGL_DEBUG=quiet
MINICOM=-c on
MAIL=/var/mail/root
PATH=/sbin:/usr/sbin:/usr/local/sbin:/root/bin:/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/java/jdk1.8.0_202/bin
CPU=x86_64
JAVA_BINDIR=/usr/java/jdk1.8.0_202/bin
SSH_SENDS_LOCALE=yes
INPUTRC=/etc/inputrc
PWD=/root
JAVA_HOME=/usr/java/jdk1.8.0_202
LANG=en_US.UTF-8
PYTHONSTARTUP=/etc/pythonstart
SDK_HOME=/usr/java/jdk1.8.0_202
GPG_TTY=/dev/pts/0
JDK_HOME=/usr/java/jdk1.8.0_202
SHLVL=1
HOME=/root
LESS_ADVANCED_PREPROCESSOR=no
OSTYPE=linux
LS_OPTIONS=-A -N --color=tty -T 0
WINDOWMANAGER=
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-15,CP1252
LESS=-M -I -R
MACHTYPE=x86_64-suse-linux
LOGNAME=root
XDG_DATA_DIRS=/usr/share
SSH_CONNECTION=179.124.197.127 8073 200.155.74.124 5432
LESSOPEN=lessopen.sh %s
XDG_RUNTIME_DIR=/run/user/0
LESSCLOSE=lessclose.sh %s %s
G_BROKEN_FILENAMES=1
JAVA_ROOT=/usr/java/jdk1.8.0_202
COLORTERM=1
BASH_FUNC_mc%%=() { . /usr/share/mc/mc-wrapper.sh
}
_=/usr/bin/env

@rgrtht,

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

3: <%
4: String dataDir = “/opt/novell/teaming/apache-tomcat/webapps/webserv/aspose/Tasks/sandbox/”;
5:
6: Project project = new Project(dataDir + “exemplo2022.mpp”);
7: %>

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

java.lang.NoClassDefFoundError: Could not initialize class com.aspose.tasks.HeaderFooterInfo
com.aspose.tasks.PageInfo.(Unknown Source)
com.aspose.tasks.View.(Unknown Source)
com.aspose.tasks.View.(Unknown Source)
com.aspose.tasks.bdm.a(Unknown Source)
com.aspose.tasks.axo.m(Unknown Source)
com.aspose.tasks.bcu.ad(Unknown Source)
com.aspose.tasks.bcu.s(Unknown Source)
com.aspose.tasks.bcu.a(Unknown Source)
com.aspose.tasks.bta.a(Unknown Source)
com.aspose.tasks.Project.a(Unknown Source)
com.aspose.tasks.Project.(Unknown Source)
com.aspose.tasks.Project.(Unknown Source)
org.apache.jsp.aspose.Tasks.sandbox.exempleForum_jsp._jspService(exempleForum_jsp.java:66)
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)

@rgrtht,

based on the attached stack trace, the error has the same origin as I described earlier. We will fix it in TASKSJAVA-1742.

Now let’s return to your comment.

Could you describe how to reproduce “Attempted to seek before start of MemoryStream.” error on version 22.8 please ?

“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

@rgrtht,
Ok. We will try to reproduce it.

Hi @vasiliysinitsyn.

Please, could you show me where is the “newlines in environment variables”. I didn’t understand

You wrote: “Looks like we are not handling newlines in environment variables properly. So this is a cause of ‘ExceptionInitializeError’.”

if we remove the newlines, will the problem be solved?

@construtivo,

consider the following variables:

COLORTERM=1
BASH_FUNC_mc%%=() { . /usr/share/mc/mc-wrapper.sh
}
_=/usr/bin/envVARIABLE_NEXT=value

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)?

@construtivo ,
the fix will be released in the next (22.10) version of Aspose.Tasks for Java.

1 Like

Hello @vasiliysinitsyn.
I installed the version 22.10 and it worked perfectly. Thank you very much.