What can url-pattern accept?

2008-08-17 Thread Guojun Zhu
Hi,

I am usging tomcat 5.5.26 and trying to set up some container security with
it.  I am using struts 1.2.9 for my project.  Basically I have three-type
links

1.  open to everyone, like the welcome pages.

2.  restricted to one type of user role, say A

3.  admin part, more restrictive, so for role B

I set a normal user only has role A, while an administrator user has both
role A and role B.  However, I have some difficulty to set up the
url-pattern for security-constraint in web.xml.  Both part 2 and 3 are
realized by struts, part 2 takes the root address, such as /doAction1.do,
etc; part 3 takes the admin subdirectory, such as /admin/user.do.  I tried
to set part 2 for url-pattern/*.do/url-pattern and part 3 for
url-pattern/admin/*.do/url-patter.  Tomcat refuses to parse it.  I know
url-pattern can do things like /admin/* for path or *.do for the
extention match.  Any other more finer things?

One ugly solution I can think is to change all the part 2 into a path like
/normal then put that part as /normal/*.  But I would perfer not to do that
since that invole lots of changes in strut-config.xml.   Any other
solution?

Thank in advance!

Sincerely
Zhu, Guojun


Re: What can url-pattern accept?

2008-08-17 Thread André Warnier

Guojun Zhu wrote:
[...]



Unfortunately, it seems that the servlet API allows only this in 
url-pattern specs :

- A string beginning with a / character and ending with a /* suffix is
used for path mapping.
- A string beginning with a *. prefix is used as an extension mapping.
- A string containing only the / character indicates the default 
servlet of the application. In this case the servlet path is the request 
URI minus the context path and the path info is null.

- All other strings are used for exact matches only.

In other words, /admin/*.do is not a valid way to match what you want, 
since it will match only /admin/*.do, literally.


For 20 years at least, there have been 2 widely-used pattern-matching 
variations in existence :
- the file glob kind of pattern, where * anywhere matches any number 
of characters and ? anywhere matches one character

- regular expressions
Why the designers of the servlet API found it useful or necessary to 
invent yet their own different way of matching wildcards, and a rather 
brain-dead one at that, is beyond me.

But so it seems to be.

This being said, it seems that there exists a servlet filter which 
allows much more flexibility.  I have not tried it myself yet, but I 
have seen a lot of nice things written about it.

Check out : http://tuckey.org/urlrewrite/

André

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to set jvmRoute outside of server.xml

2008-08-17 Thread Rainer Jung

Bill Shaffer schrieb:

Hi:

I am trying to find a way to set the jvmRoute without putting it in
my server.xml.  I'm using 6.0.18.  I've found a couple of things:

The Tomcat config reference System Properties section says I can set
it on the java command line with a -DjvmRoute option.  This did not
work.


It will not, except as a special case to your next example.


Another source on the web said that I could set a -D option on the
command line and then reference that as a variable within server.xml
(java ... -Doption=value ..., and then in server.xml,
jvmRoute=${option}.  This did not work either.


This should really work. Maybe when editing server.xml and replacing the 
jvmRoute value with your ${option} you didn't notice, that the config 
line using jvmRoute in server.xml by default is only a comment?



By testing to see if it works I'm going to the servlet examples and
inspecting the Session ID in the Sessions Example.


You test is fine.


Any help would be greatly appreciated.


You could also look at the system properties from inside any of your 
JSPs or servlet to make sure, that the system property option actually 
has been set correctly by your start script.


Regards,

Rainer

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to change Default URL to point to my application index.html page

2008-08-17 Thread Guojun Zhu
you can change the $Catalina.home/conf/Catalina/(your host)/ROOT.xml file to
direct to your webapp path instead of the ROOT.

On Sun, Aug 17, 2008 at 1:36 PM, flytoarun [EMAIL PROTECTED] wrote:

 Hi All,

 I am using tomcat 5 version and my application's default page is
 www.domain.com\myDir\index.html which works fine when i enter full path
 however when i enter www.domain.com then the tomcat default server page
 opens. I want to change this default page by my application index.html
 (Default page).

 Can some one help me.

 I have tried few things but didn't work. Like adding entries in server.xml
 and web.xml

 Thanks in advance.




 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: How to change Default URL to point to my application index.html page

2008-08-17 Thread flytoarun
Hi Guojun,

I have 2 files under path 
/apache-tomcat-5.5.25/conf/Catalina/localhost 
host-manager.xml 
manager.xml 

i don't have ROOT.xml.




--- On Mon, 8/18/08, Guojun Zhu [EMAIL PROTECTED] wrote:

 From: Guojun Zhu [EMAIL PROTECTED]
 Subject: Re: How to change Default URL to point to my application index.html 
 page
 To: Tomcat Users List users@tomcat.apache.org, [EMAIL PROTECTED]
 Date: Monday, August 18, 2008, 12:31 AM
 you can change the $Catalina.home/conf/Catalina/(your
 host)/ROOT.xml file to
 direct to your webapp path instead of the ROOT.
 
 On Sun, Aug 17, 2008 at 1:36 PM, flytoarun
 [EMAIL PROTECTED] wrote:
 
  Hi All,
 
  I am using tomcat 5 version and my application's
 default page is
  www.domain.com\myDir\index.html which works
 fine when i enter full path
  however when i enter www.domain.com then the tomcat
 default server page
  opens. I want to change this default page by my
 application index.html
  (Default page).
 
  Can some one help me.
 
  I have tried few things but didn't work. Like
 adding entries in server.xml
  and web.xml
 
  Thanks in advance.
 
 
 
 
 
 -
  To start a new topic, e-mail: users@tomcat.apache.org
  To unsubscribe, e-mail:
 [EMAIL PROTECTED]
  For additional commands, e-mail:
 [EMAIL PROTECTED]
 
 


  

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to change Default URL to point to my application index.html page

2008-08-17 Thread André Warnier

Guojun Zhu wrote:

you can change the $Catalina.home/conf/Catalina/(your host)/ROOT.xml file to
direct to your webapp path instead of the ROOT.


Or, if I have correctly understood many previous posts to this forum, 
you can delete the ROOT default application and put yours there instead.

A guru here can confirm that, I suppose.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Intgrate Tomcat and PHP in winxp

2008-08-17 Thread Radhakrishnavangara

Hi,

Could you please let me know the step by step instructions for integrating
Tomcat with PHP on Win XP. I have tried implementing various methodologies
to integrate the same , but i could not achieve any breakthrough on the
same. Below are some of the links to the articles which i have referred.
Could you please go through the same and clarify me on this issue. 

http://www.windowscomputer.com/node/3814
http://www.theasolutions.com/tutorials/tomcatphp.jsp
http://the-double-0-project.net/blog/?tag=tomcat
http://209.85.175.104/search?q=cache:szlV41sb9qwJ:uranus.im.chu.edu.tw/~dtchang/phpexplorer/html/download.php%3Ffn%3D..%252F..%252Fpub%252F.%252Fdownload%252Fapache_tomcat%252FRunning%2Bphp%2B5.x%2Bon%2Bwindows%2Busing%2Btomcat%2B4.x%2Bor%2B5.x%2B-%2BSimple%2BThoughts%2B-%2BJava%2Band%2BWeb%2BSoftware.pdf+angusman+tomcathl=enct=clnkcd=7gl=in
http://www.duminy.fr/blog/?p=22language=en

Thanks and Regards,
Radhakrishna
-- 
View this message in context: 
http://www.nabble.com/Intgrate-Tomcat-and-PHP-in-winxp-tp19022523p19022523.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Does Tomcat 6.0.x support Life Cycle Annotations?

2008-08-17 Thread gotobarry

public class MyBean {
   @PostConstruct
public void initialize() {
  //init code
}

@PreDestroy
public void shutdown() {
  //shutdown code
|
}

If so do you have an example?

Cheers
Barry
-- 
View this message in context: 
http://www.nabble.com/Does-Tomcat-6.0.x-support-Life-Cycle-Annotations--tp19022553p19022553.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to change Default URL to point to my application index.html page

2008-08-17 Thread Ken Bowen
If you are uploading your application (myapp) to Tomcat's webapps  
folder as a war (myapp.war), do two things:

1.  Delete webapps/ROOT ;
2.  Rename myapp.war to ROOT.war  (case is important), and then upload  
it to webapps.


On Aug 17, 2008, at 2:36 PM, flytoarun wrote:


Hi All,

I am using tomcat 5 version and my application's default page is www.domain.com 
\myDir\index.html which works fine when i enter full path however  
when i enter www.domain.com then the tomcat default server page  
opens. I want to change this default page by my application  
index.html (Default page).


Can some one help me.

I have tried few things but didn't work. Like adding entries in  
server.xml and web.xml


Thanks in advance.




-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Intgrate Tomcat and PHP in winxp

2008-08-17 Thread Tommy Pham
Hi Radhakrishna,

--- On Sun, 8/17/08, Radhakrishnavangara [EMAIL PROTECTED] wrote:

 From: Radhakrishnavangara [EMAIL PROTECTED]
 Subject: Intgrate Tomcat and PHP in winxp
 To: users@tomcat.apache.org
 Date: Sunday, August 17, 2008, 3:24 PM
 Hi,
 
 Could you please let me know the step by step instructions
 for integrating
 Tomcat with PHP on Win XP. I have tried implementing
 various methodologies
 to integrate the same , but i could not achieve any
 breakthrough on the
 same. Below are some of the links to the articles which i
 have referred.
 Could you please go through the same and clarify me on this
 issue. 
 
 http://www.windowscomputer.com/node/3814
 http://www.theasolutions.com/tutorials/tomcatphp.jsp
 http://the-double-0-project.net/blog/?tag=tomcat
 http://209.85.175.104/search?q=cache:szlV41sb9qwJ:uranus.im.chu.edu.tw/~dtchang/phpexplorer/html/download.php%3Ffn%3D..%252F..%252Fpub%252F.%252Fdownload%252Fapache_tomcat%252FRunning%2Bphp%2B5.x%2Bon%2Bwindows%2Busing%2Btomcat%2B4.x%2Bor%2B5.x%2B-%2BSimple%2BThoughts%2B-%2BJava%2Band%2BWeb%2BSoftware.pdf+angusman+tomcathl=enct=clnkcd=7gl=in
 http://www.duminy.fr/blog/?p=22language=en
 
 Thanks and Regards,
 Radhakrishna
 -- 
 View this message in context:
 http://www.nabble.com/Intgrate-Tomcat-and-PHP-in-winxp-tp19022523p19022523.html
 Sent from the Tomcat - User mailing list archive at
 Nabble.com.
 
IMO if you want to use PHP with Tomcat, it's best you read the documentation 
for both products and their technology as it will help you secure the 
server/platform and troubleshoot any problems that may arise including 
application crashes and security breaches.
For PHP5: http://www.php.net/manual/en/
For Tomcat6: http://tomcat.apache.org/tomcat-6.0-doc/index.html
For Tomcat5.5: http://tomcat.apache.org/tomcat-5.5-doc/index.html

You can just go through the installation steps w/o doing the actual 
installation to see what you have available.  Though I haven't tried this 
method, I think you can run PHP as CGI in Tomcat.  You'll just have to edit the 
web.xml in $CATALINA_HOME/conf folder and follow PHP's instruction of 
installing as CGI.

The method I prefer and have tested to work (in Unix environment although on 
Windows should be similar) is running Apache HTTPD server with PHP as a mod and 
use the connector to connect to Tomcat.  If this method is used, it's easier to 
implement other technologies later such Perl, Python and Mono (for .Net) inside 
Apache HTTPD as mod-*.

But you may want to evaluate your needs and goals before choosing ;)

Regards,
Tommy

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Tomcat 6.0.18 JavaEE 5/EJB3.0

2008-08-17 Thread Tommy Pham
Hi,

I'm trying to develop a web app using JDK1.6 and Tomcat 6.0.18 and JPA.  When 
creating a new web app in Netbeans 6.1, I chose the Java EE 5 version.  Then I 
proceed to create Entity Classes from Databases which were successful.  If I 
try to create JSF pages from Entity Classes, I get:
The class javax.transaction.UserTransaction is unavailable. Add an appropriate 
jar file ...

After adding javaee.jar from Glassfish v2 into my web app and deployed the web 
app, I got this error:
INFO: Illegal access: this web application instance has been stopped already.  
Could not load java.lang.Object.  The eventual following stack trace is caused 
by an error thrown for debugging purposes as well as to attempt to terminate 
the thread which caused the illegal access, and has no functional impact.
java.lang.IllegalStateException
at 
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1273)
at 
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)

I think it's because of the javaee.jar causing conflict with tomcat's jar files.

I know that Tomcat is only a web container but is there a way I can implement 
JavaEE5/EJB3.0 for full Persistence support without having to switch to 
Geronimo 2.x or Glassfish v2/v3?  (I think this is a stupid question but I just 
want to know my options :) I rather not switch to Glassfish if I don't have to 
because of default directory browsing Glassfish has :D

Thanks,
Tommy

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Tomcat 6.0.18 JavaEE 5/EJB3.0

2008-08-17 Thread Caldarale, Charles R
 From: Tommy Pham [mailto:[EMAIL PROTECTED]
 Subject: Tomcat 6.0.18  JavaEE 5/EJB3.0

 I think it's because of the javaee.jar causing conflict with
 tomcat's jar files.

Correct; you don't want to have javaee.jar (or its predecessor, j2ee.jar) 
anywhere near Tomcat.  You can try to extract the necessary packages from 
javaee.jar and place them in Tomcat's lib directory.  Haven't tried it myself; 
we normally use JBoss for EJBs.

 - 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 start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to change Default URL to point to my application index.html page

2008-08-17 Thread Guojun Zhu
I am sorry.  If there is no ROOT.xml, Tomcat will use the default and you
just need to do as Ken said.  Or you can create the ROOT.xml in the
$Catalina.home/conf/Catalina/(your host)/ROOT.xml.  Put Context path=
docBase=${catalina.home}/webapps/(your application path)/ in the file.


On Sun, Aug 17, 2008 at 2:12 PM, flytoarun [EMAIL PROTECTED] wrote:

 Hi Guojun,

 I have 2 files under path
 /apache-tomcat-5.5.25/conf/Catalina/localhost
 host-manager.xml
 manager.xml

 i don't have ROOT.xml.




 --- On Mon, 8/18/08, Guojun Zhu [EMAIL PROTECTED] wrote:

  From: Guojun Zhu [EMAIL PROTECTED]
  Subject: Re: How to change Default URL to point to my application
 index.html page
  To: Tomcat Users List users@tomcat.apache.org, [EMAIL PROTECTED]
  Date: Monday, August 18, 2008, 12:31 AM
  you can change the $Catalina.home/conf/Catalina/(your
  host)/ROOT.xml file to
  direct to your webapp path instead of the ROOT.
 
  On Sun, Aug 17, 2008 at 1:36 PM, flytoarun
  [EMAIL PROTECTED] wrote:
 
   Hi All,
  
   I am using tomcat 5 version and my application's
  default page is
   www.domain.com\myDir\index.html which works
  fine when i enter full path
   however when i enter www.domain.com then the tomcat
  default server page
   opens. I want to change this default page by my
  application index.html
   (Default page).
  
   Can some one help me.
  
   I have tried few things but didn't work. Like
  adding entries in server.xml
   and web.xml
  
   Thanks in advance.
  
  
  
  
  
  -
   To start a new topic, e-mail: users@tomcat.apache.org
   To unsubscribe, e-mail:
  [EMAIL PROTECTED]
   For additional commands, e-mail:
  [EMAIL PROTECTED]
  
  




 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: Does Tomcat 6.0.x support Life Cycle Annotations?

2008-08-17 Thread Bill Barker
It doesn't support it for JavaBeans.  Only for things like Servlets, 
Filters, and Listeners.  Anyway, there is no way for Tomcat to know when to 
call @PreDestroy on a Bean, since only the JVM keeps track of who is holding 
a reference to it.

gotobarry [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]

 public class MyBean {
   @PostConstruct
public void initialize() {
  //init code
}

@PreDestroy
public void shutdown() {
  //shutdown code
|
 }

 If so do you have an example?

 Cheers
 Barry
 -- 
 View this message in context: 
 http://www.nabble.com/Does-Tomcat-6.0.x-support-Life-Cycle-Annotations--tp19022553p19022553.html
 Sent from the Tomcat - User mailing list archive at Nabble.com.


 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]

 




-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tomcat Marketing - At last!

2008-08-17 Thread Mark Thomas
Johnny Kewl wrote:
 I see someone has stuck this up
 http://wiki.apache.org/tomcat/PoweredBy

Someone hasn't been reading the documentation. That page has existed (in
one form or another) for well over 4 years.

 who ever did it... well done, its about time, TC is under marketed...
 and its brilliant.
 
 Now others are needed for all sorts of things like...
 
 + SP's that supply TC services...
 + Programmers that provide TC services...
 + Yada yada...

It's a wiki. If you want it, create it.

I'd recommend keeping the entries short and sweet, like the powered by
page. We don't want pages and pages of material - just a small image, a few
words and a link.

 These guys like Chuck and others need have a place that says... I do
 these services.
 
 AND
 
 This must be a section to these links... in the actual TC's help

The FAQ is linked from the Tomcat docs.

 files... in the TC package as well.
 But nicely done... not in your face...

I would argue that it is. Of course, if you have ideas to make it better,
patches are always welcome...

 + How to setup TC
 + How to find a TC SP
 + How to get a TC coder
 + How to stop your wife from bugging you while you having fun with TC...
 ok not that one ;)
 
 There must be no doubt to any newbie, that they have stumbled onto a
 great product...
 
 Well done...



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: What can url-pattern accept?

2008-08-17 Thread Bill Barker

André Warnier [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 Guojun Zhu wrote:
 [...]


 Unfortunately, it seems that the servlet API allows only this in 
 url-pattern specs :
 - A string beginning with a / character and ending with a /* suffix is
 used for path mapping.
 - A string beginning with a *. prefix is used as an extension mapping.
 - A string containing only the / character indicates the default servlet 
 of the application. In this case the servlet path is the request URI minus 
 the context path and the path info is null.

Actually, I don't think that Tomcat supports url-pattern//url-pattern 
(although it clearly should under the very brain-dead wording of the spec 
here).  There seem to be other spec violations in Tomcat here, since if you 
have a one security-constraint for *.do, and another one for /admin/*, then 
Tomcat considers both of them for a request to /myapp/admin/foo.do. 
However, the spec (at least for v2.5) says that only the /admin/* constraint 
should be considered.  And this is where the brain-dead part kicks in :(, 
since Tomcat's implementation makes more sense than the spec.  Hopefully 
someone will fix this in the Servlet 3.0 spec.

 - All other strings are used for exact matches only.

 In other words, /admin/*.do is not a valid way to match what you want, 
 since it will match only /admin/*.do, literally.

 For 20 years at least, there have been 2 widely-used pattern-matching 
 variations in existence :
 - the file glob kind of pattern, where * anywhere matches any number 
 of characters and ? anywhere matches one character
 - regular expressions
 Why the designers of the servlet API found it useful or necessary to 
 invent yet their own different way of matching wildcards, and a rather 
 brain-dead one at that, is beyond me.
 But so it seems to be.

 This being said, it seems that there exists a servlet filter which 
 allows much more flexibility.  I have not tried it myself yet, but I have 
 seen a lot of nice things written about it.
 Check out : http://tuckey.org/urlrewrite/

 André

 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]

 




-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tomcat 6.0.18 JavaEE 5/EJB3.0

2008-08-17 Thread Bill Barker

Tommy Pham [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 Hi,

 I'm trying to develop a web app using JDK1.6 and Tomcat 6.0.18 and JPA. 
 When creating a new web app in Netbeans 6.1, I chose the Java EE 5 
 version.  Then I proceed to create Entity Classes from Databases which 
 were successful.  If I try to create JSF pages from Entity Classes, I get:
 The class javax.transaction.UserTransaction is unavailable. Add an 
 appropriate jar file ...

 After adding javaee.jar from Glassfish v2 into my web app and deployed the 
 web app, I got this error:
 INFO: Illegal access: this web application instance has been stopped 
 already.  Could not load java.lang.Object.  The eventual following stack 
 trace is caused by an error thrown for debugging purposes as well as to 
 attempt to terminate the thread which caused the illegal access, and has 
 no functional impact.
 java.lang.IllegalStateException
at 
 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1273)
at 
 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)

 I think it's because of the javaee.jar causing conflict with tomcat's jar 
 files.

 I know that Tomcat is only a web container but is there a way I can 
 implement JavaEE5/EJB3.0 for full Persistence support without having to 
 switch to Geronimo 2.x or Glassfish v2/v3?  (I think this is a stupid 
 question but I just want to know my options :) I rather not switch to 
 Glassfish if I don't have to because of default directory browsing 
 Glassfish has :D


GlassFish contains only a forked version of Tomcat, so changes to Tomcat may 
not show up there (and conversely, changes to GlassFish may not show up in 
Tomcat).  The only J2EE Container that I know uses a pure version of Tomcat 
is Geronimo (but, while not having looked, I understand that the changes in 
JBoss are pretty minor).

I agree with Chuck that you shouldn't include a full J2EE jar (any vendor) 
with Tomcat, and often times the easiest is to just include the pieces you 
need.   But I'm guessing that it will be easier for you to just pick a J2EE 
vendor.

 Thanks,
 Tommy

 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]

 




-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Tomcat 6.0.18 JavaEE 5/EJB3.0

2008-08-17 Thread Martin Gainty

doc from JBOSS 4.2.2.GA
Tomcat 6 is now bundled as part of JBoss Web.
deploy/jbossweb-tomcat55.sar has been replaced by
deploy/jboss-web.deployer.
(much easier to configure in TC than resin)

Martin 
__ 
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official business 
of Sender. This transmission is of a confidential nature and Sender does not 
endorse distribution to any party other than intended recipient. Sender does 
not necessarily endorse content contained within this transmission. 


 From: [EMAIL PROTECTED]
 To: users@tomcat.apache.org
 Date: Sun, 17 Aug 2008 17:30:47 -0500
 Subject: RE: Tomcat 6.0.18  JavaEE 5/EJB3.0
 
  From: Tommy Pham [mailto:[EMAIL PROTECTED]
  Subject: Tomcat 6.0.18  JavaEE 5/EJB3.0
 
  I think it's because of the javaee.jar causing conflict with
  tomcat's jar files.
 
 Correct; you don't want to have javaee.jar (or its predecessor, j2ee.jar) 
 anywhere near Tomcat.  You can try to extract the necessary packages from 
 javaee.jar and place them in Tomcat's lib directory.  Haven't tried it 
 myself; we normally use JBoss for EJBs.
 
  - 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 start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 

_
See what people are saying about Windows Live.  Check out featured posts.
http://www.windowslive.com/connect?ocid=TXT_TAGLM_WL_connect2_082008

Re: Tomcat 6.0.18 JavaEE 5/EJB3.0

2008-08-17 Thread Johnny Kewl


- Original Message - 
From: Tommy Pham [EMAIL PROTECTED]

To: users@tomcat.apache.org
Sent: Sunday, August 17, 2008 11:50 PM
Subject: Tomcat 6.0.18  JavaEE 5/EJB3.0



Hi,

I'm trying to develop a web app using JDK1.6 and Tomcat 6.0.18 and JPA. 
When creating a new web app in Netbeans 6.1, I chose the Java EE 5 
version.  Then I proceed to create Entity Classes from Databases which 
were successful.  If I try to create JSF pages from Entity Classes, I get:
The class javax.transaction.UserTransaction is unavailable. Add an 
appropriate jar file ...


After adding javaee.jar from Glassfish v2 into my web app and deployed the 
web app, I got this error:
INFO: Illegal access: this web application instance has been stopped 
already.  Could not load java.lang.Object.  The eventual following stack 
trace is caused by an error thrown for debugging purposes as well as to 
attempt to terminate the thread which caused the illegal access, and has 
no functional impact.

java.lang.IllegalStateException
   at 
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1273)
   at 
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)


I think it's because of the javaee.jar causing conflict with tomcat's jar 
files.


I know that Tomcat is only a web container but is there a way I can 
implement JavaEE5/EJB3.0 for full Persistence support without having to 
switch to Geronimo 2.x or Glassfish v2/v3?  (I think this is a stupid 
question but I just want to know my options :) I rather not switch to 
Glassfish if I don't have to because of default directory browsing 
Glassfish has :D


Thanks,
Tommy


Tommy if you havnt already... have a look at Visual Web Pages... it has the 
dB wizards and it works with TC.
Doesnt use JPA, it uses Cached Rowsets to persist... which are actually 
easier to understand, I think ;)


... nothing stopping you from making a lib that uses JPA, and then using 
that in TC, but you not going to get the dB wizards to work with the web...


Visual Web Pages is the JSF technology... I didnt even know Sun had got JPA 
and WEB wizards working yet ;)
Anyway... TC and JSF are friendly... via VWP... if you wont to give that a 
spin on NB

Make a web project... select VWP... choose TC as the server... maybe ;)

---
HARBOR : http://www.kewlstuff.co.za/index.htm
The most powerful application server on earth.
The only real POJO Application Server.
See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm
--- 



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tomcat 6.0.18 JavaEE 5/EJB3.0

2008-08-17 Thread Tommy Pham
Hi Johnny,

--- On Sun, 8/17/08, Johnny Kewl [EMAIL PROTECTED] wrote:
 
 Tommy if you havnt already... have a look at Visual Web
 Pages... it has the 
 dB wizards and it works with TC.
 Doesnt use JPA, it uses Cached Rowsets to persist... which
 are actually 
 easier to understand, I think ;)
 
 ... nothing stopping you from making a lib that uses JPA,
 and then using 
 that in TC, but you not going to get the dB wizards to work
 with the web...
 
 Visual Web Pages is the JSF technology... I didnt even know
 Sun had got JPA 
 and WEB wizards working yet ;)
 Anyway... TC and JSF are friendly... via VWP... if you wont
 to give that a 
 spin on NB
 Make a web project... select VWP... choose TC as the
 server... maybe ;)
 

I did try out VWP before but I had some problems with it regarding db 
automatically generating PK. 
http://forums.java.net/jive/message.jspa?messageID=259409#259409
Since my database is normalized creating multiple one-to-many relationships, I 
need the generated key to insert into other tables at the same time.  With 
Persistence, I can make full use of transaction if any part of the inserts 
failed w/o having to worry much about incomplete/junk data in my db because 
Persistence can give me the generated key right after insert :)

Thanks,
Tommy

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tomcat 6.0.18 JavaEE 5/EJB3.0

2008-08-17 Thread Johnny Kewl


- Original Message - 
From: Tommy Pham [EMAIL PROTECTED]

To: Tomcat Users List users@tomcat.apache.org
Sent: Monday, August 18, 2008 4:29 AM
Subject: Re: Tomcat 6.0.18  JavaEE 5/EJB3.0



Hi Johnny,

--- On Sun, 8/17/08, Johnny Kewl [EMAIL PROTECTED] wrote:


Tommy if you havnt already... have a look at Visual Web
Pages... it has the
dB wizards and it works with TC.
Doesnt use JPA, it uses Cached Rowsets to persist... which
are actually
easier to understand, I think ;)

... nothing stopping you from making a lib that uses JPA,
and then using
that in TC, but you not going to get the dB wizards to work
with the web...

Visual Web Pages is the JSF technology... I didnt even know
Sun had got JPA
and WEB wizards working yet ;)
Anyway... TC and JSF are friendly... via VWP... if you wont
to give that a
spin on NB
Make a web project... select VWP... choose TC as the
server... maybe ;)



I did try out VWP before but I had some problems with it regarding db 
automatically generating PK. 
http://forums.java.net/jive/message.jspa?messageID=259409#259409
Since my database is normalized creating multiple one-to-many 
relationships, I need the generated key to insert into other tables at the 
same time.  With Persistence, I can make full use of transaction if any 
part of the inserts failed w/o having to worry much about incomplete/junk 
data in my db because Persistence can give me the generated key right 
after insert :)


Tommy I actually have my own persist framework... but just having a quick 
squiz at that, that problem is just a normal Java thing... ie type 
conversions can be a little tricky...


int and Integer are not the same thing in Java...

its going to be something like

int i = Integer.parseInt(TheThing);
I think...

same story for long... ie one is a primitive type and one is a class... diff 
mem structure but Java alsways has a slightly obscure conversion 
somewhere...


Have fun
Anyway, just wanted to make sure you knew VWP was there

---
HARBOR : http://www.kewlstuff.co.za/index.htm
The most powerful application server on earth.
The only real POJO Application Server.
See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm
---


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



how to populate database with SHA hash for DIGEST

2008-08-17 Thread DIGLLOYD INC

How to produce the hashed password when using auth-method DIGEST ?

Everything works with cleartext passwords using the following login- 
config in web.xml:


login-config
auth-methodDIGEST/auth-method
realm-nameDIGLLOYD.COM/realm-name
/login-config

and in context.xml:

Realm className=org.apache.catalina.realm.JDBCRealm  
connectionName=test
connectionPassword=test123 connectionURL=jdbc:mysql:// 
localhost/test

driverName=com.mysql.jdbc.Driver
userTable=UserAuth userNameCol=username  
userCredCol=password

userRoleTable=UserRole roleNameCol=role  /

Now I want to add attribute digest=SHA to the Realm above.  What  
value to insert for the password in the database? Following the Tomcat  
6 docs, I tried inserting the value produced by the following:


String credentials = username + : + DIGLLOYD.COM + : + password;
org.apache.catalina.realm.RealmBase.Digest( credentials, SHA, null);

(http://tomcat.apache.org/tomcat-6.0-doc/realm-howto.html)

I've verified that the DB contains the hash values produced by Digest().

It isn't working; all attempts to login fail.

Help is greatly appreciated.

Lloyd Chambers
http://diglloyd.com

[Mac OS X 10.5.2 Intel, Tomcat 6.0.16]




On Apr 22, 2008, at 9:37 AM, Mark Thomas wrote:


DIGLLOYD INC wrote:
Is the realm the realm-name specified in the login-config in  
web.xml? (eg Tomcat Manager Application)

Yes.

(link above) suggest localhost:80 might be the realm, but that  
makes no sense to me, as this would tie it to a specific port.

That is the default you get if you don't specify one.

The book I have -- Tomcat, The Definitive Guide, 2nd Edition is  
in conflict with the above documentation, making no mention of  
digesting with the username and realm.  The book suggest doing:

bin/digest.sh -a MD5 user-password
As does the docs. This is for digested passwords with BASIC or FORM  
auth.



But the tomcat 6 docs referenced above suggest doing:
bin/digest.sh -a MD5 username:realm-name:password

This is for digested passwords with DIGEST auth.


--obviously very different approaches!

Because they have different uses.

Mark


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tomcat 6.0.18 JavaEE 5/EJB3.0

2008-08-17 Thread Tommy Pham

--- On Sun, 8/17/08, Johnny Kewl [EMAIL PROTECTED] wrote:

 Tommy I actually have my own persist framework... but just
 having a quick 
 squiz at that, that problem is just a normal Java thing...
 ie type 
 conversions can be a little tricky...
 
 int and Integer are not the same thing in Java...
 
 its going to be something like
 
 int i = Integer.parseInt(TheThing);
 I think...
 
 same story for long... ie one is a primitive type and one
 is a class... diff 
 mem structure but Java alsways has a slightly obscure
 conversion 
 somewhere...
 
 Have fun
 Anyway, just wanted to make sure you knew VWP was there
 
 
Thanks,  because of VWP (with table navigation/pagination and sort features), 
that's why I stuck with Netbeans for my IDE :D.  Only drawback IMO with 
Netbeans is lack of various server support like Eclipse.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Does Tomcat 6.0.x support Life Cycle Annotations?

2008-08-17 Thread gotobarry

Thanks. What if it is a JSF Managed Bean? Wouldn't TC be responsible for
lifecycle mgmt?


Bill Barker-2 wrote:
 
 It doesn't support it for JavaBeans.  Only for things like Servlets, 
 Filters, and Listeners.  Anyway, there is no way for Tomcat to know when
 to 
 call @PreDestroy on a Bean, since only the JVM keeps track of who is
 holding 
 a reference to it.
 
 gotobarry [EMAIL PROTECTED] wrote in message 
 news:[EMAIL PROTECTED]

 public class MyBean {
   @PostConstruct
public void initialize() {
  //init code
}

@PreDestroy
public void shutdown() {
  //shutdown code
|
 }

 If so do you have an example?

 Cheers
 Barry
 -- 
 View this message in context: 
 http://www.nabble.com/Does-Tomcat-6.0.x-support-Life-Cycle-Annotations--tp19022553p19022553.html
 Sent from the Tomcat - User mailing list archive at Nabble.com.


 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]

 
 
 
 
 
 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Does-Tomcat-6.0.x-support-Life-Cycle-Annotations--tp19022553p19026212.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]