Re: Tomcat deployment webapps and the whole stew

2013-06-27 Thread Mark Eggers

On 6/27/2013 11:29 AM, Narahari 'n' Savitha wrote:

The link explains my issue on hand.  It was easier to put it there so I
could explain better instead of being inline.  Kindly excuse.

https://docs.google.com/document/d/1xHcHGof8ERugFUimHUuiYTtmvZSqxChAm1NHuxMTS5k/edit?usp=sharing



Sigh,

[begin rant]

I know you think it's easier to write your message in google docs and 
then paste a link, but for everyone else it's not.


If you wish to edit a mail message beforehand, how about using an 
editor, and then cutting and pasting once you've edited the text 
appropriately?


[almost end rant]

In your document, you failed to mention Tomcat version, JRE version, or 
OS version. I'm going to assume that from the following path


/opt/narahari/paas/webapps

that you're running on some sort of Linux / UNIX / MacOS (ie, not Windows).

I'm going to further assume that you're running a version of Tomcat 
downloaded from tomcat.apache.org (probably a bad assumption), and that 
you're running some variant of Tomcat 7 (probably a less bad assumption).


In the future, these details should be included in the mail message, and 
not in some document linked in the mail message. The document may go 
away in the future, so that archived mail messages will then become 
useless to anyone else.


[end rant]

For those people who didn't read the linked document:

Here's what you tried:

Context docBase=/opt/adp/paas/webapps/ptl
 antiResourceLocking=false /

Context docBase=/opt/adp/paas/webapps/ptl#cts
 antiResourceLocking=false /

And your complaint is:

sh$/opt/narahari/paas/adp-tomcat/work/Catalina/localhost/ptl_cts
/WEB-INF ll
total 8
drwxr-x--- 4 virtual wheel 4096 2013-06-27 14:01 classes
drwxr-x--- 2 virtual wheel 4096 2013-06-27 14:01 lib

None of the other stuff is getting unpacked.

1. Why are you looking in the WORK folder?
2. Why are you using such a convoluted way of deploying your apps?
3. Are you running your Tomcat as root? (don't do this)

From the fine Tomcat documentation

http://tomcat.apache.org/tomcat-7.0-doc/config/host.html
http://tomcat.apache.org/tomcat-7.0-doc/config/context.html

there are two things to note.

1. docBase is only valid if it points to a location outside of the
   Host's appBase

Failure to do so will result in partial deployments, double deployments, 
and all sorts of unpleasantness. I haven't actually tried breaking the 
rules, so I don't know exactly what happens.


2. WAR files outside of appBase are not exploded

This was changed in Tomcat 7 (see the following - 
http://tomcat.apache.org/migration-7.html#Deployment)


In short, the docBase must point to either the WAR file or an exploded 
directory.


Again, if a docBase is used, it must point to a location outside of the 
Host's appBase. If it points to a directory, the web application must be 
exploded. Otherwise, it must point to a WAR file, and the application 
will be run from that WAR file.


This has been discussed before on the mailing list as well.

. . . just my (wrong side of bed mood) two cents
/mde/


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat deployment webapps and the whole stew

2013-06-27 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Mark,

On 6/27/13 3:10 PM, Mark Eggers wrote:
 On 6/27/2013 11:29 AM, Narahari 'n' Savitha wrote:
 The link explains my issue on hand.  It was easier to put it
 there so I could explain better instead of being inline.  Kindly
 excuse.
 
 https://docs.google.com/document/d/1xHcHGof8ERugFUimHUuiYTtmvZSqxChAm1NHuxMTS5k/edit?usp=sharing

 
 I know you think it's easier to write your message in google docs
 and then paste a link, but for everyone else it's not.

+1

Also, your question does not go into the mailing list archives: if you
take your document down, this thread becomes useless forever. People
do this with StackOverflow all the time, and it irritates me.

I don't know about anyone else, but I'm not going to help answer a
question not actually asked on the list.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJRzJNNAAoJEBzwKT+lPKRYhO4P/0kCnO9RmApFSGroIGQnd1WU
vGh8NQOFFnaZJav1pwN6vPW4dPraDFdmmBkPQAgRq9MgRToZszXG9GaQ3Piil4QX
fkPnxTKAlUc0JxigNuorqU3xhzPxMMAjlD/jkm7me14oH1P2zyc0L2dqGP/O1KNP
iQKl59zJWMo2HOKk4B7QtJG+vExHiBFH5DcCeJav1IvSCA9yKqnZV8fAXTmllmCV
V32TzmUlJwmpaSTp8M+C8Zbq0LCL8n+vaFLkF9uyp98KiGnd7g3WzCzEsT5Ip7hv
OfOe32He9lZ4umfN5+G3AULbOMfU8+OcblzDLBrcGl2GQI1ZWzolsSnrLauMDx8n
hjRmXggkyi1Lr4kh6z6p+I4dELjC+OeEaAmwckgow+vcvHFaCWOZTyvUcMsn7nQY
S0A45/MFPCeS/RbfJy/PojQ6+zxvqGkVeP/zsSlfjYXVw7fJX98SuBsMfn9CaaMP
CR/uM9hKbiyr2ECkLlzdvfkUfko0USzc8VIsLEr3sNnpu2OmGmQJKvSt1kpK7zRU
C01dsFzXPFoFQODSGBaDCTn9jKzv6US9bsvaQP3QrGFyYEvXHRokdBvH7ekPCWM7
/TJTop4/MD+k4E9dcR4XFiSmncAopYGdunTwV4e/CRt3LXlQRaKfr62VEF2GKRml
W2x8Nk0Q3mHXJ7g6Vn01
=jUSo
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat deployment webapps and the whole stew

2013-06-27 Thread Narahari 'n' Savitha
Thank You for your answers and your valid critique (aka rants)

 In your document, you failed to mention Tomcat version, JRE version, or OS
 version. I'm going to assume that from the following path

 /opt/narahari/paas/webapps

 that you're running on some sort of Linux / UNIX / MacOS (ie, not Windows).


Yes to the above sentence, I am on SLES 11.2


 I'm going to further assume that you're running a version of Tomcat
 downloaded from tomcat.apache.org (probably a bad assumption), and that
 you're running some variant of Tomcat 7 (probably a less bad assumption).


Yes apache-tomcat-7.0.37 from tomcat.apache.org for the above sentence.


 For those people who didn't read the linked document:

 Here's what you tried:

 Context docBase=/opt/adp/paas/**webapps/ptl
  antiResourceLocking=false /

 Context docBase=/opt/adp/paas/**webapps/ptl#cts
  antiResourceLocking=false /

 And your complaint is:

 sh$/opt/narahari/paas/adp-**tomcat/work/Catalina/**localhost/ptl_cts
 /WEB-INF ll
 total 8
 drwxr-x--- 4 virtual wheel 4096 2013-06-27 14:01 classes
 drwxr-x--- 2 virtual wheel 4096 2013-06-27 14:01 lib

 None of the other stuff is getting unpacked.

 1. Why are you looking in the WORK folder?


For the above question, I really dont know why but colleague said that wars
are unarchived there.  So I presume from your answer it is of no value to
look there.

2. Why are you using such a convoluted way of deploying your apps?


Not really convoluted, we want to put our wars outside of tomcat's inbuilt
webapps dir (another team owns and installs tomcat and not as root)


 3. Are you running your Tomcat as root? (don't do this)


For the above question , no it is not run as root.


 From the fine Tomcat documentation

 http://tomcat.apache.org/**tomcat-7.0-doc/config/host.**htmlhttp://tomcat.apache.org/tomcat-7.0-doc/config/host.html
 http://tomcat.apache.org/**tomcat-7.0-doc/config/context.**htmlhttp://tomcat.apache.org/tomcat-7.0-doc/config/context.html

 there are two things to note.

 1. docBase is only valid if it points to a location outside of the
Host's appBase


For the above, are you saying that docBase should point to folder other
than Host element's app base location (in my case it is appBase=webapps
) and my docBase=/opt/narahari/paas/webapps which is outside of
CATALINA_BASE and CATALINA_HOME folders.


 Failure to do so will result in partial deployments, double deployments,
 and all sorts of unpleasantness. I haven't actually tried breaking the
 rules, so I don't know exactly what happens.

 2. WAR files outside of appBase are not exploded

 This was changed in Tomcat 7 (see the following -
 http://tomcat.apache.org/**migration-7.html#Deploymenthttp://tomcat.apache.org/migration-7.html#Deployment
 )

 In short, the docBase must point to either the WAR file or an exploded
 directory.

 Again, if a docBase is used, it must point to a location outside of the
 Host's appBase. If it points to a directory, the web application must be
 exploded. Otherwise, it must point to a WAR file, and the application will
 be run from that WAR file.

 For the above point, I put the artifact as a WAR file in the
/opt/narahari/paas/webapps folder but when tomcat starts and tries to to
run from the ptl#cts.war, I see the following error.  Our app is trying to
read WEB-INF/faces-config.xml (JSF app) but error occurs as below.

16:04:22,878 INFO  [ConfigServlet] com.alp.rev.config.ConfigServlet.init():
Entering.
16:04:22,878 INFO  [ConfigServlet] com.alp.rev.config.ConfigServlet.init():
FILEINPUTSTREAM VERSION 1.0
16:04:22,878 INFO  [ConfigServlet]
com.alp.rev.config.ConfigServlet.init(): configFiles
= [/WEB-INF/faces-config.xml]
16:04:22,878 INFO  [ConfigServlet] com.alp.rev.config.ConfigServlet.init():
Full path to Faces configuration file [null]
16:04:22,878 ERROR [ConfigServlet] com.alp.rev.config.ConfigServlet.init():
Error trying to read file [null]. Exception =
[java.lang.NullPointerException]
java.lang.NullPointerException
at java.io.FileInputStream.init(FileInputStream.java:116)
at java.io.FileInputStream.init(FileInputStream.java:79)
at com.adp.revit.config.ConfigServlet.init(ConfigServlet.java:59)
at
org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1280)
at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1193)
at
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1088)

Thank you for your help and suggestions on incomplet information when I
posted.

-Narahari

PS: On the other hand, if I manually expand ptl#cts.war manually and then
point to expanded folder in the docBase attribute, I dont see exceptions.
 Just a point for  your reference


Re: Tomcat deployment webapps and the whole stew

2013-06-27 Thread André Warnier

Mark Eggers wrote:

On 6/27/2013 11:29 AM, Narahari 'n' Savitha wrote:

The link explains my issue on hand.  It was easier to put it there so I
could explain better instead of being inline.  Kindly excuse.

https://docs.google.com/document/d/1xHcHGof8ERugFUimHUuiYTtmvZSqxChAm1NHuxMTS5k/edit?usp=sharing 





Sigh,

[begin rant]

I know you think it's easier to write your message in google docs and 
then paste a link, but for everyone else it's not.




+1

and then
[begin second rant]
I get spam and worse messages all the time asking me to please click on this link and 
discover how to get rich from my couch or pick up my 2m$ winning Google Lottery ticket, so 
I'm not about to follow this one just to read about someone else's problems with Tomcat.

[end second rant]


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat deployment webapps and the whole stew

2013-06-27 Thread Mark Eggers

Comments in line:

On 6/27/2013 1:07 PM, Narahari 'n' Savitha wrote:

Thank You for your answers and your valid critique (aka rants)


In your document, you failed to mention Tomcat version, JRE version, or OS
version. I'm going to assume that from the following path

/opt/narahari/paas/webapps

that you're running on some sort of Linux / UNIX / MacOS (ie, not Windows).



Yes to the above sentence, I am on SLES 11.2


Thanks for the information - this helps.




I'm going to further assume that you're running a version of Tomcat
downloaded from tomcat.apache.org (probably a bad assumption), and that
you're running some variant of Tomcat 7 (probably a less bad assumption).



Yes apache-tomcat-7.0.37 from tomcat.apache.org for the above sentence.


Great - although upgrading to 7.0.41 is probably a good idea. I 
understand from below that you're not in charge of running the Tomcat 
server, so that will have to be left up to the powers that be.






For those people who didn't read the linked document:

Here's what you tried:

Context docBase=/opt/adp/paas/**webapps/ptl
  antiResourceLocking=false /

Context docBase=/opt/adp/paas/**webapps/ptl#cts
  antiResourceLocking=false /

And your complaint is:

sh$/opt/narahari/paas/adp-**tomcat/work/Catalina/**localhost/ptl_cts
 /WEB-INF ll
total 8
drwxr-x--- 4 virtual wheel 4096 2013-06-27 14:01 classes
drwxr-x--- 2 virtual wheel 4096 2013-06-27 14:01 lib

None of the other stuff is getting unpacked.

1. Why are you looking in the WORK folder?



For the above question, I really dont know why but colleague said that wars
are unarchived there.  So I presume from your answer it is of no value to
look there.


This is correct.



2. Why are you using such a convoluted way of deploying your apps?




Not really convoluted, we want to put our wars outside of tomcat's inbuilt
webapps dir (another team owns and installs tomcat and not as root)




This is certainly one way of managing your deployments. It does have the 
advantage of making Tomcat upgrades easier.


It has the disadvantage of making your deployments platform-specific. 
This of course will be a pain for developers, source code control, and 
continuous integration.


You might want to bring up the possibility of using CATALINA_BASE and 
CATALINA_HOME. Read the RUNNING.txt file in the base directory of your 
Tomcat installation. We use one CATALINA_HOME to support multiple 
CATALINA_BASE installations. Updating is easier, and we use ant scripts 
to crank out new service installations (takes about 2 seconds). I spend 
more time writing out the properties files and documenting than I do 
adding a new Tomcat platform and service.


You could then use the manager application or ant tasks to deploy to the 
standard appBase, easing life for developers, source code control, and 
continuous integration (as well as administrators).



3. Are you running your Tomcat as root? (don't do this)



For the above question , no it is not run as root.


OK, I saw 'wheel' and got a little bit concerned. It is in general a bad 
practice to run services from a privileged account.






 From the fine Tomcat documentation

http://tomcat.apache.org/**tomcat-7.0-doc/config/host.**htmlhttp://tomcat.apache.org/tomcat-7.0-doc/config/host.html
http://tomcat.apache.org/**tomcat-7.0-doc/config/context.**htmlhttp://tomcat.apache.org/tomcat-7.0-doc/config/context.html

there are two things to note.

1. docBase is only valid if it points to a location outside of the
Host's appBase



For the above, are you saying that docBase should point to folder other
than Host element's app base location (in my case it is appBase=webapps
) and my docBase=/opt/narahari/paas/webapps which is outside of
CATALINA_BASE and CATALINA_HOME folders.



Failure to do so will result in partial deployments, double deployments,
and all sorts of unpleasantness. I haven't actually tried breaking the
rules, so I don't know exactly what happens.

2. WAR files outside of appBase are not exploded

This was changed in Tomcat 7 (see the following -
http://tomcat.apache.org/**migration-7.html#Deploymenthttp://tomcat.apache.org/migration-7.html#Deployment
)

In short, the docBase must point to either the WAR file or an exploded
directory.

Again, if a docBase is used, it must point to a location outside of the
Host's appBase. If it points to a directory, the web application must be
exploded. Otherwise, it must point to a WAR file, and the application will
be run from that WAR file.

For the above point, I put the artifact as a WAR file in the

/opt/narahari/paas/webapps folder but when tomcat starts and tries to to
run from the ptl#cts.war, I see the following error.  Our app is trying to
read WEB-INF/faces-config.xml (JSF app) but error occurs as below.

16:04:22,878 INFO  [ConfigServlet] com.alp.rev.config.ConfigServlet.init():
Entering.
16:04:22,878 INFO  [ConfigServlet] com.alp.rev.config.ConfigServlet.init():
FILEINPUTSTREAM VERSION 1.0

Re: Tomcat deployment webapps and the whole stew

2013-06-27 Thread Mark Eggers

On 6/27/2013 1:17 PM, André Warnier wrote:

Mark Eggers wrote:

On 6/27/2013 11:29 AM, Narahari 'n' Savitha wrote:

The link explains my issue on hand.  It was easier to put it there so I
could explain better instead of being inline.  Kindly excuse.

https://docs.google.com/document/d/1xHcHGof8ERugFUimHUuiYTtmvZSqxChAm1NHuxMTS5k/edit?usp=sharing




Sigh,

[begin rant]

I know you think it's easier to write your message in google docs and
then paste a link, but for everyone else it's not.



+1

and then
[begin second rant]
I get spam and worse messages all the time asking me to please click on
this link and discover how to get rich from my couch or pick up my 2m$
winning Google Lottery ticket, so I'm not about to follow this one just
to read about someone else's problems with Tomcat.
[end second rant]


Hmm - you could always look behind the couch cushions to get rich.

But that would probably require you to get up from the couch - never mind.

. . . just my (probably off-topic) two cents
/mde/

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat deployment webapps and the whole stew

2013-06-27 Thread Narahari 'n' Savitha
Here is what I tried.

CATALINA_HOME=/opt/narahari/paas/apache-tomcat-7.0.37

CATALINA_BASE=/opt/narahari/paas/adp-tomcat


In the $CATALINA_BASE/conf/Catalina/localhost/ptl#cts.xml file the entry is

Context docBase=/opt/narahari/paas/webapps/ptl#cts.war
antiResourceLocking=false /

=

The contents of /opt/narahari/paas/webapps folder is

virtual@cdl-pid-p1-01:/opt/narahari/paas/webapps ls

ptl#cts.war

===

Now I start tomcat and I go check the logs to see if the ptl#cts.war got
deployed and I see the following

22:18:34,426 INFO  [ConfigServlet] com.alp.rev.config.ConfigServlet.init():
Entering.

22:18:34,427 INFO  [ConfigServlet] com.alp.rev.config.ConfigServlet.init():
FILEINPUTSTREAM VERSION 1.0

22:18:34,427 INFO  [ConfigServlet] com.alp.rev.config.ConfigServlet.init():
configFiles = [/WEB-INF/faces-config.xml]

22:18:34,427 INFO  [ConfigServlet] com.alp.rev.config.ConfigServlet.init():
Full path to Faces configuration file [null]

22:18:34,427 ERROR [ConfigServlet] com.adp.rev.config.ConfigServlet.init():
Error trying to read file [null]. Exception =
[java.lang.NullPointerException]

java.lang.NullPointerException

at java.io.FileInputStream.init(FileInputStream.java:116)

at java.io.FileInputStream.init(FileInputStream.java:79)

at com.alp.rev.config.ConfigServlet.init(ConfigServlet.java:59)

at
org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1280)

at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1193)

at
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1088)

at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5033)

at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5317)

at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)

So as you can see I have the war file in the right
location(/opt/narahari/paas/webapps) and is pointed to in the
$CATALINA_BASE/conf/Catalina/localhost/ptl#cts.xml

However I dont see the war initializing correctly.  It is trying to find
the faces-config.xml file which does not seem to be found. (yes it is a
 part of the war file and exists under WEB-INF)

So it looks like app running out of the war file directly is not working
correctly.  I am not sure why but I would want your expert advice.

Regards,
-Narahari


RE: Tomcat deployment webapps and the whole stew

2013-06-27 Thread Caldarale, Charles R
 From: Narahari 'n' Savitha [mailto:savith...@gmail.com] 
 Subject: Re: Tomcat deployment webapps and the whole stew

 22:18:34,427 ERROR [ConfigServlet] com.adp.rev.config.ConfigServlet.init():
 Error trying to read file [null]. Exception = [java.lang.NullPointerException]
 java.lang.NullPointerException
 at java.io.FileInputStream.init(FileInputStream.java:116)
 at java.io.FileInputStream.init(FileInputStream.java:79)
 at com.alp.rev.config.ConfigServlet.init(ConfigServlet.java:59)

 It is trying to find the faces-config.xml file which does not seem to be 
 found.
 (yes it is a part of the war file and exists under WEB-INF)

Your servlet is making the invalid assumption that its data is accessible 
through the file system, which is explicitly not allowed by the servlet spec.  
It should be using ServletContext.getResourceAsStream() rather than java.io.

 - 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.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat deployment webapps and the whole stew

2013-06-27 Thread Mark Eggers

On 6/27/2013 7:32 PM, Narahari 'n' Savitha wrote:

Here is what I tried.

CATALINA_HOME=/opt/narahari/paas/apache-tomcat-7.0.37

CATALINA_BASE=/opt/narahari/paas/adp-tomcat


In the $CATALINA_BASE/conf/Catalina/localhost/ptl#cts.xml file the
entry is



That's going to be much better than the previous.

How are you starting Tomcat?

Hopefully, you're following RUNNING.txt.

Something like this would be good:

export CATALINA_HOME=/opt/narahari/pass/apache-tomcat-7.0.37
export CATALINA_BASE=/opt/narahari/pass/adp-tomcat
$CATALINA_HOME/bin/startup.sh

In CATALINA_BASE, you have the following directory structure:

--- From RUNNING.txt ---
bin (with tomcat-juli.jar, and possibly setenv.sh)
conf(all of the conf files copied from $CATALINA_BASE/conf)
lib (most likely empty - you may have JDBC libraries here)
temp(empty)
work(empty)
webapps (where your WAR files go - see notes below)


Context docBase=/opt/narahari/paas/webapps/ptl#cts.war
antiResourceLocking=false /


And this is not going to work - see below.

If you've copied the conf directory from $CATALINA_HOME into the conf 
directory of $CATALINA_BASE (per RUNNING.txt instructions), you'll have 
the following part in server.xml


Host name=localhost
  appBase=webapps
  unpackWARs=true
  autoDeploy=true

This says that relative to $CATALINA_BASE, your web applications can be 
found in the webapps directory (shown above).


So place your WAR files (as you've done) in $CATALINA_BASE/webapps.

Thus if you have this setup, you no longer need your ptl.xml or 
ptl#cts.xml context files. This of course makes life much easier for 
deployment (now system independent).


In fact, it is an error to include them.




=

The contents of /opt/narahari/paas/webapps folder is

virtual@cdl-pid-p1-01:/opt/narahari/paas/webapps ls

ptl#cts.war


This is fine, but it's not where your context file is pointing. Even if 
it was, see the notes above.




===

Now I start tomcat and I go check the logs to see if the ptl#cts.war
got deployed and I see the following

22:18:34,426 INFO  [ConfigServlet]
com.alp.rev.config.ConfigServlet.init(): Entering.

22:18:34,427 INFO  [ConfigServlet]
com.alp.rev.config.ConfigServlet.init(): FILEINPUTSTREAM VERSION 1.0

22:18:34,427 INFO  [ConfigServlet]
com.alp.rev.config.ConfigServlet.init(): configFiles =
[/WEB-INF/faces-config.xml]

22:18:34,427 INFO  [ConfigServlet]
com.alp.rev.config.ConfigServlet.init(): Full path to Faces
configuration file [null]

22:18:34,427 ERROR [ConfigServlet]
com.adp.rev.config.ConfigServlet.init(): Error trying to read file
[null]. Exception = [java.lang.NullPointerException]

java.lang.NullPointerException

at java.io.FileInputStream.init(FileInputStream.java:116)

at java.io.FileInputStream.init(FileInputStream.java:79)

at com.alp.rev.config.ConfigServlet.init(ConfigServlet.java:59)

at
org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1280)

 at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1193)

 at
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1088)

 at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5033)

 at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5317)

 at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)

So as you can see I have the war file in the right
location(/opt/narahari/paas/webapps) and is pointed to in the
$CATALINA_BASE/conf/Catalina/localhost/ptl#cts.xml

However I dont see the war initializing correctly.  It is trying to
find the faces-config.xml file which does not seem to be found. (yes
it is a part of the war file and exists under WEB-INF)

So it looks like app running out of the war file directly is not
working correctly.  I am not sure why but I would want your expert
advice.

Regards, -Narahari



Yep, because now you've pointed your context file to an appBase (if 
you've typo'ed your context file above).


So . . . here's the plan.

1. Create a CATALINA_BASE

a. Create the directory structure given above (from RUNNING.txt)
b. Copy the files over that you need to copy
   1. tomcat-juli.jar from $CATALINA_HOME/bin tp $CATALINA_BASE/bin
   2. all of the files from $CATALINA_HOME/conf into $CATALINA_BASE/conf
c. Put your WAR files in $CATALINA_BASE/webapps
d. Set the following environment variables:
   1. export CATALINA_HOME=/opt/narahari/pass/apache-tomcat-7.0.37
   2. export CATALINA_BASE=/opt/narahari/pass/adp-tomcat
   3. export JRE_HOME=[wherever your JRE is]
e. Do NOT use any context files in conf/Catalina/localhost
f. run $CATALINA_HOME/bin/startup.sh

Again, you can only use docBase in your context files if the following 
condition is met:


The WAR file or directory must be outside of the appBase directory 
defined in the Host element of server.xml.


If you point to a directory, the directory must be an expanded web 
application. If you have a WAR file, 

Re: Tomcat deployment webapps and the whole stew

2013-06-27 Thread Mark Eggers

On 6/27/2013 8:19 PM, Caldarale, Charles R wrote:

From: Narahari 'n' Savitha [mailto:savith...@gmail.com] Subject:
Re: Tomcat deployment webapps and the whole stew



22:18:34,427 ERROR [ConfigServlet]
com.adp.rev.config.ConfigServlet.init(): Error trying to read file
[null]. Exception = [java.lang.NullPointerException]
java.lang.NullPointerException at
java.io.FileInputStream.init(FileInputStream.java:116) at
java.io.FileInputStream.init(FileInputStream.java:79) at
com.alp.rev.config.ConfigServlet.init(ConfigServlet.java:59)



It is trying to find the faces-config.xml file which does not seem
to be found. (yes it is a part of the war file and exists under
WEB-INF)


Your servlet is making the invalid assumption that its data is
accessible through the file system, which is explicitly not allowed
by the servlet spec.  It should be using
ServletContext.getResourceAsStream() rather than java.io.

- Chuck


+1

I have repaired many web applications where the developers assumed a 
readable (and writeable! - don't ask) file system.


. . . just my two cents
/mde/

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org