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

tmrap (ltm) broken in 5.1.0 #275

Closed
GoogleCodeExporter opened this issue Mar 16, 2015 · 4 comments
Closed

tmrap (ltm) broken in 5.1.0 #275

GoogleCodeExporter opened this issue Mar 16, 2015 · 4 comments

Comments

@GoogleCodeExporter
Copy link

GoogleCodeExporter commented Mar 16, 2015

In 5.0.2 this works like a charm (from bash: $ python example):

import httplib, urllib
ltm = """
[ brno : city = "Brno"]
"""
body = "topicmap=ItalianOpera.ltm&syntax=text/x-ltm&fragment=" + 
urllib.quote(ltm)
headers = {"Content-Type" : "application/x-www-form-urlencoded"}
conn = httplib.HTTPConnection("localhost", 8080)
conn.request("POST",
"/tmrap/tmrap/add-fragment",
body,
headers)
resp = conn.getresponse()
print resp.status
print resp.reason
conn.close() 

In 5.1.0 I get only:
400
Bad Request

And in log:
INFO 2010-07-06 22:59:40,276 [localhost].[/tmrap] - Start constructing 
NavigatorApplication object.
 INFO 2010-07-06 22:59:40,276 basic.NavigatorApplication - Start to load application configuration from WEB-INF/config/application.xml
 INFO 2010-07-06 22:59:40,276 basic.NavigatorApplication - Navigator application 'TMRAP application (using Apache-Axis2)' will use default shared topic maps repository
 INFO 2010-07-06 22:59:40,276 basic.NavigatorApplication - NavigatorApplication initialized for 'TMRAP application (using Apache-Axis2)'.
 INFO 2010-07-06 22:59:40,276 [localhost].[/tmrap] - Setup navigator configuration and assigned it to application context.
 WARN 2010-07-06 22:59:40,281 tmrap.RAPServlet - Error occurred.
 java.lang.ClassCastException: antlr.CommonToken
        at antlr.CharScanner.makeToken(CharScanner.java:173)
        at net.ontopia.topicmaps.utils.ltm.LTMLexer.mLBRACKET(LTMLexer.java:809)
        at net.ontopia.topicmaps.utils.ltm.LTMLexer.nextToken(LTMLexer.java:288)
        at antlr.TokenBuffer.fill(TokenBuffer.java:69)
        at antlr.TokenBuffer.LA(TokenBuffer.java:80)
        at antlr.LLkParser.LA(LLkParser.java:52)
        at net.ontopia.topicmaps.utils.ltm.LTMParser.topicmap(LTMParser.java:465)
        at net.ontopia.topicmaps.utils.ltm.LTMTopicMapReader.read(LTMTopicMapReader.java:139)
        at net.ontopia.topicmaps.impl.utils.AbstractTopicMapReader.readAll(AbstractTopicMapReader.java:113)
        at net.ontopia.topicmaps.impl.utils.AbstractTopicMapReader.importInto(AbstractTopicMapReader.java:133)
        at net.ontopia.topicmaps.utils.tmrap.TMRAPImplementation.addFragment(TMRAPImplementation.java:221)
        at net.ontopia.topicmaps.utils.tmrap.RAPServlet.addFragment(RAPServlet.java:219)
        at net.ontopia.topicmaps.utils.tmrap.RAPServlet.doPost(RAPServlet.java:118)
        at net.ontopia.topicmaps.utils.tmrap.RAPServlet.doPost(RAPServlet.java:112)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:875)
        at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
        at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
        at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
        at java.lang.Thread.run(Thread.java:595)


Original issue reported on code.google.com by ladislav...@gmail.com on 6 Jul 2010 at 9:06

@GoogleCodeExporter
Copy link
Author

GoogleCodeExporter commented Mar 16, 2015

This was also discussed at the IRC channel. There seems to be one ANTLR lib too 
much
http://logs.subjektzentrisch.de/ontopia/archive/%23ontopia20100709.html#2010-07-
09T11:53:11+02:00

Original comment by lars.he...@gmail.com on 9 Jul 2010 at 3:16

@GoogleCodeExporter
Copy link
Author

GoogleCodeExporter commented Mar 16, 2015

Seems there are 3 antlr libraries. The same.

root@marvin:/opt/ontopia# find . -name "antlr*jar" -exec ls -l {} \; 
-rw-r--r-- 1 ontopia ontopia 445288 Jul 15 14:18 ./lib/antlr.jar
-rw-r--r-- 1 ontopia ontopia 445288 Jul 15 14:18 
./apache-tomcat/common/lib/antlr.jar
-rw-r--r-- 1 ontopia ontopia 445288 Jul 15 14:18 
./apache-tomcat/webapps/tmrap/WEB-INF/lib/antlr-2.7.7.jar

When I removed ./apache-tomcat/webapps/tmrap/WEB-INF/lib/antlr-2.7.7.jar seems 
tmrap works again.

Original comment by ladislav...@gmail.com on 15 Jul 2010 at 12:57

@GoogleCodeExporter
Copy link
Author

GoogleCodeExporter commented Mar 16, 2015

I have just tested 5.1.1b4, still the same problem. :-(
This file ./apache-tomcat/webapps/tmrap/WEB-INF/lib/antlr-2.7.7.jar must be 
removed from stable tarball.

Original comment by ladislav...@gmail.com on 19 Oct 2010 at 2:20

@GoogleCodeExporter
Copy link
Author

GoogleCodeExporter commented Mar 16, 2015

Fixed by removing antlr-2.7.7.jar from 
webapps/tmrap/WEB-INF/lib/antlr-2.7.7.jar in build.xml.

Original comment by indiapaleale@gmail.com on 19 Oct 2010 at 3:03

  • Changed state: Fixed

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

No branches or pull requests

1 participant