1,105,197 Community Members

Migrating from GlassFish to Tomcat

Member Avatar
wolwayne
Newbie Poster
14 posts since Mar 2012
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Hi,
I have developed a web application using NetBeans and GlassFish v3. Now I want to change to Apache Tomcat, beacause of the unavalabilty of free GlassFish web hosting.

So, my question is that, can I change my fully built web application to Apache Tomcat from GlassFish and If yes how?
I have not used struts or anything. My project only contains jsp files, servlets and java class files.

I have googled for the same and most results show how to switch from tomcat to glassfish, opposite of what I am looking for.

P.S. If you can suggest a free or trial web hosting service for glassfish and mysql with upto 50MB, nothing else will be required.

Many Thanks,
-Wayne

Member Avatar
peter_budo
Code tags enforcer
7,933 posts since Dec 2004
Reputation Points: 2,502 [?]
Q&As Helped to Solve: 1,028 [?]
Skill Endorsements: 66 [?]
Moderator
Featured
 
0
 

Look back step how you setup GlassFish to be your application server and change it to Tomcat, also make sure that your application produces WAR file that you can then deploy on your remote server

Member Avatar
wolwayne
Newbie Poster
14 posts since Mar 2012
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

As you suggested, I tried to change the server with Tomcat by using Netbeans options. And it looks like that it worked (not sure , b'coz it appears too easy to be true to me)
However, on the very first page Tomcat threw an error-

org.apache.jasper.JasperException: /loginbean.jsp (line: 13, column: 69) Attribute value request.getParameter("userName") is quoted with " which must be escaped when used within the value
	org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:42)
	org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:408)
	org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:89)
	org.apache.jasper.compiler.Parser.parseAttributeValue(Parser.java:280)
	org.apache.jasper.compiler.Parser.parseAttribute(Parser.java:229)
	org.apache.jasper.compiler.Parser.parseAttributes(Parser.java:162)
	org.apache.jasper.compiler.Parser.parseAttributes(Parser.java:153)
	org.apache.jasper.compiler.Parser.parseSetProperty(Parser.java:913)
	org.apache.jasper.compiler.Parser.parseStandardAction(Parser.java:1134)
	org.apache.jasper.compiler.Parser.parseElements(Parser.java:1451)
	org.apache.jasper.compiler.Parser.parseBody(Parser.java:1664)
	org.apache.jasper.compiler.Parser.parseOptionalBody(Parser.java:1002)
	org.apache.jasper.compiler.Parser.parseUseBean(Parser.java:958)
	org.apache.jasper.compiler.Parser.parseStandardAction(Parser.java:1136)
	org.apache.jasper.compiler.Parser.parseElements(Parser.java:1451)
	org.apache.jasper.compiler.Parser.parse(Parser.java:138)
	org.apache.jasper.compiler.ParserController.doParse(ParserController.java:242)
	org.apache.jasper.compiler.ParserController.parse(ParserController.java:102)
	org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:198)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:373)
	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:646)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

But the same code is working perfectly with Glassfish.

Member Avatar
peter_budo
Code tags enforcer
7,933 posts since Dec 2004
Reputation Points: 2,502 [?]
Q&As Helped to Solve: 1,028 [?]
Skill Endorsements: 66 [?]
Moderator
Featured
 
0
 

Without actual code it is hard to determine what is wrong but common mistake can be something along this

<jsp:setProperty name="logdetails" property="Username" value="<%=request.getParameter("Username")%>" />

that should be written as

<jsp:setProperty name="logdetails" property="Username" value='<%=request.getParameter("Username")%>' />
Member Avatar
wolwayne
Newbie Poster
14 posts since Mar 2012
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Worked perfectly, thank you so much.
Sorry for not posting code.

Problem Solved.

Question Answered as of 2 Years Ago by peter_budo
Member Avatar
wolwayne
Newbie Poster
14 posts since Mar 2012
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

In case if someone else is also looking for free/trial host, I found two, worth a try.
http://www.eatj.com/
and
http://www.jelastic.net

You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: