Re: deploying a war file and starting the application
Christopher I got everthing working Sent from my iPhone On Jan 31, 2011, at 5:03 PM, "Christopher Schultz" wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Robert, > > On 1/31/2011 9:09 AM, robert.jen...@surecomp.com wrote: >> I am trying to figure out why my web services do not work in Tomcat. >> >> The following shows my web service code in eclipse >> >> package com.surecomp.allMATCH.client.webservices; >> >> import javax.jws.*; >> >> import com.surecomp.allMATCH.client.IReasonCode; >> import com.surecomp.allMATCH.client.businesslogic.ReasonCode; >> >> @WebService(serviceName="ReasonCodeService") >> public class ReasonCodeService implements IReasonCode { > > [snip] > >> >>ReasonCodeServiceServlethttp >> >> com.surecomp.allMATCH.client.webservices.ReasonCodeService >>0 >> > > You are trying to deploy a class that is not a servlet. A servlet must > inherit from javax.servlet.Servlet. Are these supposed to be web > services that are deployed into some kind of web services container? If > so, you don't want to configure them in web.xml. Instead, you have to > configure them according to the web service container you are trying to use. > > What web service container are you trying to use? You mentioned earlier > in the thread that WebSphere and WebLogic servers were working well. > Perhaps that's because they provide their own web service containers > while Tomcat does not? > >> When Tomcat starts each web service throws the following error. I understand >> that loadonstart value of zero is default and not needed. Again, the >> war/web.xml is generated by eclipse. >> >> INFO: Marking servlet ReasonCodeServiceServlethttp as unavailable >> Jan 31, 2011 8:53:13 AM org.apache.catalina.core.StandardContext >> loadOnStartup >> SEVERE: Servlet /allMATCHWeb threw load() exception >> java.lang.ClassCastException: >> com.surecomp.allMATCH.client.webservices.ReasonCodeService cannot be cast to >> javax.servlet.Servlet >>at >> org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1048) > > That's because ReasonCodeService (and presumably all your other > services) do not inherit from javax.servlet.Servlet. > >> Is it a requirement for tomcat that a web service implements Servlet? > > Tomcat does not provide any kind of web service container. For that, > you'll need Apache Axis or any number of other fine web service containers. > > - -chris > -BEGIN PGP SIGNATURE- > Version: GnuPG v1.4.10 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ > > iEYEARECAAYFAk1HMWwACgkQ9CaO5/Lv0PCaagCglQvsqA/7dA+7tuuZe8f2BKDI > d+UAn1gDeUruhgCcVjfdY07dxXDLsi48 > =EzXN > -END PGP SIGNATURE- > > - > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > This mail was sent via Mail-SeCure System. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: deploying a war file and starting the application
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Robert, On 1/31/2011 9:09 AM, robert.jen...@surecomp.com wrote: > I am trying to figure out why my web services do not work in Tomcat. > > The following shows my web service code in eclipse > > package com.surecomp.allMATCH.client.webservices; > > import javax.jws.*; > > import com.surecomp.allMATCH.client.IReasonCode; > import com.surecomp.allMATCH.client.businesslogic.ReasonCode; > > @WebService(serviceName="ReasonCodeService") > public class ReasonCodeService implements IReasonCode { [snip] > > ReasonCodeServiceServlethttp > > com.surecomp.allMATCH.client.webservices.ReasonCodeService > 0 > You are trying to deploy a class that is not a servlet. A servlet must inherit from javax.servlet.Servlet. Are these supposed to be web services that are deployed into some kind of web services container? If so, you don't want to configure them in web.xml. Instead, you have to configure them according to the web service container you are trying to use. What web service container are you trying to use? You mentioned earlier in the thread that WebSphere and WebLogic servers were working well. Perhaps that's because they provide their own web service containers while Tomcat does not? > When Tomcat starts each web service throws the following error. I understand > that loadonstart value of zero is default and not needed. Again, the > war/web.xml is generated by eclipse. > > INFO: Marking servlet ReasonCodeServiceServlethttp as unavailable > Jan 31, 2011 8:53:13 AM org.apache.catalina.core.StandardContext loadOnStartup > SEVERE: Servlet /allMATCHWeb threw load() exception > java.lang.ClassCastException: > com.surecomp.allMATCH.client.webservices.ReasonCodeService cannot be cast to > javax.servlet.Servlet > at > org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1048) That's because ReasonCodeService (and presumably all your other services) do not inherit from javax.servlet.Servlet. > Is it a requirement for tomcat that a web service implements Servlet? Tomcat does not provide any kind of web service container. For that, you'll need Apache Axis or any number of other fine web service containers. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk1HMWwACgkQ9CaO5/Lv0PCaagCglQvsqA/7dA+7tuuZe8f2BKDI d+UAn1gDeUruhgCcVjfdY07dxXDLsi48 =EzXN -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: deploying a war file and starting the application
surecomp.allMATCH.client.webservices.UsersService 0 HelpServiceServlethttp com.surecomp.allMATCH.client.webservices.HelpService 0 LogServiceServlethttp com.surecomp.allMATCH.client.webservices.LogService 0 ReasonCodeServiceServlethttp com.surecomp.allMATCH.client.webservices.ReasonCodeService 0 SupportEmailServiceServlethttp com.surecomp.allMATCH.client.webservices.SupportEmailService 0 NewPasswordServiceServlethttp com.surecomp.allMATCH.client.webservices.NewPasswordService 0 LearnedServiceServlethttp com.surecomp.allMATCH.client.webservices.LearnedService 0 CommentsServiceServlethttp com.surecomp.allMATCH.client.webservices.CommentsService 0 LogoutServiceServlethttp com.surecomp.allMATCH.client.webservices.LogoutService 0 InitServlet /InitServlet dataextract.csv /dataextract.csv LearnedExceptionServiceServlethttp /LearnedExceptionService DataExtractServiceServlethttp /DataExtractService ReportServiceServlethttp /ReportService BranchesServiceServlethttp /BranchesService ContactServiceServlethttp /ContactService ArchiveServiceServlethttp /ArchiveService CLSStatusServiceServlethttp /CLSStatusService LanguageServiceServlethttp /LanguageService TradeLocksServiceServlethttp /TradeLocksService PasswordSettingsServiceServlethttp /PasswordSettingsService BICServiceServlethttp /BICService LoginServiceServlethttp /LoginService MonitorServiceServlethttp /MonitorService BrokerServiceServlethttp /BrokerService QueueServiceServlethttp /QueueService HolidayServiceServlethttp /HolidayService CurrencyServiceServlethttp /CurrencyService OverviewServiceServlethttp /OverviewService PauseServiceServlethttp /PauseService CustomerServiceServlethttp /CustomerService MatchingLogicServiceServlethttp /MatchingLogicService MessageServiceServlethttp /MessageService LicenseUsageServiceServlethttp /LicenseUsageService UsersServiceServlethttp /UsersService HelpServiceServlethttp /HelpService LogServiceServlethttp /LogService ReasonCodeServiceServlethttp /ReasonCodeService SupportEmailServiceServlethttp /SupportEmailService NewPasswordServiceServlethttp /NewPasswordService LearnedServiceServlethttp /LearnedService CommentsServiceServlethttp /CommentsService LogoutServiceServlethttp /LogoutService login.html When Tomcat starts each web service throws the following error. I understand that loadonstart value of zero is default and not needed. Again, the war/web.xml is generated by eclipse. INFO: Marking servlet ReasonCodeServiceServlethttp as unavailable Jan 31, 2011 8:53:13 AM org.apache.catalina.core.StandardContext loadOnStartup SEVERE: Servlet /allMATCHWeb threw load() exception java.lang.ClassCastException: com.surecomp.allMATCH.client.webservices.ReasonCodeService cannot be cast to javax.servlet.Servlet at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1048) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:996) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4741) at org.apache.catalina.core.StandardContext$3.call(StandardContext.java:5062) at org.apache.catalina.core.StandardContext$3.call(StandardContext.java:5057) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619) Is it a requirement for tomcat that a web service implements Servlet? Can someone point me to a tomcat web service document or a working example. Have found several on line that do not work (at least with tomcat 7)... Sincerely, Robert Jenkin Surecomp Services, Inc. 2 Hudson Place, 4th Floor Hoboken, NJ 07030 Skype: robert.jenkin Office: 201 217 1437 | Direct: 201 716 1219 | Mobile: 908 251 0537 http://www.Surecomp.com -Original Message- From: Christopher Schultz [mailto:ch...@christopherschultz.net] Sent: Friday, January 28, 2011 2:54 PM To: Tomcat Users List Subject: Re: deploying a war file and starting the application -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Robert, On 1/28/2011 1:09 PM, robert.jen...@surecomp.com wrote: > I have downloaded and configured Tomcat 7. All
Re: deploying a war file and starting the application
On 30 Jan 2011, at 19:29, Christopher Schultz wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Robert, > > On 1/28/2011 6:05 PM, robert.jen...@surecomp.com wrote: >> Well after playing with web.xml I got my app up and partly working in Tomcat >> 7. > > Good that it's working... sorry only partly. > >> When I go to http://localhost:7080/allMATCHWeb the default page is >> loaded. My properties file is loaded and language based webpages >> generated, etc. > > Good. What about your log statements? Where did you eventually find > them? Also, what did you have to do to get your InitServlet to run? > >> Now my issue seems to be with web services. Again the web.xml >> contains the following for each webservice. >> >> >>MessageServiceServlethttp >> >> com.surecomp.allMATCH.client.webservices.MessageService >>0 > > Note that 0 is the default, so you > don't actually need that. > >> >> >> >>MessageServiceServlethttp >>MessageService > > URL patterns are required to start with "/". Didn't we cover this? > >> >> >> Now, these work for webshpere and weblogic, so I am assuming (bad >> thing I know) that the same would work for Tomcat. > > Anything that is written and deployed to specification should work in > all containers. If you are having a problem with a spec-compliant webapp > I assure you it will be fixed ASAP. > >> The log file is producing the following when deploying the services. >> >> INFO: Marking servlet MessageServiceServlethttp as unavailable >> Jan 28, 2011 5:59:40 PM org.apache.catalina.core.StandardContext >> loadOnStartup >> SEVERE: Servlet /allMATCHWeb threw load() exception >> java.lang.ClassCastException: >> com.surecomp.allMATCH.client.webservices.MessageService cannot be cast to >> javax.servlet.Servlet > > I'll bet you have all kinds of inappropriate libraries deployed in > various places. > > What libraries have you added to CATALINA_BASE/lib? > What changes (if any) have you made to CATALINA_BASE/catalina.properties > What libraries do you have in WEB-INF/lib? Also, there was talk of a ServletContextListener - which won't work unless defined as such in web.xml. Unless I've missed this? p > > - -chris > -BEGIN PGP SIGNATURE- > Version: GnuPG v1.4.10 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ > > iEYEARECAAYFAk1FvAUACgkQ9CaO5/Lv0PDJ4ACeJTgnaCkk3Sw6OVUGgJiDHsyA > R6EAni/4kB4tAxa7/PAPHSCX+65u3bJd > =cOMp > -END PGP SIGNATURE- > > - > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: deploying a war file and starting the application
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Robert, On 1/28/2011 6:05 PM, robert.jen...@surecomp.com wrote: > Well after playing with web.xml I got my app up and partly working in Tomcat > 7. Good that it's working... sorry only partly. > When I go to http://localhost:7080/allMATCHWeb the default page is > loaded. My properties file is loaded and language based webpages > generated, etc. Good. What about your log statements? Where did you eventually find them? Also, what did you have to do to get your InitServlet to run? > Now my issue seems to be with web services. Again the web.xml > contains the following for each webservice. > > > MessageServiceServlethttp > > com.surecomp.allMATCH.client.webservices.MessageService > 0 Note that 0 is the default, so you don't actually need that. > > > > MessageServiceServlethttp > MessageService URL patterns are required to start with "/". Didn't we cover this? > > > Now, these work for webshpere and weblogic, so I am assuming (bad > thing I know) that the same would work for Tomcat. Anything that is written and deployed to specification should work in all containers. If you are having a problem with a spec-compliant webapp I assure you it will be fixed ASAP. > The log file is producing the following when deploying the services. > > INFO: Marking servlet MessageServiceServlethttp as unavailable > Jan 28, 2011 5:59:40 PM org.apache.catalina.core.StandardContext loadOnStartup > SEVERE: Servlet /allMATCHWeb threw load() exception > java.lang.ClassCastException: > com.surecomp.allMATCH.client.webservices.MessageService cannot be cast to > javax.servlet.Servlet I'll bet you have all kinds of inappropriate libraries deployed in various places. What libraries have you added to CATALINA_BASE/lib? What changes (if any) have you made to CATALINA_BASE/catalina.properties What libraries do you have in WEB-INF/lib? - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk1FvAUACgkQ9CaO5/Lv0PDJ4ACeJTgnaCkk3Sw6OVUGgJiDHsyA R6EAni/4kB4tAxa7/PAPHSCX+65u3bJd =cOMp -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: deploying a war file and starting the application
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Robert, On 1/28/2011 4:24 PM, robert.jen...@surecomp.com wrote: > webapps > allMATCHWeb > documents > images > lib > logs > META-INFO Is that application-specific? The standard metadata directory for JAR and WAR files is META-INF, not META-INFO. It shouldn't affect anything, here, unless you are trying to use a META-INF/context.xml file to configure your webapp (which obviously won't work if it's META-INFO/context.xml because that's not the right path). > This is the content of the web.xml web.xml looks good to me. A request to http://host/allMATCHWeb/ should be redirected (or at least internally forwarded) to http://host/allMATCHWeb/login.html (due to your welcome-file-list setting). > The log files produced by Tomcat contain the following > > catalina.2011-01-28.log contains > > [snip] > > INFO: Deploying web application archive allMATCHWeb.war > > [snip] > > INFO: Server startup in 18243 ms Good. This indicates that the server did start, and your webapp did deploy. If you've set the swallowOutput="true" in your , your stdout log messages will go to a different logger. Are those all the log files created in the logs/ directory? - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk1FurcACgkQ9CaO5/Lv0PCkOgCfYlrMpitans7w7QL81s/Pt80T ZQEAoKBBZa4wPtdbkJMTJzlzjfWKgbYd =4RoJ -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: deploying a war file and starting the application
binLmJ2Fr2lkQ.bin Description: PGP/MIME version identification
RE: deploying a war file and starting the application
> From: robert.jen...@surecomp.com [mailto:robert.jen...@surecomp.com] > Subject: RE: deploying a war file and starting the application > > MessageServiceServlethttp > MessageService > > Now, these work for webshpere and weblogic, so I am assuming (bad > thing I know) that the same would work for Tomcat. You already answered your own question in your first query, and Chris S explained why WebSphere and WebLogic are cheating: > > The first issue I had was with url-pattern. It appears that Tomcat > > requires they start with a slash (/). I made the change and I no longer > > receive any errors while starting Tomcat. > This is a spec requirement, not a Tomcat requirement. Other containers > may be more lenient. You should read the servlet spec. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
RE: deploying a war file and starting the application
Well after playing with web.xml I got my app up and partly working in Tomcat 7. When I go to http://localhost:7080/allMATCHWeb the default page is loaded. My properties file is loaded and language based webpages generated, etc. Now my issue seems to be with web services. Again the web.xml contains the following for each webservice. MessageServiceServlethttp com.surecomp.allMATCH.client.webservices.MessageService 0 MessageServiceServlethttp MessageService Now, these work for webshpere and weblogic, so I am assuming (bad thing I know) that the same would work for Tomcat. The log file is producing the following when deploying the services. INFO: Marking servlet MessageServiceServlethttp as unavailable Jan 28, 2011 5:59:40 PM org.apache.catalina.core.StandardContext loadOnStartup SEVERE: Servlet /allMATCHWeb threw load() exception java.lang.ClassCastException: com.surecomp.allMATCH.client.webservices.MessageService cannot be cast to javax.servlet.Servlet at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1048) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:996) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4741) at org.apache.catalina.core.StandardContext$3.call(StandardContext.java:5062) at org.apache.catalina.core.StandardContext$3.call(StandardContext.java:5057) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619) Jan 28, 2011 5:59:40 PM org.apache.catalina.core.ApplicationContext log Sincerely, Robert Jenkin Surecomp Services, Inc. 2 Hudson Place, 4th Floor Hoboken, NJ 07030 Skype: robert.jenkin Office: 201 217 1437 | Direct: 201 716 1219 | Mobile: 908 251 0537 http://www.Surecomp.com -Original Message- From: Christopher Schultz [mailto:ch...@christopherschultz.net] Sent: Friday, January 28, 2011 2:54 PM To: Tomcat Users List Subject: Re: deploying a war file and starting the application -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Robert, On 1/28/2011 1:09 PM, robert.jen...@surecomp.com wrote: > I have downloaded and configured Tomcat 7. All appears to be working. Glad to hear it! > I have deployed a war file that currently works with WebSphere 7 and > WebLogic 11g. > > The first issue I had was with url-pattern. It appears that Tomcat > requires they start with a slash (/). I made the change and I no longer > receive any errors while starting Tomcat. This is a spec requirement, not a Tomcat requirement. Other containers may be more lenient. > The following image shows the startup window and that my war is being > deployed. Within the webapps directory a directory containing my webapp > is created. Images are stripped from posts to the list. Can you post it somewhere online and give us a link? Or, just copy/paste any relevant content from your screen? > My initial servlet is called InitServlet and it is marked as > load-on-startup (please see following image) . Ditto. > I have two questions > > 1) If I type http://localhost:7080/allMATCHWeb in to a browser > shouldn’t see this login.html page? I don’t… however I can access it by > http://localhost:7080/allMATCHWeb/login.html You'll have to provide your web.xml for us to know when you need authentication challenges. Are you using container-managed authentication? > 2) The load-on-start InitServlet class is not being executed as I > have no logs generated or any other startup items handled, any ideas? Again, including web.xml should help. Note that using an "InitServlet" hasn't been recommended since the addition of the ServletContextListener interface a long time ago. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk1DHsYACgkQ9CaO5/Lv0PBhSQCeNtR93FGfQecpwJ/n02ioUhpP x2MAn2WmpQ0vzJ3YAbrMQrE9SnMmOq++ =WYyb -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org This mail was sent via Mail-SeCure System.
RE: deploying a war file and starting the application
che.catalina.core.ApplicationContext log INFO: SessionListener: contextInitialized() Jan 28, 2011 4:22:54 PM org.apache.catalina.core.StandardContext filterStart FINE: Starting filters Jan 28, 2011 4:22:54 PM org.apache.catalina.core.StandardContext filterStart FINE: Starting filter 'Compression Filter' Jan 28, 2011 4:22:54 PM org.apache.catalina.core.StandardContext filterStart FINE: Starting filter 'Set Character Encoding' Jan 28, 2011 4:22:54 PM org.apache.catalina.core.StandardContext filterStart FINE: Starting filter 'Timing filter' Jan 28, 2011 4:22:54 PM org.apache.catalina.core.StandardContext filterStart FINE: Starting filter 'Request Dumper Filter' Jan 28, 2011 4:22:54 PM org.apache.catalina.core.StandardContext listenerStart FINE: Sending application start events Jan 28, 2011 4:22:54 PM org.apache.catalina.core.StandardContext filterStart FINE: Starting filters Manager.2011-01-28.log contains Jan 28, 2011 4:22:54 PM org.apache.catalina.core.StandardContext listenerStart FINE: Sending application start events Jan 28, 2011 4:22:54 PM org.apache.catalina.core.StandardContext filterStart FINE: Starting filters Jan 28, 2011 4:22:54 PM org.apache.catalina.core.StandardContext filterStart FINE: Starting filter 'CSRF' Sincerely, Robert Jenkin Surecomp Services, Inc. 2 Hudson Place, 4th Floor Hoboken, NJ 07030 Skype: robert.jenkin Office: 201 217 1437 | Direct: 201 716 1219 | Mobile: 908 251 0537 http://www.Surecomp.com -----Original Message----- From: Mark Thomas [mailto:ma...@apache.org] Sent: Friday, January 28, 2011 4:15 PM To: Tomcat Users List Subject: Re: deploying a war file and starting the application On 28/01/2011 21:12, robert.jen...@surecomp.com wrote: > I have modified the InitServlet class (removed everything). The following is > the complete code of InitServlet > > package com.surecomp.allMATCH.client; > > import javax.servlet.ServletException; > import javax.servlet.ServletInputStream; > import javax.servlet.http.HttpServletRequest; > import javax.servlet.http.HttpServletResponse; > > > public class InitServlet extends javax.servlet.http.HttpServlet implements > javax.servlet.Servlet { > > public void destroy() { > } > > public void init() throws ServletException { > System.out.println("Loaded"); > } > > } > > I have compiled it and placed the class file into > C:\Downloads\tomcat-7\apache-tomcat-7.0.6\webapps\allMATCHWeb\WEB-INF\classes\com\surecomp\allMATCH\client > and I expected to see the System.out.println either on the screen or in some > log file. I do not see it anywhere. web.xml is located where? What is in the Tomcat log files? Mark - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org This mail was sent via Mail-SeCure System.
Re: deploying a war file and starting the application
On 28/01/2011 21:12, robert.jen...@surecomp.com wrote: > I have modified the InitServlet class (removed everything). The following is > the complete code of InitServlet > > package com.surecomp.allMATCH.client; > > import javax.servlet.ServletException; > import javax.servlet.ServletInputStream; > import javax.servlet.http.HttpServletRequest; > import javax.servlet.http.HttpServletResponse; > > > public class InitServlet extends javax.servlet.http.HttpServlet implements > javax.servlet.Servlet { > > public void destroy() { > } > > public void init() throws ServletException { > System.out.println("Loaded"); > } > > } > > I have compiled it and placed the class file into > C:\Downloads\tomcat-7\apache-tomcat-7.0.6\webapps\allMATCHWeb\WEB-INF\classes\com\surecomp\allMATCH\client > and I expected to see the System.out.println either on the screen or in some > log file. I do not see it anywhere. web.xml is located where? What is in the Tomcat log files? Mark - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: deploying a war file and starting the application
I understand the issues and recommendations being made. But, possibly a little more detail in the app is needed. The web pages provided with the app are static and created in English. Upon starting the web app new pages are created that are language based. When deployed the war is always exploded so that access to the scripts, styles, pages, etc. is available to the web app to make new ones and or modify existing ones. Data for the web pages is provided by means of web services where the client browser IE/Firefox makes calls to web services for data (loading/saving) and business logic. Currently the same WAR produced by Ant build script is used in Websphere 7 and WebLogic 11g without issue or modifications needed. We have a customer that has asked me to support Tomcat (assume the cost of Webshere/Weblogic is an issue). Having provide a brief description of system. I have tried the following. I have modified the InitServlet class (removed everything). The following is the complete code of InitServlet package com.surecomp.allMATCH.client; import javax.servlet.ServletException; import javax.servlet.ServletInputStream; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; public class InitServlet extends javax.servlet.http.HttpServlet implements javax.servlet.Servlet { public void destroy() { } public void init() throws ServletException { System.out.println("Loaded"); } } I have compiled it and placed the class file into C:\Downloads\tomcat-7\apache-tomcat-7.0.6\webapps\allMATCHWeb\WEB-INF\classes\com\surecomp\allMATCH\client and I expected to see the System.out.println either on the screen or in some log file. I do not see it anywhere. Sincerely, Robert Jenkin Surecomp Services, Inc. 2 Hudson Place, 4th Floor Hoboken, NJ 07030 Skype: robert.jenkin Office: 201 217 1437 | Direct: 201 716 1219 | Mobile: 908 251 0537 http://www.Surecomp.com -Original Message- From: Mark Thomas [mailto:ma...@apache.org] Sent: Friday, January 28, 2011 4:00 PM To: Tomcat Users List Subject: Re: deploying a war file and starting the application On 28/01/2011 20:54, Caldarale, Charles R wrote: >> From: robert.jen...@surecomp.com [mailto:robert.jen...@surecomp.com] >> Subject: RE: deploying a war file and starting the application > >> I make reference to getRealPath to load a property file. > > It's definitely a bad thing to do. You should be using > ServletContext#getResourceAsStream(). +1. That will also mean you app will work (well, that part of it at least) as an exploded directory or as a WAR file. Mark - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org This mail was sent via Mail-SeCure System.
Re: deploying a war file and starting the application
On 28/01/2011 20:54, Caldarale, Charles R wrote: >> From: robert.jen...@surecomp.com [mailto:robert.jen...@surecomp.com] >> Subject: RE: deploying a war file and starting the application > >> I make reference to getRealPath to load a property file. > > It's definitely a bad thing to do. You should be using > ServletContext#getResourceAsStream(). +1. That will also mean you app will work (well, that part of it at least) as an exploded directory or as a WAR file. Mark - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: deploying a war file and starting the application
> From: robert.jen...@surecomp.com [mailto:robert.jen...@surecomp.com] > Subject: RE: deploying a war file and starting the application > I make reference to getRealPath to load a property file. It's definitely a bad thing to do. You should be using ServletContext#getResourceAsStream(). That will let your code avoid the assumption that there even is an underlying file system (nothing in the servlet spec requires it), or, if it exists, that the container will allow you to access the file system (the servlet spec only requires that the container provide access to a temporary work area). - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
RE: deploying a war file and starting the application
Chuck, I understand the ServletConextListener and will investigate the recommendation to see if ServletConextListener is compatible with WebSphere 7 and WebLogic 11g as well and if it is I will make the change. I make reference to getRealPath to load a property file. I have not had issue with this in other environments, not to say this is not a bad thing to do. Sincerely, Robert Jenkin Surecomp Services, Inc. 2 Hudson Place, 4th Floor Hoboken, NJ 07030 Skype: robert.jenkin Office: 201 217 1437 | Direct: 201 716 1219 | Mobile: 908 251 0537 http://www.Surecomp.com -Original Message- From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] Sent: Friday, January 28, 2011 3:36 PM To: Tomcat Users List Subject: RE: deploying a war file and starting the application > From: robert.jen...@surecomp.com [mailto:robert.jen...@surecomp.com] > Subject: RE: deploying a war file and starting the application > the initservlet is just a means to initialize the application. Which, as Chris S noted earlier, should be done by a ServletContextListener, not a servlet. > The writing of a log file is not to a directory within tomcat. That's good. Why do you have a reference to ServletContext#getRealPath()? That's very, very risky. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. This mail was sent via Mail-SeCure System.
RE: deploying a war file and starting the application
> From: robert.jen...@surecomp.com [mailto:robert.jen...@surecomp.com] > Subject: RE: deploying a war file and starting the application > If tomcat is not able to load my class (initservlet) or an error > has occurred in the class I would expect some type of logging > indicating an error. Make sure you look in _all_ the of the Tomcat-generated log files, not where you think you're writing logs for the webapp of interest. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
RE: deploying a war file and starting the application
> From: Caldarale, Charles R > Subject: RE: deploying a war file and starting the application > > The writing of a log file is not to a directory within tomcat. On rereading your original message, the above statement does not appear to be operative: > > During startup of my servlet I generate log files and these logs > > files should appear in > > C:\Downloads\tomcat-7\apache-tomcat-7.0.6\webapps\allMATCHWeb\logs > > on my local disk. Which should we believe? - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
RE: deploying a war file and starting the application
> From: robert.jen...@surecomp.com [mailto:robert.jen...@surecomp.com] > Subject: RE: deploying a war file and starting the application > the initservlet is just a means to initialize the application. Which, as Chris S noted earlier, should be done by a ServletContextListener, not a servlet. > The writing of a log file is not to a directory within tomcat. That's good. Why do you have a reference to ServletContext#getRealPath()? That's very, very risky. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
RE: deploying a war file and starting the application
Mark, I made the change regarding web-app in the web.xml and same results. The piece I find most interesting is the lack of information. If tomcat is not able to load my class (initservlet) or an error has occurred in the class I would expect some type of logging indicating an error. Sincerely, Robert Jenkin Surecomp Services, Inc. 2 Hudson Place, 4th Floor Hoboken, NJ 07030 Skype: robert.jenkin Office: 201 217 1437 | Direct: 201 716 1219 | Mobile: 908 251 0537 http://www.Surecomp.com -Original Message- From: Mark Thomas [mailto:ma...@apache.org] Sent: Friday, January 28, 2011 3:13 PM To: Tomcat Users List Subject: Re: deploying a war file and starting the application On 28/01/2011 20:03, robert.jen...@surecomp.com wrote: > Christopher, > > Thanks for your assistance. > > Here is my web.xml > > > http://java.sun.com/xml/ns/javaee"; > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; version="2.5" > id="web-app_1"> That does not look quite right to me. I'd normally expect to see the following: http://java.sun.com/xml/ns/javaee"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"; version="2.5"> Tomcat is usually pretty tolerant of that sort of thing but worth checking anyway. > allMATCHWeb > > InitServlet > com.surecomp.allMATCH.client.InitServlet > 1 > > > InitServlet > /InitServlet > That looks OK. Not the recommended way to do things, but it should work. > > /login.html As per the Servlet specification, welcome files should not have leading '/' characters. > > > > > This is the InitServlet class declaration > public class InitServlet extends javax.servlet.http.HttpServlet > implements javax.servlet.Servlet, Internationalizable > > This is the start of init() method > > public void init() throws ServletException { > synchronized (this) { > if (initialized || initializing) return; > initializing = true; > } > logger = new Logging(); > contextPath = getServletContext().getRealPath("/"); getRealPath() is not guaranteed to return a file system path. Also writing log files inside the web app is usually a bad idea since you lose the logs when the app is undeployed. Mark - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org This mail was sent via Mail-SeCure System.
RE: deploying a war file and starting the application
Mark, That’s for input.. the initservlet is just a means to initialize the application. The writing of a log file is not to a directory within tomcat. It is a directory outside of the environment. This information (the directory location) is supplied via property file. Which I doubt is being loaded. Sincerely, Robert Jenkin Surecomp Services, Inc. 2 Hudson Place, 4th Floor Hoboken, NJ 07030 Skype: robert.jenkin Office: 201 217 1437 | Direct: 201 716 1219 | Mobile: 908 251 0537 http://www.Surecomp.com -Original Message- From: Mark Thomas [mailto:ma...@apache.org] Sent: Friday, January 28, 2011 3:13 PM To: Tomcat Users List Subject: Re: deploying a war file and starting the application On 28/01/2011 20:03, robert.jen...@surecomp.com wrote: > Christopher, > > Thanks for your assistance. > > Here is my web.xml > > > http://java.sun.com/xml/ns/javaee"; > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; version="2.5" > id="web-app_1"> That does not look quite right to me. I'd normally expect to see the following: http://java.sun.com/xml/ns/javaee"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"; version="2.5"> Tomcat is usually pretty tolerant of that sort of thing but worth checking anyway. > allMATCHWeb > > InitServlet > com.surecomp.allMATCH.client.InitServlet > 1 > > > InitServlet > /InitServlet > That looks OK. Not the recommended way to do things, but it should work. > > /login.html As per the Servlet specification, welcome files should not have leading '/' characters. > > > > > This is the InitServlet class declaration > public class InitServlet extends javax.servlet.http.HttpServlet > implements javax.servlet.Servlet, Internationalizable > > This is the start of init() method > > public void init() throws ServletException { > synchronized (this) { > if (initialized || initializing) return; > initializing = true; > } > logger = new Logging(); > contextPath = getServletContext().getRealPath("/"); getRealPath() is not guaranteed to return a file system path. Also writing log files inside the web app is usually a bad idea since you lose the logs when the app is undeployed. Mark - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org This mail was sent via Mail-SeCure System.
Re: deploying a war file and starting the application
On 28/01/2011 20:03, robert.jen...@surecomp.com wrote: > Christopher, > > Thanks for your assistance. > > Here is my web.xml > > > http://java.sun.com/xml/ns/javaee"; > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; version="2.5" > id="web-app_1"> That does not look quite right to me. I'd normally expect to see the following: http://java.sun.com/xml/ns/javaee"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"; version="2.5"> Tomcat is usually pretty tolerant of that sort of thing but worth checking anyway. > allMATCHWeb > > InitServlet > com.surecomp.allMATCH.client.InitServlet > 1 > > > InitServlet > /InitServlet > That looks OK. Not the recommended way to do things, but it should work. > > /login.html As per the Servlet specification, welcome files should not have leading '/' characters. > > > > > This is the InitServlet class declaration > public class InitServlet extends javax.servlet.http.HttpServlet > implements javax.servlet.Servlet, Internationalizable > > This is the start of init() method > > public void init() throws ServletException { > synchronized (this) { > if (initialized || initializing) return; > initializing = true; > } > logger = new Logging(); > contextPath = getServletContext().getRealPath("/"); getRealPath() is not guaranteed to return a file system path. Also writing log files inside the web app is usually a bad idea since you lose the logs when the app is undeployed. Mark - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: deploying a war file and starting the application
Christopher, Thanks for your assistance. Here is my web.xml http://java.sun.com/xml/ns/javaee"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; version="2.5" id="web-app_1"> allMATCHWeb InitServlet com.surecomp.allMATCH.client.InitServlet 1 InitServlet /InitServlet /login.html This is the InitServlet class declaration public class InitServlet extends javax.servlet.http.HttpServlet implements javax.servlet.Servlet, Internationalizable This is the start of init() method public void init() throws ServletException { synchronized (this) { if (initialized || initializing) return; initializing = true; } logger = new Logging(); contextPath = getServletContext().getRealPath("/"); contextPath = getPathWithSeparator(contextPath); oLoaderStatic = new LoaderStatic(); try { String sLogging = Configuration.getLogging(); Date date = new Date(); SimpleDateFormat formatter = new SimpleDateFormat("MMdd"); logger.setapplicationSegment("allMATCHWeb"); logger.setSite(Logging.Client); logger.LogSetup(Configuration.getLoggingLocation().concat("//allMATCHWeb_" + formatter.format(date) + ".log"),sLogging); logger.log("Configuration loaded from the file: ["+Configuration.getPropertiesLocation()+"]"); } catch (Throwable th) { th.printStackTrace(); System.out.println("Error initializing logger."); try { logger.log("Error initializing logger.",th); logger.close(); } catch (Throwable t) {} return; } Again, thanks for any insight or assistance... Sincerely, Robert Jenkin Surecomp Services, Inc. 2 Hudson Place, 4th Floor Hoboken, NJ 07030 Skype: robert.jenkin Office: 201 217 1437 | Direct: 201 716 1219 | Mobile: 908 251 0537 http://www.Surecomp.com -Original Message- From: Christopher Schultz [mailto:ch...@christopherschultz.net] Sent: Friday, January 28, 2011 2:54 PM To: Tomcat Users List Subject: Re: deploying a war file and starting the application -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Robert, On 1/28/2011 1:09 PM, robert.jen...@surecomp.com wrote: > I have downloaded and configured Tomcat 7. All appears to be working. Glad to hear it! > I have deployed a war file that currently works with WebSphere 7 and > WebLogic 11g. > > The first issue I had was with url-pattern. It appears that Tomcat > requires they start with a slash (/). I made the change and I no longer > receive any errors while starting Tomcat. This is a spec requirement, not a Tomcat requirement. Other containers may be more lenient. > The following image shows the startup window and that my war is being > deployed. Within the webapps directory a directory containing my webapp > is created. Images are stripped from posts to the list. Can you post it somewhere online and give us a link? Or, just copy/paste any relevant content from your screen? > My initial servlet is called InitServlet and it is marked as > load-on-startup (please see following image) . Ditto. > I have two questions > > 1) If I type http://localhost:7080/allMATCHWeb in to a browser > shouldn’t see this login.html page? I don’t… however I can access it by > http://localhost:7080/allMATCHWeb/login.html You'll have to provide your web.xml for us to know when you need authentication challenges. Are you using container-managed authentication? > 2) The load-on-start InitServlet class is not being executed as I > have no logs generated or any other startup items handled, any ideas? Again, including web.xml should help. Note that using an "InitServlet" hasn't been recommended since the addition of the ServletContextListener interface a long time ago. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk1DHsYACgkQ9CaO5/Lv0PBhSQCeNtR93FGfQecpwJ/n02ioUhpP x2MAn2WmpQ0vzJ3YAbrMQrE9SnMmOq++ =WYyb -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org This mail was sent via Mail-SeCure System.
Re: deploying a war file and starting the application
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Robert, On 1/28/2011 1:09 PM, robert.jen...@surecomp.com wrote: > I have downloaded and configured Tomcat 7. All appears to be working. Glad to hear it! > I have deployed a war file that currently works with WebSphere 7 and > WebLogic 11g. > > The first issue I had was with url-pattern. It appears that Tomcat > requires they start with a slash (/). I made the change and I no longer > receive any errors while starting Tomcat. This is a spec requirement, not a Tomcat requirement. Other containers may be more lenient. > The following image shows the startup window and that my war is being > deployed. Within the webapps directory a directory containing my webapp > is created. Images are stripped from posts to the list. Can you post it somewhere online and give us a link? Or, just copy/paste any relevant content from your screen? > My initial servlet is called InitServlet and it is marked as > load-on-startup (please see following image) . Ditto. > I have two questions > > 1) If I type http://localhost:7080/allMATCHWeb in to a browser > shouldn’t see this login.html page? I don’t… however I can access it by > http://localhost:7080/allMATCHWeb/login.html You'll have to provide your web.xml for us to know when you need authentication challenges. Are you using container-managed authentication? > 2) The load-on-start InitServlet class is not being executed as I > have no logs generated or any other startup items handled, any ideas? Again, including web.xml should help. Note that using an "InitServlet" hasn't been recommended since the addition of the ServletContextListener interface a long time ago. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk1DHsYACgkQ9CaO5/Lv0PBhSQCeNtR93FGfQecpwJ/n02ioUhpP x2MAn2WmpQ0vzJ3YAbrMQrE9SnMmOq++ =WYyb -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
deploying a war file and starting the application
Hello all, hope all of you are having a good day.. I have downloaded and configured Tomcat 7. All appears to be working. I have deployed a war file that currently works with WebSphere 7 and WebLogic 11g. The first issue I had was with url-pattern. It appears that Tomcat requires they start with a slash (/). I made the change and I no longer receive any errors while starting Tomcat. The following image shows the startup window and that my war is being deployed. Within the webapps directory a directory containing my webapp is created. [cid:image001.png@01CBBEEA.D5E12D40] My initial servlet is called InitServlet and it is marked as load-on-startup (please see following image) . [cid:image002.png@01CBBEEB.02716910] During startup of my servlet I generate log files and these logs files should appear in C:\Downloads\tomcat-7\apache-tomcat-7.0.6\webapps\allMATCHWeb\logs on my local disk. After Tomcat is started I am able to access the manager and admin applications. Also within my web.xml I have a welcome file setup (see image below) [cid:image003.png@01CBBEEB.59FBD760] I have two questions 1) If I type http://localhost:7080/allMATCHWeb in to a browser shouldn't see this login.html page? I don't... however I can access it by http://localhost:7080/allMATCHWeb/login.html 2) The load-on-start InitServlet class is not being executed as I have no logs generated or any other startup items handled, any ideas? I have reviewed the Tomcat logs and have not found any errors or warning messages indicating any issue with class loading, security access, etc. Thanks in advance for any help/assistance you may be able to provide. Bob Jenkin This mail was sent via Mail-SeCure System.