Re: How to get rid of that Tomcat page? Please help!

2014-11-23 Thread Neven Cvetkovic
Richard,

My apologies, I misread your email. You did try your website from different
browsers and different computers, an it works ok. My initial response did
not assume that.

Firstly, Tomcat is a server product that hosts applications. The page you
are seeing is the default Tomcat page.

Here are few questions:
- did you setup any proxy servers?
- did you search your mac for any installed tomcat product (to make sure it
is coming from your local box)?
- did you try different browsers (to make sure it is not a cached page)?
- check your local /etc/hosts file, is your website listed in that file?
- what happens if you try curl from command line, e.g. curl
http://yoursite.com? Do you still see tomcat content?
- if you do nslookup yoursite.com from your computer and other computers,
is it the same ip address? Try same with ping yoursite.com

Hope that gives us some more information!

Thanks
Neven

On Nov 23, 2014 8:51 AM, Neven Cvetkovic neven.cvetko...@gmail.com
wrote:

 Richard,

 On Nov 23, 2014 6:04 AM, Richard Aubry aubry...@gmail.com wrote:
 
  A few days ago, when I tried to access a web site that I frequently
access, I obtained an Apache Tomcat page that said: If you're seeing this
page via a web browser, it means you've set up Tomcat successfully.
Congratulations!
 

 You are seeing a default Tomcat page (i.e. Root application). It seems
that the website you frequent uses Tomcat. They probably upgraded Tomcat
incorrectly and used Tomcat default page.

 There is nothing wrong with your computer. You could probably email
website administrators about the problem. It is also likely the problem is
going to get fixed by the time you see this message :)

 Another thing to try - use a different computer, or your phone to access
this website.

 Good luck!

  But I have never set up Tomcat, I don't know what is Tomcat and I just
want to get rid of that thing and to be able to access that web site again.
I don't know how that thing took control of my Mac. Since that first time,
I have never been able to access my web site. It's only happening on my
Mac; on any other computer I can access the site without problems.
 
  Could someone tell me how to get rid of that?
 
  Richard Aubry
  -
  To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
  For additional commands, e-mail: users-h...@tomcat.apache.org
 


Re: Tomcat 8 does not start with java 8 on YOSEMITE

2014-11-23 Thread Ameer Mawia
Hi Fabio,

There seems to be an issue with update 40 Early Access release of
jre/jdk8(1.8.0_40). Compared with update 20 of jre/jdk8 release, you will
see following lines of code has been added to getPlatfromMBeanServer:

*for (final PlatformManagedObject o :*
*
 ExtendedPlatformComponent.getMXBeans()) {*
*if (!platformMBeanServer.isRegistered(o.getObjectName()))
{*
*addMXBean(platformMBeanServer, o);*
*}*

But if you look into the accompanied rt.jar of the jre, this newly
introduced class(*ExtendedPlatformComponent*) can NO-WHERE be found.

This issue, seems to be there across all the JAVA_VERSION=1.8.0_40 EA
release, irrespective of platform.

Your remedy is to move back to a stable release. Latest stable release
seems to be Java SE 8u25
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
.

Regards,
Ameer Mawia

On Sun, Nov 23, 2014 at 4:09 AM, Fabio Ricci fabio.ri...@semweb.ch wrote:

  Dear tomcat community

 Maybe someone did have this before (and possibly solved it)

 On a mac book pro/JOSEMITE I installed Java 8 1.8.0_40-ea with JDK.
 My $JAVA_HOME is
 /Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home

 Then I downloaded a tomcat 8 core from
 http://tomcat.apache.org/download-80.cgi
 When I start this tomcat 8 I get the following Java exceptio - see below.

 With this Java 8 also my older tomcat 7 throws the same exception.
 The official oracle java test page (
 https://www.java.com/en/download/installed.jsp) says, I have already java
 uptodate.

 The exception:
 It seems that sun/management/ExtendedPlatformComponent be not part of
 tomcat 8 nor java 8 ...

 Does anyone have some hints for me? I cannot figure our what is wrong ...
 Thank you very much in advance!

 Kind regards
 Fabio


 PS: The exception on start (/bin/startup.sh):
 22-Nov-2014 18:43:02.218 SEVERE [main]
 org.apache.tomcat.util.digester.Digester.startElement Begin event threw
 error
 * java.lang.NoClassDefFoundError: sun/management/ExtendedPlatformComponent*
 at
 java.lang.management.ManagementFactory.getPlatformMBeanServer(ManagementFactory.java:494)
 at
 org.apache.tomcat.util.modeler.Registry.getMBeanServer(Registry.java:443)
 at
 org.apache.catalina.mbeans.MBeanUtils.createServer(MBeanUtils.java:580)
 at
 org.apache.catalina.mbeans.MBeanUtils.clinit(MBeanUtils.java:77)
 at
 org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.clinit(GlobalResourcesLifecycleListener.java:66)
 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
 Method)
 at
 sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
 at
 sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
 at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
 at java.lang.Class.newInstance(Class.java:442)
 at
 org.apache.tomcat.util.digester.ObjectCreateRule.begin(ObjectCreateRule.java:117)
 at
 org.apache.tomcat.util.digester.Digester.startElement(Digester.java:1184)
 at
 com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:509)
 at
 com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:182)
 at
 com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1343)
 at
 com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2786)
 at
 com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)
 at
 com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
 at
 com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)
 at
 com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)
 at
 com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
 at
 com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
 at
 com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:649)
 at
 org.apache.tomcat.util.digester.Digester.parse(Digester.java:1457)
 at org.apache.catalina.startup.Catalina.load(Catalina.java:551)
 at org.apache.catalina.startup.Catalina.load(Catalina.java:599)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
 at
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at 

Re: Tomcat 8 does not start with java 8 on YOSEMITE

2014-11-23 Thread Fabio Ricci
Hi Ameer

thank you very much!

Indeed this seems to be an issue in for OS X. They just forgot to check-in the 
code ;)
I will follow your suggestion.

Linux is working fine with Java 8, tomcat 8.

Regards
Fabio


Kind regards / Meilleures salutations / Freundliche Grüsse  
Fabio Ricci
semweb  
Semantic Web Technologies · Records Management
Software systems · ICT coaching · ICT Projects leading  
www.semweb.ch

Weinmanngasse 26  
CH-8700 Küsnacht ZH (Switzerland)

Tel.

+41 (076) 5281961  
+39 (389) 0681334

Skype:

semweb-llc

Confidentiality Warning: This message and any attachments are intended only for 
the use of the intended recipients, are confidential and maybe privileged. If 
you are not the intended recipient, you are hereby notified that any review, 
retransmission, conversion to hard copy, copying, circulation or other use of 
this message and any attachments is strictly prohibited. If you are not the 
intended recipient, please notify the sender immediately by return email, and 
delete this message and any attachments from your system. Thank you.


From: Ameer Mawia ameer.ma...@gmail.com
Reply: Tomcat Users List users@tomcat.apache.org
Date: 24 November 2014 at 00:44:45
To: Tomcat Users List users@tomcat.apache.org
Subject:  Re: Tomcat 8 does not start with java 8 on YOSEMITE  

Hi Fabio,

There seems to be an issue with update 40 Early Access release of 
jre/jdk8(1.8.0_40). Compared with update 20 of jre/jdk8 release, you will see 
following lines of code has been added to getPlatfromMBeanServer:

            for (final PlatformManagedObject o :
                                       ExtendedPlatformComponent.getMXBeans()) {
                if (!platformMBeanServer.isRegistered(o.getObjectName())) {
                    addMXBean(platformMBeanServer, o);
                }

But if you look into the accompanied rt.jar of the jre, this newly introduced 
class(ExtendedPlatformComponent) can NO-WHERE be found.

This issue, seems to be there across all the JAVA_VERSION=1.8.0_40 EA 
release, irrespective of platform.

Your remedy is to move back to a stable release. Latest stable release seems to 
be Java SE 8u25. 

Regards,
Ameer Mawia

On Sun, Nov 23, 2014 at 4:09 AM, Fabio Ricci fabio.ri...@semweb.ch wrote:
Dear tomcat community

Maybe someone did have this before (and possibly solved it)

On a mac book pro/JOSEMITE I installed Java 8 1.8.0_40-ea with JDK.
My $JAVA_HOME is /Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home

Then I downloaded a tomcat 8 core from http://tomcat.apache.org/download-80.cgi
When I start this tomcat 8 I get the following Java exceptio - see below.

With this Java 8 also my older tomcat 7 throws the same exception.
The official oracle java test page 
(https://www.java.com/en/download/installed.jsp) says, I have already java 
uptodate.

The exception:
It seems that sun/management/ExtendedPlatformComponent be not part of tomcat 
8 nor java 8 ...

Does anyone have some hints for me? I cannot figure our what is wrong ...
Thank you very much in advance!

Kind regards
Fabio


PS: The exception on start (/bin/startup.sh):
22-Nov-2014 18:43:02.218 SEVERE [main] 
org.apache.tomcat.util.digester.Digester.startElement Begin event threw error
 java.lang.NoClassDefFoundError: sun/management/ExtendedPlatformComponent
    at 
java.lang.management.ManagementFactory.getPlatformMBeanServer(ManagementFactory.java:494)
    at 
org.apache.tomcat.util.modeler.Registry.getMBeanServer(Registry.java:443)
    at 
org.apache.catalina.mbeans.MBeanUtils.createServer(MBeanUtils.java:580)
    at org.apache.catalina.mbeans.MBeanUtils.clinit(MBeanUtils.java:77)
    at 
org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.clinit(GlobalResourcesLifecycleListener.java:66)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
    at java.lang.Class.newInstance(Class.java:442)
    at 
org.apache.tomcat.util.digester.ObjectCreateRule.begin(ObjectCreateRule.java:117)
    at 
org.apache.tomcat.util.digester.Digester.startElement(Digester.java:1184)
    at 
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:509)
    at 
com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:182)
    at 
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1343)
    at 
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2786)
    at 

Re: How to get rid of that Tomcat page? Please help!

2014-11-23 Thread Richard Aubry
Neven

Thank you very much. Your help was invaluable.

I looked at /etc/hosts and found and entry for the site I was trying to reach. 
I removed that entry and all is fine now. How, when and why that line was added 
to the hosts file is a mystery for me. Thank you again.

Richard Aubry

 Le 2014-11-23 à 03:07, Neven Cvetkovic neven.cvetko...@gmail.com a écrit :
 
 Richard,
 
 My apologies, I misread your email. You did try your website from different
 browsers and different computers, an it works ok. My initial response did
 not assume that.
 
 Firstly, Tomcat is a server product that hosts applications. The page you
 are seeing is the default Tomcat page.
 
 Here are few questions:
 - did you setup any proxy servers?
 - did you search your mac for any installed tomcat product (to make sure it
 is coming from your local box)?
 - did you try different browsers (to make sure it is not a cached page)?
 - check your local /etc/hosts file, is your website listed in that file?
 - what happens if you try curl from command line, e.g. curl
 http://yoursite.com? Do you still see tomcat content?
 - if you do nslookup yoursite.com from your computer and other computers,
 is it the same ip address? Try same with ping yoursite.com
 
 Hope that gives us some more information!
 
 Thanks
 Neven
 
 On Nov 23, 2014 8:51 AM, Neven Cvetkovic neven.cvetko...@gmail.com
 wrote:
 
 Richard,
 
 On Nov 23, 2014 6:04 AM, Richard Aubry aubry...@gmail.com wrote:
 
 A few days ago, when I tried to access a web site that I frequently
 access, I obtained an Apache Tomcat page that said: If you're seeing this
 page via a web browser, it means you've set up Tomcat successfully.
 Congratulations!
 
 
 You are seeing a default Tomcat page (i.e. Root application). It seems
 that the website you frequent uses Tomcat. They probably upgraded Tomcat
 incorrectly and used Tomcat default page.
 
 There is nothing wrong with your computer. You could probably email
 website administrators about the problem. It is also likely the problem is
 going to get fixed by the time you see this message :)
 
 Another thing to try - use a different computer, or your phone to access
 this website.
 
 Good luck!
 
 But I have never set up Tomcat, I don't know what is Tomcat and I just
 want to get rid of that thing and to be able to access that web site again.
 I don't know how that thing took control of my Mac. Since that first time,
 I have never been able to access my web site. It's only happening on my
 Mac; on any other computer I can access the site without problems.
 
 Could someone tell me how to get rid of that?
 
 Richard Aubry
 -
 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: How to setup rewrite valve for angularjs

2014-11-23 Thread Tay Kai Yang
Hi Daniel

Thanks for the reply.

I have not used a webapp META-INF/context.xml before. So I had tried to
refer to online examples.

This is what I did.

   - Create context.xml in webapp/META-INF
   - This is what I have added in context.xml


-
- ?xml version=1.0 encoding=UTF-8?
- Context copyXML=true unpackWAR=true
- Valve className=org.apache.catalina.valves.rewrite.RewriteValve/
- /Context

 My rewrite.config in webapp/WEB-INF

RewriteCond %{REQUEST_FILENAME} !-f

 RewriteCond %{REQUEST_FILENAME} !-d

 RewriteCond %{REQUEST_URI} !index

 RewriteRule (.*) index.jsp [L]



 And in my localhost.log

24-Nov-2014 10:39:56.163 FINE [localhost-startStop-1]
 org.apache.catalina.valves.rewrite.RewriteValve.startInternal Read
 configuration from: /WEB-INF/rewrite.config

 24-Nov-2014 10:39:56.163 FINE [localhost-startStop-1]
 org.apache.catalina.valves.rewrite.RewriteValve.parse Add rule with pattern
 (.*) and substitution index.jsp

 24-Nov-2014 10:39:56.163 FINE [localhost-startStop-1]
 org.apache.catalina.valves.rewrite.RewriteValve.parse Add condition !-f
 test %{REQUEST_FILENAME} to rule with pattern (.*) and substitution
 index.jsp

 24-Nov-2014 10:39:56.163 FINE [localhost-startStop-1]
 org.apache.catalina.valves.rewrite.RewriteValve.parse Add condition !-d
 test %{REQUEST_FILENAME} to rule with pattern (.*) and substitution
 index.jsp

 24-Nov-2014 10:39:56.163 FINE [localhost-startStop-1]
 org.apache.catalina.valves.rewrite.RewriteValve.parse Add condition !index
 test %{REQUEST_URI} to rule with pattern (.*) and substitution index.jsp


Seems that all the required components starts up fine. But I received this
error when i try to access http://localhost:8080/{webapp}/, it shows the
following on the response.

*type* Exception report

 *message* *The resource path [null] is not valid*

 *description* *The server encountered an internal error that prevented it
 from fulfilling this request.*

 *exception*

 java.lang.IllegalArgumentException: The resource path [null] is not valid
   
 org.apache.catalina.webresources.StandardRoot.validate(StandardRoot.java:237)
   
 org.apache.catalina.webresources.StandardRoot.getResource(StandardRoot.java:199)
   
 org.apache.catalina.webresources.StandardRoot.getResource(StandardRoot.java:193)
   
 org.apache.catalina.valves.rewrite.ResolverImpl.resolveResource(ResolverImpl.java:151)
   
 org.apache.catalina.valves.rewrite.RewriteCond$ResourceCondition.evaluate(RewriteCond.java:82)
   
 org.apache.catalina.valves.rewrite.RewriteCond.evaluate(RewriteCond.java:235)
   
 org.apache.catalina.valves.rewrite.RewriteRule.evaluate(RewriteRule.java:105)
   
 org.apache.catalina.valves.rewrite.RewriteValve.invoke(RewriteValve.java:311)
   
 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
   
 org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)
   
 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:526)
   
 org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1078)
   
 org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:655)
   
 org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:277)
   
 org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2381)
   
 org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2370)
   
 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
   
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
   
 org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
   java.lang.Thread.run(Thread.java:745)

 Checking localhost_access.log gives me

127.0.0.1 - - [24/Nov/2014:10:42:18 +0800] GET /web/ HTTP/1.1 500 2990



I cannot figure out what is the problem, because I can't find anymore
errors, or stacktrace in any of my logfiles, catalina.stderr etc...

I can't find any information with regard to resource path [null]. What have
I missed out?

On Fri, Nov 21, 2014 at 8:28 PM, Daniel Mikusa dmik...@pivotal.io wrote:

 On Thu, Nov 20, 2014 at 9:08 PM, Tay Kai Yang kaiyang@gmail.com
 wrote:

  Hi
  I have been reading up tomcat 8's user doc. But I have some problems
  understanding the setup of rewrite valve. I think I should add the
 rewrite
  valve class name and XML settings to /conf/server.xml, but I am not sure
  what to do next. Where should I place my rewrite.config, how do I
 activate
  rewrite my war context only?
 

 See the second option here...

 http://tomcat.apache.org/tomcat-8.0-doc/rewrite.html#Configuration

 It can also be in the context.xml of a webapp. The valve will then use a
 rewrite.config file containing the rewrite directives, it must be placed in
 the WEB-INF folder of the web application


 
  Have 

Re: How to setup rewrite valve for angularjs

2014-11-23 Thread Ameer Mawia
On Nov 24, 2014 8:30 AM, Tay Kai Yang kaiyang@gmail.com wrote:

 Hi Daniel

 Thanks for the reply.

 I have not used a webapp META-INF/context.xml before. So I had tried to
 refer to online examples.

 This is what I did.

- Create context.xml in webapp/META-INF
- This is what I have added in context.xml


 -
 - ?xml version=1.0 encoding=UTF-8?
 - Context copyXML=true unpackWAR=true
 - Valve
className=org.apache.catalina.valves.rewrite.RewriteValve/
 - /Context
 
  My rewrite.config in webapp/WEB-INF

 RewriteCond %{REQUEST_FILENAME} !-f
 
  RewriteCond %{REQUEST_FILENAME} !-d
 
  RewriteCond %{REQUEST_URI} !index
 
  RewriteRule (.*) index.jsp [L]
 
 

  And in my localhost.log

 24-Nov-2014 10:39:56.163 FINE [localhost-startStop-1]
  org.apache.catalina.valves.rewrite.RewriteValve.startInternal Read
  configuration from: /WEB-INF/rewrite.config
 
  24-Nov-2014 10:39:56.163 FINE [localhost-startStop-1]
  org.apache.catalina.valves.rewrite.RewriteValve.parse Add rule with
pattern
  (.*) and substitution index.jsp
 
  24-Nov-2014 10:39:56.163 FINE [localhost-startStop-1]
  org.apache.catalina.valves.rewrite.RewriteValve.parse Add condition !-f
  test %{REQUEST_FILENAME} to rule with pattern (.*) and substitution
  index.jsp
 
  24-Nov-2014 10:39:56.163 FINE [localhost-startStop-1]
  org.apache.catalina.valves.rewrite.RewriteValve.parse Add condition !-d
  test %{REQUEST_FILENAME} to rule with pattern (.*) and substitution
  index.jsp
 
  24-Nov-2014 10:39:56.163 FINE [localhost-startStop-1]
  org.apache.catalina.valves.rewrite.RewriteValve.parse Add condition
!index
  test %{REQUEST_URI} to rule with pattern (.*) and substitution
index.jsp
 
 
 Seems that all the required components starts up fine. But I received this
 error when i try to access http://localhost:8080/{webapp}/, it shows the
 following on the response.

 *type* Exception report
 
  *message* *The resource path [null] is not valid*
 
  *description* *The server encountered an internal error that prevented
it
  from fulfilling this request.*
 
  *exception*
 
  java.lang.IllegalArgumentException: The resource path [null] is not
valid
 
 org.apache.catalina.webresources.StandardRoot.validate(StandardRoot.java:237)
 
 
org.apache.catalina.webresources.StandardRoot.getResource(StandardRoot.java:199)
 
 
org.apache.catalina.webresources.StandardRoot.getResource(StandardRoot.java:193)
 
 
org.apache.catalina.valves.rewrite.ResolverImpl.resolveResource(ResolverImpl.java:151)
 
 
org.apache.catalina.valves.rewrite.RewriteCond$ResourceCondition.evaluate(RewriteCond.java:82)
 
 org.apache.catalina.valves.rewrite.RewriteCond.evaluate(RewriteCond.java:235)
 
 org.apache.catalina.valves.rewrite.RewriteRule.evaluate(RewriteRule.java:105)
 
 org.apache.catalina.valves.rewrite.RewriteValve.invoke(RewriteValve.java:311)
 
 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
 
 
org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)
 
 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:526)
 
 
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1078)
 
 
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:655)
 
 
org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:277)
 
 
org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2381)
 
 
org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2370)
 
 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
 
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
 
 
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
java.lang.Thread.run(Thread.java:745)
 

Taking hints from doc page,
http://tomcat.apache.org/tomcat-8.0-doc/rewrite.html and your log, you
seems to be missing path prex in your substitution string. Can you prefix
/to index.jsp to your substituion string. That is:

RewriteRule (.*) index.jsp [L]

  Checking localhost_access.log gives me

 127.0.0.1 - - [24/Nov/2014:10:42:18 +0800] GET /web/ HTTP/1.1 500 2990



 I cannot figure out what is the problem, because I can't find anymore
 errors, or stacktrace in any of my logfiles, catalina.stderr etc...

 I can't find any information with regard to resource path [null]. What
have
 I missed out?

 On Fri, Nov 21, 2014 at 8:28 PM, Daniel Mikusa dmik...@pivotal.io wrote:

  On Thu, Nov 20, 2014 at 9:08 PM, Tay Kai Yang kaiyang@gmail.com
  wrote:
 
   Hi
   I have been reading up tomcat 8's user doc. But I have some problems
   understanding the setup of rewrite valve. I think I should add the
  rewrite
   valve class name and XML settings to /conf/server.xml, but I am not
sure
   what to do next. Where should I place my rewrite.config, how do I
  activate
   rewrite my war context only?
  
 
  

Re: How to setup rewrite valve for angularjs

2014-11-23 Thread Ameer Mawia
correction:

On Nov 24, 2014 11:54 AM, Ameer Mawia ameer.ma...@gmail.com wrote:


 On Nov 24, 2014 8:30 AM, Tay Kai Yang kaiyang@gmail.com wrote:
 
  Hi Daniel
 
  Thanks for the reply.
 
  I have not used a webapp META-INF/context.xml before. So I had tried to
  refer to online examples.
 
  This is what I did.
 
 - Create context.xml in webapp/META-INF
 - This is what I have added in context.xml
 
 
  -
  - ?xml version=1.0 encoding=UTF-8?
  - Context copyXML=true unpackWAR=true
  - Valve
className=org.apache.catalina.valves.rewrite.RewriteValve/
  - /Context
  
   My rewrite.config in webapp/WEB-INF
 
  RewriteCond %{REQUEST_FILENAME} !-f
  
   RewriteCond %{REQUEST_FILENAME} !-d
  
   RewriteCond %{REQUEST_URI} !index
  
   RewriteRule (.*) index.jsp [L]
  
  
 
   And in my localhost.log
 
  24-Nov-2014 10:39:56.163 FINE [localhost-startStop-1]
   org.apache.catalina.valves.rewrite.RewriteValve.startInternal Read
   configuration from: /WEB-INF/rewrite.config
  
   24-Nov-2014 10:39:56.163 FINE [localhost-startStop-1]
   org.apache.catalina.valves.rewrite.RewriteValve.parse Add rule with
pattern
   (.*) and substitution index.jsp
  
   24-Nov-2014 10:39:56.163 FINE [localhost-startStop-1]
   org.apache.catalina.valves.rewrite.RewriteValve.parse Add condition
!-f
   test %{REQUEST_FILENAME} to rule with pattern (.*) and substitution
   index.jsp
  
   24-Nov-2014 10:39:56.163 FINE [localhost-startStop-1]
   org.apache.catalina.valves.rewrite.RewriteValve.parse Add condition
!-d
   test %{REQUEST_FILENAME} to rule with pattern (.*) and substitution
   index.jsp
  
   24-Nov-2014 10:39:56.163 FINE [localhost-startStop-1]
   org.apache.catalina.valves.rewrite.RewriteValve.parse Add condition
!index
   test %{REQUEST_URI} to rule with pattern (.*) and substitution
index.jsp
  
  
  Seems that all the required components starts up fine. But I received
this
  error when i try to access http://localhost:8080/{webapp}/, it shows the
  following on the response.
 
  *type* Exception report
  
   *message* *The resource path [null] is not valid*
  
   *description* *The server encountered an internal error that
prevented it
   from fulfilling this request.*
  
   *exception*
  
   java.lang.IllegalArgumentException: The resource path [null] is not
valid
  
 org.apache.catalina.webresources.StandardRoot.validate(StandardRoot.java:237)
  
 
org.apache.catalina.webresources.StandardRoot.getResource(StandardRoot.java:199)
  
 
org.apache.catalina.webresources.StandardRoot.getResource(StandardRoot.java:193)
  
 
org.apache.catalina.valves.rewrite.ResolverImpl.resolveResource(ResolverImpl.java:151)
  
 
org.apache.catalina.valves.rewrite.RewriteCond$ResourceCondition.evaluate(RewriteCond.java:82)
  
 org.apache.catalina.valves.rewrite.RewriteCond.evaluate(RewriteCond.java:235)
  
 org.apache.catalina.valves.rewrite.RewriteRule.evaluate(RewriteRule.java:105)
  
 org.apache.catalina.valves.rewrite.RewriteValve.invoke(RewriteValve.java:311)
  
 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
  
 
org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)
  
 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:526)
  
 
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1078)
  
 
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:655)
  
 
org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:277)
  
 
org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2381)
  
 
org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2370)
  
 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
  
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
  
 
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
 java.lang.Thread.run(Thread.java:745)
  

 Taking hints from doc page,
http://tomcat.apache.org/tomcat-8.0-doc/rewrite.html and your log, you
seems to be missing path prex in your substitution string. Can you prefix
/to index.jsp to your substituion string. That is:

 RewriteRule (.*) index.jsp [L]
RewriteRule (.*) /index.jsp [L]


   Checking localhost_access.log gives me
 
  127.0.0.1 - - [24/Nov/2014:10:42:18 +0800] GET /web/ HTTP/1.1 500 2990
 
 
 
  I cannot figure out what is the problem, because I can't find anymore
  errors, or stacktrace in any of my logfiles, catalina.stderr etc...
 
  I can't find any information with regard to resource path [null]. What
have
  I missed out?
 
  On Fri, Nov 21, 2014 at 8:28 PM, Daniel Mikusa dmik...@pivotal.io
wrote:
 
   On Thu, Nov 20, 2014 at 9:08 PM, Tay Kai Yang kaiyang@gmail.com
   wrote:
  
Hi
I have been reading up tomcat 8's user doc. But I have some problems
understanding the setup of rewrite valve. 

Re: How to setup rewrite valve for angularjs

2014-11-23 Thread Tay Kai Yang
Hi

I have tried to add a / to index.jsp. The problem still persist.
It consistently complained about resource path null. What is this resource
that it is looking for?
 On Nov 24, 2014 2:25 PM, Ameer Mawia ameer.ma...@gmail.com wrote:

 On Nov 24, 2014 8:30 AM, Tay Kai Yang kaiyang@gmail.com wrote:
 
  Hi Daniel
 
  Thanks for the reply.
 
  I have not used a webapp META-INF/context.xml before. So I had tried to
  refer to online examples.
 
  This is what I did.
 
 - Create context.xml in webapp/META-INF
 - This is what I have added in context.xml
 
 
  -
  - ?xml version=1.0 encoding=UTF-8?
  - Context copyXML=true unpackWAR=true
  - Valve
 className=org.apache.catalina.valves.rewrite.RewriteValve/
  - /Context
  
   My rewrite.config in webapp/WEB-INF
 
  RewriteCond %{REQUEST_FILENAME} !-f
  
   RewriteCond %{REQUEST_FILENAME} !-d
  
   RewriteCond %{REQUEST_URI} !index
  
   RewriteRule (.*) index.jsp [L]
  
  
 
   And in my localhost.log
 
  24-Nov-2014 10:39:56.163 FINE [localhost-startStop-1]
   org.apache.catalina.valves.rewrite.RewriteValve.startInternal Read
   configuration from: /WEB-INF/rewrite.config
  
   24-Nov-2014 10:39:56.163 FINE [localhost-startStop-1]
   org.apache.catalina.valves.rewrite.RewriteValve.parse Add rule with
 pattern
   (.*) and substitution index.jsp
  
   24-Nov-2014 10:39:56.163 FINE [localhost-startStop-1]
   org.apache.catalina.valves.rewrite.RewriteValve.parse Add condition
 !-f
   test %{REQUEST_FILENAME} to rule with pattern (.*) and substitution
   index.jsp
  
   24-Nov-2014 10:39:56.163 FINE [localhost-startStop-1]
   org.apache.catalina.valves.rewrite.RewriteValve.parse Add condition
 !-d
   test %{REQUEST_FILENAME} to rule with pattern (.*) and substitution
   index.jsp
  
   24-Nov-2014 10:39:56.163 FINE [localhost-startStop-1]
   org.apache.catalina.valves.rewrite.RewriteValve.parse Add condition
 !index
   test %{REQUEST_URI} to rule with pattern (.*) and substitution
 index.jsp
  
  
  Seems that all the required components starts up fine. But I received
 this
  error when i try to access http://localhost:8080/{webapp}/, it shows the
  following on the response.
 
  *type* Exception report
  
   *message* *The resource path [null] is not valid*
  
   *description* *The server encountered an internal error that prevented
 it
   from fulfilling this request.*
  
   *exception*
  
   java.lang.IllegalArgumentException: The resource path [null] is not
 valid
  

  org.apache.catalina.webresources.StandardRoot.validate(StandardRoot.java:237)
  

  
 org.apache.catalina.webresources.StandardRoot.getResource(StandardRoot.java:199)
  

  
 org.apache.catalina.webresources.StandardRoot.getResource(StandardRoot.java:193)
  

  
 org.apache.catalina.valves.rewrite.ResolverImpl.resolveResource(ResolverImpl.java:151)
  

  
 org.apache.catalina.valves.rewrite.RewriteCond$ResourceCondition.evaluate(RewriteCond.java:82)
  

  org.apache.catalina.valves.rewrite.RewriteCond.evaluate(RewriteCond.java:235)
  

  org.apache.catalina.valves.rewrite.RewriteRule.evaluate(RewriteRule.java:105)
  

  org.apache.catalina.valves.rewrite.RewriteValve.invoke(RewriteValve.java:311)
  

  org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
  

  
 org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)
  

  org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:526)
  

  
 org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1078)
  

  
 org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:655)
  

  
 org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:277)
  

  
 org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2381)
  

  
 org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2370)
  

  
 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
  

  
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
  

  
 org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
 java.lang.Thread.run(Thread.java:745)
  

 Taking hints from doc page,
 http://tomcat.apache.org/tomcat-8.0-doc/rewrite.html and your log, you
 seems to be missing path prex in your substitution string. Can you prefix
 /to index.jsp to your substituion string. That is:

 RewriteRule (.*) index.jsp [L]

   Checking localhost_access.log gives me
 
  127.0.0.1 - - [24/Nov/2014:10:42:18 +0800] GET /web/ HTTP/1.1 500 2990
 
 
 
  I cannot figure out what is the problem, because I can't find anymore
  errors, or stacktrace in any of my logfiles, catalina.stderr etc...
 
  I can't find any information with regard to resource path [null]. What
 have
  I missed out?
 
  On Fri, Nov 21, 2014 at 8:28 PM, Daniel Mikusa dmik...@pivotal.io
 wrote:
 
   On Thu, Nov 20,