Re: Fwd: Jersey libraries 1.18 worked with Tomcat 7 but failing with Tomcat 9 : Root resource classes not getting scanned

2021-01-29 Thread Christopher Schultz

Yogish,

On 1/29/21 01:24, Yogish Anand wrote:

We were using Tomcat 7 and the Jersey libraries 1.18 was able to scan the
packages with the below two lines

com.sun.jersey.api.core.PackagesResourceConfig.init Scanning for root
resource and provider classes in the packages:
 v1

com.sun.jersey.api.core.ScanningResourceConfig logClasses
 INFO: Root resource classes found:
 class v1.add

We migrated to Tomcat 9 (Note : We use the old server.xml which we used in
Tomcat 7)


You should probably stop right now and fix that. conf/server.xml files 
are not compatible between versions unless you are extraordinarily lucky.



we are getting only the below line but we don't get the message
"Root resource classes found" and the REST API is failing

com.sun.jersey.api.core.PackagesResourceConfig.init Scanning for root
resource and provider classes in the packages:
 v1

Please let me know how to troubleshoot and fix the issue?


I think you will get better feedback from the Jersey project than the 
Tomcat project. We have no idea what Jersey is doing when it scans for 
"root resource and provider classes".


-chris

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



Re: How to completely deactivate JSESSIONID cookie entry (in Chrome's Cookie list)

2021-01-29 Thread Tillmann Schulz
Hi Peter,
>>Go to a site that does not use sessions (and tomcat) and it will have that 
>>entry.
You are right, every site with no cookies causes the entry under cookies in 
chrome.
So this issue is solved. Thank you
Tillmann
  

Re: How to completely deactivate JSESSIONID cookie entry (in Chrome's Cookie list)

2021-01-29 Thread Martin Grigorov
On Fri, Jan 29, 2021 at 12:03 PM Tillmann Schulz
 wrote:

> Hi there,
>
> I am using Tomcat 8.5.58 and have a problem with JSESIONID cookie.
> It should be possible to completly deactivate the jsessionid cookie with
> the following code:
>
> <%@ page session="false" %>
>

This says that this particular JSP does not create an HTTP session but if
any other JSP of your app creates one then it will be transfered for all
requests until it is either deleted or it expires.


>
> If you do that and call the JSP, there is in no entry under cookies in
> google chrome's cookie list (if you press F12 in chrome) .
> But in chrome's cookie list there is a host entry for the hostname of the
> JSP.
>

What is the name of this cookie ?


> This is confusing, because there are no cookies set.
>
> I am not sure if this is a tomcat issue, but under firefox it also looks
> simular.
>
> Is it possible to completly deactivate cookies? There shouldn't be any
> hostname visible in the cookie view.
>
> Thank you for your help in advance
>
> Tillmann
>
>
>
>


Re: How to completely deactivate JSESSIONID cookie entry (in Chrome's Cookie list)

2021-01-29 Thread logo

Hi Tillmann,

Am 2021-01-29 11:00, schrieb Tillmann Schulz:

Hi there,

I am using Tomcat 8.5.58 and have a problem with JSESIONID cookie.
It should be possible to completly deactivate the jsessionid cookie
with the following code:

<%@ page session="false" %>

If you do that and call the JSP, there is in no entry under cookies in
google chrome's cookie list (if you press F12 in chrome) .
But in chrome's cookie list there is a host entry for the hostname of 
the JSP.

This is confusing, because there are no cookies set.

I am not sure if this is a tomcat issue, but under firefox it also
looks simular.

Is it possible to completly deactivate cookies? There shouldn't be any
hostname visible in the cookie view.

I doubt that this is a matter of the usage of cookies. That's default 
behaviour of the browser, that will create that per site. Go to a site 
that does not use sessions (and tomcat) and it will have that entry.


Peter


Thank you for your help in advance

Tillmann


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



How to completely deactivate JSESSIONID cookie entry (in Chrome's Cookie list)

2021-01-29 Thread Tillmann Schulz
Hi there,

I am using Tomcat 8.5.58 and have a problem with JSESIONID cookie.
It should be possible to completly deactivate the jsessionid cookie with the 
following code: 

<%@ page session="false" %>

If you do that and call the JSP, there is in no entry under cookies in google 
chrome's cookie list (if you press F12 in chrome) . 
But in chrome's cookie list there is a host entry for the hostname of the JSP.
This is confusing, because there are no cookies set.

I am not sure if this is a tomcat issue, but under firefox it also looks 
simular.

Is it possible to completly deactivate cookies? There shouldn't be any hostname 
visible in the cookie view.

Thank you for your help in advance

Tillmann





Re: How to define UserDatabase for webapp in context?

2021-01-29 Thread Karim Kanso
On Fri, 29 Jan 2021 at 09:23, Mark Thomas  wrote:
>
> On 29/01/2021 08:49, Karim Kanso wrote:
> > I have been trying to create a context xml file for a webapp so that
> > it encapsulates all needed server side configuration for
> > authentication to work. That is, it contains both the  and
> >  elements.
> >
> > I dont understand why the following definition of a context does not
> > work (although does work when the  element is moved into
> > server.xml):
> >
> > $ cat conf/Catalina/localhost/tomcatapp.xml
> > 
> > 
> >   >  name="MyUserDatabase"
> >  auth="Container"
> >  type="org.apache.catalina.UserDatabase"
> >  factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
> >  pathname="conf/myapp-users.xml"
> >  />
> >   >  className="org.apache.catalina.realm.UserDatabaseRealm"
> >  resourceName="MyUserDatabase"
> >  />
> > 
> >
> > This gives the error:
> >
> > javax.naming.NameNotFoundException: Name [MyUserDatabase] is not bound
> > in this Context. Unable to find [MyUserDatabase].
> >
> > The documentation shows that the  element is valid within a
> > . Is it possible to do this?
>
> http://tomcat.apache.org/tomcat-9.0-doc/config/realm.html
>
> Search for "localDataSource"
>
> Mark
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>

Ah ok. Thankyou Mark.

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



Re: How to define UserDatabase for webapp in context?

2021-01-29 Thread Mark Thomas
On 29/01/2021 08:49, Karim Kanso wrote:
> I have been trying to create a context xml file for a webapp so that
> it encapsulates all needed server side configuration for
> authentication to work. That is, it contains both the  and
>  elements.
> 
> I dont understand why the following definition of a context does not
> work (although does work when the  element is moved into
> server.xml):
> 
> $ cat conf/Catalina/localhost/tomcatapp.xml
> 
> 
>name="MyUserDatabase"
>  auth="Container"
>  type="org.apache.catalina.UserDatabase"
>  factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
>  pathname="conf/myapp-users.xml"
>  />
>className="org.apache.catalina.realm.UserDatabaseRealm"
>  resourceName="MyUserDatabase"
>  />
> 
> 
> This gives the error:
> 
> javax.naming.NameNotFoundException: Name [MyUserDatabase] is not bound
> in this Context. Unable to find [MyUserDatabase].
> 
> The documentation shows that the  element is valid within a
> . Is it possible to do this?

http://tomcat.apache.org/tomcat-9.0-doc/config/realm.html

Search for "localDataSource"

Mark

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



How to define UserDatabase for webapp in context?

2021-01-29 Thread Karim Kanso
I have been trying to create a context xml file for a webapp so that
it encapsulates all needed server side configuration for
authentication to work. That is, it contains both the  and
 elements.

I dont understand why the following definition of a context does not
work (although does work when the  element is moved into
server.xml):

$ cat conf/Catalina/localhost/tomcatapp.xml


 
 


This gives the error:

javax.naming.NameNotFoundException: Name [MyUserDatabase] is not bound
in this Context. Unable to find [MyUserDatabase].

The documentation shows that the  element is valid within a
. Is it possible to do this?

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