MessageResources in Model

2004-08-26 Thread Honza Spurn
Hi there,

I know this is not request for Tomcat mailing list, but since I could not
connect to struts mailing list, I've tried last chance here :o) Thanks for
understanding.

I have my own class called CountrySeparator:

public class CountrySeparator {
...
}

I'd like to use messageResources here in some method, so I have design this
method:

public static String getSomething(HttpServletRequest, String key)
{
// I have locale stored in session
Locale locale = (Locale)request.getSession().getAttribute(locale);
MessageResources messages =
((MessageResources)request.getAttribute(Globals.MESSAGES_KEY));

return messges.getMessage(locale, key);
}

BUT on the line with
return messges.getMessage(locale, key);
command, it throws exception about null pointer. When I try to printout the
messages object, it writes me null :(

So it means, that I has not been able to access MessageResources object.

What I'm supposed to do to acccess this object?

Please could anybody help?

Thanks a lot.

Sporak


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Setting classpath out of the webapp directory

2004-05-03 Thread Honza Spurn
Hi there,

I'have been trying to set the classpath of the webapp out of the directory
of this webapp. This is for me little important, since some classes I'd like
to use (I have to use) in other webapps. I want to have only one file of
this class -- I don't want to copy classes between the webapps.

I'm sure it is possible to do it, as I need it, but I don't know how. Would
be anybody so kind and help me with this?

I would also like to export the lib directory of webapp out of the webapp
directory so that the shared libaries could be presented as file only once.
This is probably the same problem as above.

Could anybody help me? Thanks a lot.

Best Regards.
Honza Spurny


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



How to set different security layer in subcontext?

2004-05-03 Thread Honza Spurn
Hi there,

please, I need to set unsecure connection in subcontext of secure context.
:)

It means:  I have webapp1, that is set as:

security-constraint
web-resource-collection
web-resource-namewebapp1/web-resource-name
url-pattern/*/url-pattern
http-methodGET/http-method
http-methodPOST/http-method
/web-resource-collection

user-data-constraint
transport-guaranteeCONFIDENTIAL/transport-guarantee
/user-data-constraint
/security-constraint

What I need is, to set some subdirectory of webapp-direcotry to have no
security connection. So the directory DIR should be accessible also in http
requests.

So I would like to specify something like this:

security-constraint
web-resource-collection
web-resource-nameunsecure directory/web-resource-name
url-pattern/DIR/*/url-pattern
http-methodGET/http-method
http-methodPOST/http-method
/web-resource-collection

user-data-constraint
transport-guaranteeNONE/transport-guarantee
/user-data-constraint
/security-constraint

I've tried this, but this doesn't work.

Would be anybody so kind and help.

Thanks a lot.
Best Regards
Honza Spurny


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Setting classpath out of the webapp directory

2004-05-03 Thread Honza Spurn
Eric Noel wrote:
 On 5/3/2004 4:26 PM, Honza Spurn wrote:

 Hi there,

 I'have been trying to set the classpath of the webapp out of the
 directory of this webapp. This is for me little important, since
 some classes I'd like to use (I have to use) in other webapps. I
 want to have only one file of this class -- I don't want to copy
 classes between the webapps.

 I'm sure it is possible to do it, as I need it, but I don't know
 how. Would be anybody so kind and help me with this?

 I would also like to export the lib directory of webapp out of the
 webapp directory so that the shared libaries could be presented as
 file only once. This is probably the same problem as above.

 Could anybody help me? Thanks a lot.

 Best Regards.
 Honza Spurny


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



 $CATALINA_HOME/common/lib - jars
 $CATALINA_HOME/common/classes - classes


After I did so, tomcat stops to work at all. Should I set some settings in
tomcat or what is wrong, does anybody know about it. The error that occures
is java.lnag.NoSuchMethodException:
org.apache.catalina.startup.Catalina.setAwait(boolean).

Only things I did are:
- in the common directory I've created src directory
- into the src dir I've copied all shared java-sourced classes
- i've compiled them into the common/classes directory
- i've copied some shared libaries into the common/lib
- i've removed whole directory webapps/MyApp/WEB-INF/classes/ (classes
direcotry is still presented, but it is almost empty -- except the
messageResources files -- these were leaved in the original space)
- i've restarted tomcat
- errors occures

Please can anybody help.

Thanks a lot
Best Regards
Honza S.

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Setting classpath out of the webapp directory

2004-05-03 Thread Honza Spurn
I've done:

- in the common directory I've created src directory
- into the src dir I've copied all shared java-sourced classes
- i've compiled them into the common/classes directory
- i've copied some shared libaries into the common/lib
- i've removed whole directory webapps/MyApp/WEB-INF/classes/ (classes
direcotry is still presented, but it is almost empty -- except the
messageResources files -- these were leaved in the original space)
- i've restarted tomcat

Now no error occures. But after I want to connect to the webapp, that has
some classes in the common/classes directory, the blank page in the browser
occures and on the tomcat-terminal is written: java.lang.ClassCastException.
This means, as I know, that tomcat can find this classes in the
common/classes directory. :(

Does anybody know, what I should set in the tomcat variables to let tomcat
could search the common/classes directory for classes?

Thanks a lot for help
Honza S.

Eric Noel wrote:
 On 5/3/2004 4:26 PM, Honza Spurn wrote:

 Hi there,

 I'have been trying to set the classpath of the webapp out of the
 directory of this webapp. This is for me little important, since
 some classes I'd like to use (I have to use) in other webapps. I
 want to have only one file of this class -- I don't want to copy
 classes between the webapps.

 I'm sure it is possible to do it, as I need it, but I don't know
 how. Would be anybody so kind and help me with this?

 I would also like to export the lib directory of webapp out of the
 webapp directory so that the shared libaries could be presented as
 file only once. This is probably the same problem as above.

 Could anybody help me? Thanks a lot.

 Best Regards.
 Honza Spurny


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



 $CATALINA_HOME/common/lib - jars
 $CATALINA_HOME/common/classes - classes

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



java.lang.NoClassDefFoundError: javax/mail/Address

2004-03-24 Thread Honza Spurn
Hi there,

this is little bit about java, so it should not be here at the first view.
I'm sorry for it. But on the second view:

This error is seen when I want to initialize object that use some classes
from javax.mail package for example javax.mail.Message).
I don't have import javax.mail.Address written in this object. This object
could look like:

package com.sporak.MyObject;

import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.Message;
import javax.mail.internet.MimeMessage;
import javax.mail.internet.InternetAddress;

public class MyObject {

   private int id;

   public MyObject() {
   }

   public int getId() {...}
   public void setId() {...}

}

When I want to create new object in action class by the expression:
line 29: MyObject o = new MyObject();

The tomcat starts to notifing me an error:

java.lang.NoClassDefFoundError: javax/mail/Address
com.sporak.MyAction.execute(MyAction.java:29)

org.apache.struts.action.RequestProcessor.processActionPerform(RequestProces
sor.java:484)

org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
...

This is not only about java, I think, since this MyAction and this MyObject
worked fine in previous versions of TomCat. Few days ago I've updated TomCat
to 5.0.19 version and this error occures. Interesting is, that:

- in WEB-INF/lib I have j2ee.jar libary with requested class file
(Address.class)
- all other classes from javax.mail package are found and used correctly
- in TomCat 4.1 it works fine, in TomCat 5.0.19 it doesn't work at all

Please, is there anybody, that had had a similiar problem and solved it?
Please does anybody know how to walk throught it?

Thanks for helping.

Best Regards
Honza Spurny


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Tomcat + SSL

2003-10-03 Thread Honza Spurn
Hi there,

I'm using TomCat 4.1 and I want to configure SSL conection. I've used how-to
manual from site
http://jakarta.apache.org/tomcat/tomcat-3.3-doc/tomcat-ssl-howto.html

- i've generated keystroke and saved it into c:\.keystroke
- i've modified server.xml file using this:

Connector
   className=org.apache.catalina.connector.http.HttpConnector
   port=
   minProcessors=5
   maxProcessors=75
   enableLookups=true
   acceptCount=10
   debug=0
   scheme=https
   secure=true

   Factory
  className=org.apache.catalina.net.SSLServerSocketFactory
  clientAuth=false
  protocol=TLS
  keystrokeFile=c:\.keystroke
  keystrokePass=master
   /
/Connector

When I want to start tomcat it crash down with this message:

Catalina.start: LifycycleExeption: null:open:
java.io.FileNotFoundException: C:\Documents and Settings\Jan
Spurny\.keystore (The system cannot find the file specified) ...

This is little strange to me, since I've declared the keystrokeFile
atributte little different and the file specified DOES exists.

Please, could anybody help me? I'd be really pleased.

Thanks.

Honza Spurny


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tomcat + SSL

2003-10-03 Thread Honza Spurn
Ought! Thanks, this was really stupid mistake. Thanks for that.

Honza S.


Christopher Williams wrote:
 Change keystrokeFile to keystoreFile and keystrokePass to
 keystorePass.
 
 Chris.
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]