Wednesday, April 5, 2017

Getting a bit confused deploying PowerAqua...fixed a linux permissions issue...but now a config issue perhaps when loading the java class

I'm getting a bit confused deploying PowerAqua. Maybe it is that I am new to tomcat configuration.

Symptom: 200 when it hits index.html, but it 404s when it hits jsp/init.jsp or any other child (css, images...database) from the root.

(1) steps followed:
Download: https://sourceforge.net/projects/poweraqua/files/code/webapps-tomcat/poweraqualinked.zip

copy powerqualinked to /var/lib/tomcat7/webapps/poweraqua/ :

Go to localhost:8080/poweraqua/

index.html in /poweraqua/ is:

 <html>
<head>
<meta HTTP-EQUIV="REFRESH" content="0; url=jsp/init.jsp">
</head>
</html>

jsp/init.jsp 404s

How do I set the path?

https://tomcat.apache.org/tomcat-7.0-doc/config/context.html
https://tomcat.apache.org/tomcat-7.0-doc/class-loader-howto.html
https://www.mulesoft.com/tcat/tomcat-classpath

Solution?: Perhaps I need a web.xml in WEB-INF that points

Reference: https://sourceforge.net/projects/poweraqua/files/documentation/how to run poweraqua locally.pdf

----

oh...chmod 755 on all child directories in ./poweraqua/ allows the css and other things to change.

But now I get a new error. :)

Type Exception report
message Unable to compile class for JSP:
description The server encountered an internal error that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP: 

An error occurred at line: [15] in the generated java file: [/var/lib/tomcat7/work/Catalina/localhost/
poweraqua/org/apache/jsp/jsp/index_jsp.java]
Only a type can be imported. 
poweraqua.powermap.triplePhase.TripleSimilarityService resolves to a package

An error occurred at line: [16] in the generated java file: [/var/lib/tomcat7/work/Catalina/localhost/
poweraqua/org/apache/jsp/jsp/index_jsp.java]
Only a type can be imported. 
poweraqua.LinguisticComponent.LinguisticComponent resolves to a package

An error occurred at line: [17] in the generated java file: [/var/lib/tomcat7/work/Catalina/localhost/
poweraqua/org/apache/jsp/jsp/index_jsp.java]
Only a type can be imported. 
poweraqua.powermap.mappingModel.MappingSession resolves to a package

An error occurred at line: 25 in the jsp file: /jsp/index.jsp
MappingSession cannot be resolved to a type
22:     // We need to initialize here because of the login mechanism?
23:     System.out.println ("--> get real path " + root_path);      
24:     HttpSession session = request.getSession(false);
25:     MappingSession mappingSession;    
26:      if (session == null)   {
27:          session = request.getSession(true);
28:          System.out.println ("Creating session ................................... ");


An error occurred at line: 29 in the jsp file: /jsp/index.jsp
LinguisticComponent cannot be resolved to a type
26:      if (session == null)   {
27:          session = request.getSession(true);
28:          System.out.println ("Creating session ................................... ");
29:          LinguisticComponent chunk = new LinguisticComponent(application.getRealPath("/WEB-INF"));
30:          mappingSession = new MappingSession (root_path);
31:          TripleSimilarityService TSS = new TripleSimilarityService(mappingSession);
32:          TSS.getMapSession().setSerqlCalls(0);


An error occurred at line: 29 in the jsp file: /jsp/index.jsp
LinguisticComponent cannot be resolved to a type
26:      if (session == null)   {
27:          session = request.getSession(true);
28:          System.out.println ("Creating session ................................... ");
29:          LinguisticComponent chunk = new LinguisticComponent(application.getRealPath("/WEB-INF"));
30:          mappingSession = new MappingSession (root_path);
31:          TripleSimilarityService TSS = new TripleSimilarityService(mappingSession);
32:          TSS.getMapSession().setSerqlCalls(0);


An error occurred at line: 30 in the jsp file: /jsp/index.jsp
MappingSession cannot be resolved to a type
27:          session = request.getSession(true);
28:          System.out.println ("Creating session ................................... ");
29:          LinguisticComponent chunk = new LinguisticComponent(application.getRealPath("/WEB-INF"));
30:          mappingSession = new MappingSession (root_path);
31:          TripleSimilarityService TSS = new TripleSimilarityService(mappingSession);
32:          TSS.getMapSession().setSerqlCalls(0);
33:          session.setAttribute("chunk", chunk);


An error occurred at line: 31 in the jsp file: /jsp/index.jsp
TripleSimilarityService cannot be resolved to a type
28:          System.out.println ("Creating session ................................... ");
29:          LinguisticComponent chunk = new LinguisticComponent(application.getRealPath("/WEB-INF"));
30:          mappingSession = new MappingSession (root_path);
31:          TripleSimilarityService TSS = new TripleSimilarityService(mappingSession);
32:          TSS.getMapSession().setSerqlCalls(0);
33:          session.setAttribute("chunk", chunk);
34:          session.setAttribute("TSS", TSS);


An error occurred at line: 31 in the jsp file: /jsp/index.jsp
TripleSimilarityService cannot be resolved to a type
28:          System.out.println ("Creating session ................................... ");
29:          LinguisticComponent chunk = new LinguisticComponent(application.getRealPath("/WEB-INF"));
30:          mappingSession = new MappingSession (root_path);
31:          TripleSimilarityService TSS = new TripleSimilarityService(mappingSession);
32:          TSS.getMapSession().setSerqlCalls(0);
33:          session.setAttribute("chunk", chunk);
34:          session.setAttribute("TSS", TSS);


An error occurred at line: 39 in the jsp file: /jsp/index.jsp
TripleSimilarityService cannot be resolved to a type
36:      else {
37:          System.out.println ("Obtaining session .................................... ");
38:          try{
39:          TripleSimilarityService TSS = (TripleSimilarityService) session.getAttribute("TSS");
40:          mappingSession = TSS.getMapSession();
41:          }catch(Exception e){
42:              System.out.println ("Creating session ................................... ");


An error occurred at line: 39 in the jsp file: /jsp/index.jsp
TripleSimilarityService cannot be resolved to a type
36:      else {
37:          System.out.println ("Obtaining session .................................... ");
38:          try{
39:          TripleSimilarityService TSS = (TripleSimilarityService) session.getAttribute("TSS");
40:          mappingSession = TSS.getMapSession();
41:          }catch(Exception e){
42:              System.out.println ("Creating session ................................... ");


An error occurred at line: 43 in the jsp file: /jsp/index.jsp
LinguisticComponent cannot be resolved to a type
40:          mappingSession = TSS.getMapSession();
41:          }catch(Exception e){
42:              System.out.println ("Creating session ................................... ");
43:              LinguisticComponent chunk = new LinguisticComponent(application.getRealPath("/WEB-INF"));
44:              mappingSession = new MappingSession (root_path);
45:              TripleSimilarityService TSS = new TripleSimilarityService(mappingSession);
46:              TSS.getMapSession().setSerqlCalls(0);


An error occurred at line: 43 in the jsp file: /jsp/index.jsp
LinguisticComponent cannot be resolved to a type
40:          mappingSession = TSS.getMapSession();
41:          }catch(Exception e){
42:              System.out.println ("Creating session ................................... ");
43:              LinguisticComponent chunk = new LinguisticComponent(application.getRealPath("/WEB-INF"));
44:              mappingSession = new MappingSession (root_path);
45:              TripleSimilarityService TSS = new TripleSimilarityService(mappingSession);
46:              TSS.getMapSession().setSerqlCalls(0);


An error occurred at line: 44 in the jsp file: /jsp/index.jsp
MappingSession cannot be resolved to a type
41:          }catch(Exception e){
42:              System.out.println ("Creating session ................................... ");
43:              LinguisticComponent chunk = new LinguisticComponent(application.getRealPath("/WEB-INF"));
44:              mappingSession = new MappingSession (root_path);
45:              TripleSimilarityService TSS = new TripleSimilarityService(mappingSession);
46:              TSS.getMapSession().setSerqlCalls(0);
47:              session.setAttribute("chunk", chunk);


An error occurred at line: 45 in the jsp file: /jsp/index.jsp
TripleSimilarityService cannot be resolved to a type
42:              System.out.println ("Creating session ................................... ");
43:              LinguisticComponent chunk = new LinguisticComponent(application.getRealPath("/WEB-INF"));
44:              mappingSession = new MappingSession (root_path);
45:              TripleSimilarityService TSS = new TripleSimilarityService(mappingSession);
46:              TSS.getMapSession().setSerqlCalls(0);
47:              session.setAttribute("chunk", chunk);
48:              session.setAttribute("TSS", TSS);


An error occurred at line: 45 in the jsp file: /jsp/index.jsp
TripleSimilarityService cannot be resolved to a type
42:              System.out.println ("Creating session ................................... ");
43:              LinguisticComponent chunk = new LinguisticComponent(application.getRealPath("/WEB-INF"));
44:              mappingSession = new MappingSession (root_path);
45:              TripleSimilarityService TSS = new TripleSimilarityService(mappingSession);
46:              TSS.getMapSession().setSerqlCalls(0);
47:              session.setAttribute("chunk", chunk);
48:              session.setAttribute("TSS", TSS);


Stacktrace:
 org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:103)
 org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:366)
 org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:468)
 org.apache.jasper.compiler.Compiler.compile(Compiler.java:378)
 org.apache.jasper.compiler.Compiler.compile(Compiler.java:353)
 org.apache.jasper.compiler.Compiler.compile(Compiler.java:340)
 org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:657)
 org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
 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:727)
note The full stack trace of the root cause is available in the Apache Tomcat/7.0.52 (Ubuntu) logs.
Jasper Exception:
http://stackoverflow.com/questions/17518049/org-apache-jasper-jasperexception-unable-to-compile-class-for-jsp

Reference: posted the generated file at:
index_jsp.java :
https://gist.github.com/bshambaugh/7ce93ed6482caf308d9e15905046f871

No comments:

Post a Comment