We're a community of 1076K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,075,612 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Migrating from GlassFish to Tomcat

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

2
Contributors
5
Replies
3 Days
Discussion Span
1 Year Ago
Last Updated
7
Views
Question
Answered
wolwayne
Newbie Poster
12 posts since Mar 2012
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 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

peter_budo
Code tags enforcer
Moderator
15,787 posts since Dec 2004
Reputation Points: 2,867
Solved Threads: 944
Skill Endorsements: 49

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.

wolwayne
Newbie Poster
12 posts since Mar 2012
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 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")%>' />
peter_budo
Code tags enforcer
Moderator
15,787 posts since Dec 2004
Reputation Points: 2,867
Solved Threads: 944
Skill Endorsements: 49

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

Problem Solved.

wolwayne
Newbie Poster
12 posts since Mar 2012
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
Question Answered as of 1 Year Ago by peter_budo

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

wolwayne
Newbie Poster
12 posts since Mar 2012
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

This question has already been solved: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.3005 seconds using 2.69MB