Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test restd interface locally #96

Closed
physikerwelt opened this issue Aug 2, 2016 · 13 comments
Closed

Test restd interface locally #96

physikerwelt opened this issue Aug 2, 2016 · 13 comments

Comments

@physikerwelt
Copy link
Member

@plato2000 reported problems with the restd interface.
Running
mvn exec:java -Drestx.http.XForwardedSupport=all -Dpassword=mathosphere
works fine for me.
It looks like in the screenshot below:
2016-08-02 1
@plato2000 please describe what problem you see.

@plusparth
Copy link
Collaborator

Where did you give it its data? When I try to specify the data directory or give it one of the xml files, it still gives me a BaseX exception. I don't get this issue when using the basex backend directly.

@physikerwelt
Copy link
Member Author

physikerwelt commented Aug 2, 2016

I did not specify a data directory at all. By default it whould point to some test data.

@physikerwelt
Copy link
Member Author

With the data provided I get a imilar message as you reported before

org.basex.core.BaseXException: "/tmp/baseX/d2/math000000375000.xml": java.lang.ArrayIndexOutOfBoundsException: 2048
at org.basex.core.Command.execute(Command.java:100)
at org.basex.core.Command.execute(Command.java:122)
at com.formulasearchengine.mathosphere.basex.Server.startup(Server.java:66)
at com.formulasearchengine.mathosphere.restd.AppServer.main(AppServer.java:40)

Is it the math000000375000 file for you too?
If I specify only one file everything works as expected.

@plusparth
Copy link
Collaborator

For me it gives the same error on the math000000000000.xml file, regardless of if that's the only file I give it or if I give it the path to the directory. When I don't provide any data directory, it works like yours does.

I still think it's odd that when running the basex backend directly, I can provide a data directory and it works perfectly fine, but if I do the same thing when running through restd, it breaks. Doesn't it run the same Command.java startup function both ways?

@physikerwelt
Copy link
Member Author

I guess it's a memory problem.

@physikerwelt
Copy link
Member Author

@plato2000 can you figure out how to pass the xmx parameter to mvn exec.
I guess it's export MAVEN_OPTS=-Xmx12g
However, I need to run.

@plusparth
Copy link
Collaborator

I used the MAVEN_OPTS to set the xmx parameter to 12 gigabytes, but that did not fix the issue.

@physikerwelt
Copy link
Member Author

did you check in the task manager if the memory is really assigned. Can you add the -d parameter to the basex server to get a more detailed error message? (It's commented out in the code)

@plusparth
Copy link
Collaborator

plusparth commented Aug 3, 2016

In the task manager, it did not use the amount of ram that was assigned with the Xmx option. However, I checked multiple sources, and using the MAVEN_OPTS environment variable is the right way to give it more RAM. I think that this is not a RAM issue because of this.

Where should I try the -d flag? I found it, testing now

@plusparth
Copy link
Collaborator

Alright, when using the debug option, it says

Creating Database...
........

and it works. When doing the same thing when running the restd interface, it gets to one dot for the creating database before crashing.

java.lang.ArrayIndexOutOfBoundsException: 2048
    at org.apache.xerces.impl.io.UTF8Reader.read(Unknown Source)
    at org.apache.xerces.impl.XMLEntityScanner.load(Unknown Source)
    at org.apache.xerces.impl.XMLEntityScanner.scanQName(Unknown Source)
    at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanAttribute(Unknown Source)
    at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
    at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
    at org.basex.build.xml.SAXWrapper.parse(SAXWrapper.java:77)
    at org.basex.build.SingleParser.parse(SingleParser.java:33)
    at org.basex.build.DirParser.parseResource(DirParser.java:221)
    at org.basex.build.DirParser.parse(DirParser.java:140)
    at org.basex.build.DirParser.parse(DirParser.java:104)
    at org.basex.build.DirParser.parse(DirParser.java:93)
    at org.basex.build.Builder.parse(Builder.java:73)
    at org.basex.build.DiskBuilder.build(DiskBuilder.java:82)
    at org.basex.core.cmd.CreateDB.run(CreateDB.java:100)
    at org.basex.core.Command.run(Command.java:253)
    at org.basex.core.Command.execute(Command.java:99)
    at org.basex.core.Command.execute(Command.java:122)
    at com.formulasearchengine.mathosphere.basex.Server.startup(Server.java:66)
    at com.formulasearchengine.mathosphere.restd.AppServer.main(AppServer.java:40)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:297)
    at java.lang.Thread.run(Thread.java:745)

And then gives the same BaseX exception as before.

@plusparth
Copy link
Collaborator

plusparth commented Aug 3, 2016

Also, I checked the RAM thing, and I ran jps -v to see the launch parameters and it is working (it definitely has the -Xmx12G parameter)

@physikerwelt
Copy link
Member Author

@plato2000 I talked to @ChristianGruen today. He proposed some suggestions to improve the server, client communcation. I merged his pull requst. Can you check if that also resolved the issue at hand?

@plusparth
Copy link
Collaborator

Ok, it seems to work now. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants