Tomcat 9 memory leak message

2024-05-31 Thread Ying Jin
We removed the ojdbc8 driver jar from web-inf/lib from the web application
and kept the ojdbc8 jar file in the Tomcat/lib folder, but we still can see
the following memory link warning message whenever we redeploy the web
application. We use the Tomcat 9 server in the Linux environment.

The other warning message is about the "validateFile Problem with jar file
/tomcat/lib/jolokia.jar. My question is if we can safely ignore these
warning messages or not.

It would be great if you can shed some light on this issue.
[image: image.png]


Your help is much appreciated!
Jenny


Re: Tomcat 9 memory leak message

2024-05-31 Thread Ying Jin
Chris,

Thanks for your reply!

We already removed the ojdbc8.jar file from the application's Web-inf/lib
folder as suggested in the following post, however, we still got the
warning messages below after the application is deployed to the Tomcat 9
server.

https://stackoverflow.com/questions/6981564/why-must-the-jdbc-driver-be-put-in-tomcat-home-lib-folder

WARNING: The web application [Our Web Application Name] appears to have
started a thread named [InterruptTimer] but has failed to stop it. This is
very likely to create a memory leak. Stack trace of thread:

WARNING: The web application [Our Web Application Name] appears to have
started a thread named [oracle.jdbc.diagnostics.Diagnostic.CLOCK] but has
failed to stop it. This is very likely to create a memory leak. Stack trace
of thread:

I also read some posts saying these warning messages can be safely ignored
if the Tomcat version is greater than 7.0. I'm not sure if this is correct
or not.

Please advise,

Many thanks!
Jenny

On Fri, May 31, 2024 at 3:50 PM Christopher Schultz <
ch...@christopherschultz.net> wrote:

> Jenny,
>
> On 5/31/24 14:52, Ying Jin wrote:
> > We removed the ojdbc8 driver jar from web-inf/lib from the web
> > application and kept the ojdbc8 jar file in the Tomcat/lib folder, but
> > we still can see the following memory link warning message whenever we
> > redeploy the web application. We use the Tomcat 9 server in the Linux
> > environment.
>
> This list strips attachments. Can you re-post with text-only?
>
> > The other warning message is about the "validateFile Problem with jar
> > file /tomcat/lib/jolokia.jar. My question is if we can safely ignore
> > these warning messages or not.
> >
> > It would be great if you can shed some light on this issue.
>
> If the message is something like "driver cannot be unloaded" then check
> Tomcat with a debugger or even something like JVisualVM to see how many
> WebappClassLoaders you have in memory.
>
> If the driver causes the web application ClassLoader to be "pinned" in
> memory, then it will never be removed and all those classes will
> continue to use-up heap space until you restart the JVM. This gets worse
> every time you reload your application without restarting the JVM. The
> Manager application web UI can help you diagnose these a little.
>
> The validation problem with the Jolokia JAR file will depend upon
> exactly what it says. I would first get a replacement copy of the
> Jolokia JAR file before bothering to try to diagnose it any further.
>
> -chris
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: Tomcat 9 memory leak message

2024-06-01 Thread Ying Jin
Chris,

Thanks so much  for your suggestions!

We use Oracle version 19. I read the post you mentioned and found that this
warning message can be safely ignored. Please correct me if I'm wrong.

Thanks again!
Jenny



On Sat, Jun 1, 2024 at 7:57 AM Thomas Hoffmann (Speed4Trade GmbH)
 wrote:

> Hello Jenny,
>
> > -Ursprüngliche Nachricht-----
> > Von: Ying Jin 
> > Gesendet: Samstag, 1. Juni 2024 00:18
> > An: Tomcat Users List 
> > Betreff: Re: Tomcat 9 memory leak message
> >
> > Chris,
> >
> > Thanks for your reply!
> >
> > We already removed the ojdbc8.jar file from the application's Web-inf/lib
> > folder as suggested in the following post, however, we still got the
> warning
> > messages below after the application is deployed to the Tomcat 9 server.
> >
> > https://stackoverflow.com/questions/6981564/why-must-the-jdbc-driver-be-
> > put-in-tomcat-home-lib-folder
> >
> > WARNING: The web application [Our Web Application Name] appears to have
> > started a thread named [InterruptTimer] but has failed to stop it. This
> is very
> > likely to create a memory leak. Stack trace of thread:
> >
> > WARNING: The web application [Our Web Application Name] appears to have
> > started a thread named [oracle.jdbc.diagnostics.Diagnostic.CLOCK] but has
> > failed to stop it. This is very likely to create a memory leak. Stack
> trace of
> > thread:
>
> I don't know which Oracle Version you are using.
> The JDBC-Driver seems to start some threads, but they are not stopped at
> shutdown of the application.
> One of the issues seems to be resolved in a newer version:
>
> https://stackoverflow.com/questions/78300946/how-to-not-run-or-stop-oracle-23-jdbc-driver-diagnostic-clock-thread
>
> >
> > I also read some posts saying these warning messages can be safely
> ignored if
> > the Tomcat version is greater than 7.0. I'm not sure if this is correct
> or not.
> >
> > Please advise,
> >
> > Many thanks!
> > Jenny
> >
> > On Fri, May 31, 2024 at 3:50 PM Christopher Schultz <
> > ch...@christopherschultz.net> wrote:
> >
> > > Jenny,
> > >
> > > On 5/31/24 14:52, Ying Jin wrote:
> > > > We removed the ojdbc8 driver jar from web-inf/lib from the web
> > > > application and kept the ojdbc8 jar file in the Tomcat/lib folder,
> > > > but we still can see the following memory link warning message
> > > > whenever we redeploy the web application. We use the Tomcat 9 server
> > > > in the Linux environment.
> > >
> > > This list strips attachments. Can you re-post with text-only?
> > >
> > > > The other warning message is about the "validateFile Problem with
> > > > jar file /tomcat/lib/jolokia.jar. My question is if we can safely
> > > > ignore these warning messages or not.
> > > >
> > > > It would be great if you can shed some light on this issue.
> > >
> > > If the message is something like "driver cannot be unloaded" then
> > > check Tomcat with a debugger or even something like JVisualVM to see
> > > how many WebappClassLoaders you have in memory.
> > >
> > > If the driver causes the web application ClassLoader to be "pinned" in
> > > memory, then it will never be removed and all those classes will
> > > continue to use-up heap space until you restart the JVM. This gets
> > > worse every time you reload your application without restarting the
> > > JVM. The Manager application web UI can help you diagnose these a
> little.
> > >
> > > The validation problem with the Jolokia JAR file will depend upon
> > > exactly what it says. I would first get a replacement copy of the
> > > Jolokia JAR file before bothering to try to diagnose it any further.
> > >
> > > -chris
> > >
> > > -
> > > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> > > For additional commands, e-mail: users-h...@tomcat.apache.org
> > >
> > >
>


Re: Tomcat 9 memory leak message

2024-06-03 Thread Ying Jin
Chris,

Thanks for your suggestion!

Another question I would like to confirm with you is if we have to remove
the ojdbc jar file from our web application’s web-inf/lib folder or not.

The reason of our concern is that we need to use the same code base to
create a jar file and deploy it to stone branch which needs to have the
ojdbc jar file included in the application.

Therefore, we prefer to include the ojdbc jar file in the application to
avoid confusion, however, we’re not sure if this will cause any issues for
the web application’s deployment or not on tomcat server.

Thanks again for your help!
Jenny

On Sun, Jun 2, 2024 at 1:57 AM Christopher Schultz <
ch...@christopherschultz.net> wrote:

> Jenny,
>
> (Apologies for top-posting)
>
> “Safely ignored” can mean many things. You are only in danger of running
> out of heap space. So if you aren’t worried about that, feel free to ignore
> the error message.
>
> If it were my system, I would want to ensure a clean unload of the driver
> when the application shuts down.
>
> But I don’t think it will harm anything besides your memory usage.
>
> -chris
>
> > On Jun 1, 2024, at 00:18, Ying Jin  wrote:
> >
> > Chris,
> >
> > Thanks for your reply!
> >
> > We already removed the ojdbc8.jar file from the application's Web-inf/lib
> > folder as suggested in the following post, however, we still got the
> > warning messages below after the application is deployed to the Tomcat 9
> > server.
> >
> >
> https://stackoverflow.com/questions/6981564/why-must-the-jdbc-driver-be-put-in-tomcat-home-lib-folder
> >
> > WARNING: The web application [Our Web Application Name] appears to have
> > started a thread named [InterruptTimer] but has failed to stop it. This
> is
> > very likely to create a memory leak. Stack trace of thread:
> >
> > WARNING: The web application [Our Web Application Name] appears to have
> > started a thread named [oracle.jdbc.diagnostics.Diagnostic.CLOCK] but has
> > failed to stop it. This is very likely to create a memory leak. Stack
> trace
> > of thread:
> >
> > I also read some posts saying these warning messages can be safely
> ignored
> > if the Tomcat version is greater than 7.0. I'm not sure if this is
> correct
> > or not.
> >
> > Please advise,
> >
> > Many thanks!
> > Jenny
> >
> >> On Fri, May 31, 2024 at 3:50 PM Christopher Schultz <
> >> ch...@christopherschultz.net> wrote:
> >>
> >> Jenny,
> >>
> >>> On 5/31/24 14:52, Ying Jin wrote:
> >>> We removed the ojdbc8 driver jar from web-inf/lib from the web
> >>> application and kept the ojdbc8 jar file in the Tomcat/lib folder, but
> >>> we still can see the following memory link warning message whenever we
> >>> redeploy the web application. We use the Tomcat 9 server in the Linux
> >>> environment.
> >>
> >> This list strips attachments. Can you re-post with text-only?
> >>
> >>> The other warning message is about the "validateFile Problem with jar
> >>> file /tomcat/lib/jolokia.jar. My question is if we can safely ignore
> >>> these warning messages or not.
> >>>
> >>> It would be great if you can shed some light on this issue.
> >>
> >> If the message is something like "driver cannot be unloaded" then check
> >> Tomcat with a debugger or even something like JVisualVM to see how many
> >> WebappClassLoaders you have in memory.
> >>
> >> If the driver causes the web application ClassLoader to be "pinned" in
> >> memory, then it will never be removed and all those classes will
> >> continue to use-up heap space until you restart the JVM. This gets worse
> >> every time you reload your application without restarting the JVM. The
> >> Manager application web UI can help you diagnose these a little.
> >>
> >> The validation problem with the Jolokia JAR file will depend upon
> >> exactly what it says. I would first get a replacement copy of the
> >> Jolokia JAR file before bothering to try to diagnose it any further.
> >>
> >> -chris
> >>
> >> -
> >> 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: Tomcat 9 memory leak message

2024-06-03 Thread Ying Jin
Terence, thanks for your reply! best, Jenny
On Sun, Jun 2, 2024 at 3:11 AM Terence M. Bandoian 
wrote:

> A long time ago (Tomcat 7), I would see a Tomcat memory leak detection
> error on shutdown if the JDBC driver was located in WEB-INF/lib but not
> if it was in the Tomcat lib directory. Explicitly de-registering the
> driver with a ServletContextListener on shutdown eliminated the error.
> I'm not sure if that's still necessary or if it applies in your case.
>
> -Terence Bandoian
>
> On 6/2/2024 1:56 AM, Christopher Schultz wrote:
> > Jenny,
> >
> > (Apologies for top-posting)
> >
> > “Safely ignored” can mean many things. You are only in danger of running
> out of heap space. So if you aren’t worried about that, feel free to ignore
> the error message.
> >
> > If it were my system, I would want to ensure a clean unload of the
> driver when the application shuts down.
> >
> > But I don’t think it will harm anything besides your memory usage.
> >
> > -chris
> >
> >> On Jun 1, 2024, at 00:18, Ying Jin  wrote:
> >>
> >> Chris,
> >>
> >> Thanks for your reply!
> >>
> >> We already removed the ojdbc8.jar file from the application's
> Web-inf/lib
> >> folder as suggested in the following post, however, we still got the
> >> warning messages below after the application is deployed to the Tomcat 9
> >> server.
> >>
> >>
> https://stackoverflow.com/questions/6981564/why-must-the-jdbc-driver-be-put-in-tomcat-home-lib-folder
> >>
> >> WARNING: The web application [Our Web Application Name] appears to have
> >> started a thread named [InterruptTimer] but has failed to stop it. This
> is
> >> very likely to create a memory leak. Stack trace of thread:
> >>
> >> WARNING: The web application [Our Web Application Name] appears to have
> >> started a thread named [oracle.jdbc.diagnostics.Diagnostic.CLOCK] but
> has
> >> failed to stop it. This is very likely to create a memory leak. Stack
> trace
> >> of thread:
> >>
> >> I also read some posts saying these warning messages can be safely
> ignored
> >> if the Tomcat version is greater than 7.0. I'm not sure if this is
> correct
> >> or not.
> >>
> >> Please advise,
> >>
> >> Many thanks!
> >> Jenny
> >>
> >>> On Fri, May 31, 2024 at 3:50 PM Christopher Schultz <
> >>> ch...@christopherschultz.net> wrote:
> >>>
> >>> Jenny,
> >>>
> >>>> On 5/31/24 14:52, Ying Jin wrote:
> >>>> We removed the ojdbc8 driver jar from web-inf/lib from the web
> >>>> application and kept the ojdbc8 jar file in the Tomcat/lib folder, but
> >>>> we still can see the following memory link warning message whenever we
> >>>> redeploy the web application. We use the Tomcat 9 server in the Linux
> >>>> environment.
> >>> This list strips attachments. Can you re-post with text-only?
> >>>
> >>>> The other warning message is about the "validateFile Problem with jar
> >>>> file /tomcat/lib/jolokia.jar. My question is if we can safely ignore
> >>>> these warning messages or not.
> >>>>
> >>>> It would be great if you can shed some light on this issue.
> >>> If the message is something like "driver cannot be unloaded" then check
> >>> Tomcat with a debugger or even something like JVisualVM to see how many
> >>> WebappClassLoaders you have in memory.
> >>>
> >>> If the driver causes the web application ClassLoader to be "pinned" in
> >>> memory, then it will never be removed and all those classes will
> >>> continue to use-up heap space until you restart the JVM. This gets
> worse
> >>> every time you reload your application without restarting the JVM. The
> >>> Manager application web UI can help you diagnose these a little.
> >>>
> >>> The validation problem with the Jolokia JAR file will depend upon
> >>> exactly what it says. I would first get a replacement copy of the
> >>> Jolokia JAR file before bothering to try to diagnose it any further.
> >>>
> >>> -chris
> >>>
> >>> -
> >>> 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
> >
>
>


Tomcat 9 and OpenJDK 17

2024-08-09 Thread Ying Jin
Hi,

We have a web application implemented with JSF 2.3, Primefaces, JDK11 and
it can run well on Tomcat 9 Server. We encountered following errors after
upgrading JDK version to OpenJDK17 in order to meet the deployment
requirements:

SEVERE: A child container failed during start
java.util.concurrent.ExecutionException:
org.apache.catalina.LifecycleException: Failed to start component
[StandardEngine[Catalina].StandardHost[localhost].StandardContext[/SpaceSurvey]]
at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
at
org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:878)
at
org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:795)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1332)
at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1322)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at
org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at
java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:145)
at
org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:871)
at
org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:249)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at
org.apache.catalina.core.StandardService.startInternal(StandardService.java:428)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at
org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:914)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.startup.Catalina.start(Catalina.java:772)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
at
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:342)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:473)
Caused by: org.apache.catalina.LifecycleException: Failed to start
component
[StandardEngine[Catalina].StandardHost[localhost].StandardContext[/SpaceSurvey]]
at
org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:440)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198)
at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1332)
at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1322)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at
org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at
java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:145)
at
org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:871)
... 21 more
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make
protected final java.lang.Class
java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int) throws
java.lang.ClassFormatError accessible: module java.base does not "opens
java.lang" to unnamed module @800a742
at
java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
at
java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:199)
at java.base/java.lang.reflect.Method.setAccessible(Method.java:193)
at org.jboss.weld.util.bytecode.ClassFileUtils$1.run(ClassFileUtils.java:67)
at
java.base/java.security.AccessController.doPrivileged(AccessController.java:569)
at
org.jboss.weld.util.bytecode.ClassFileUtils.makeClassLoaderMethodsAccessible(ClassFileUtils.java:60)
at org.jboss.weld.bootstrap.WeldStartup.startContainer(WeldStartup.java:220)
at
org.jboss.weld.bootstrap.WeldBootstrap.startContainer(WeldBootstrap.java:72)
at
org.jboss.weld.bootstrap.WeldBootstrap.startContainer(WeldBootstrap.java:67)
at
org.jboss.weld.environment.servlet.WeldServletLifecycle.initialize(WeldServletLifecycle.java:183)
at
org.jboss.weld.environment.servlet.EnhancedListener.onStartup(EnhancedListener.java:62)
at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4936)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
... 27 more

Please help shed some lights on this issue. What is the quick way to get
this project to work with OpenJDK 17 under time pressure?

Your help is greatly appreciated!
Jenny


Tomcat 9 data source configuration error

2023-06-11 Thread Ying Jin
Hello,

We have an old java servlet web application which uses the "ojdbc6_g" jar
as Oracle jdbc driver and it works in Weblogic 14 server. Recently, we need
to try to see if this application can be deployed to Tomcat or not.

The JDBC data source has been configured in Tomcat 9.0.75 server according
to instructions below,

https://tomcat.apache.org/tomcat-9.0-doc/jndi-resources-howto.html

Please see below for the error we encountered in the Tomcat 9 deployment
and help shed some light on this problem. The Oracle database version is
19c.

Error: Cannot create JDBC driver of class 'oracle.jdbc.OracleDriver' for
connect URL 'jdbc:oracle:thin@xxx

java.sql.SQLException: Cannot create JDBC driver of class
'oracle.jdbc.OracleDriver' for connect URL 'jdbc:oracle:thin@

'
at
org.apache.tomcat.dbcp.dbcp2.DriverFactory.createDriver(DriverFactory.java:74)
at
org.apache.tomcat.dbcp.dbcp2.BasicDataSource.createConnectionFactory(BasicDataSource.java:465)
at
org.apache.tomcat.dbcp.dbcp2.BasicDataSource.createDataSource(BasicDataSource.java:529)
at
org.apache.tomcat.dbcp.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:710)

Your help is much appreciated!

thanks,
Jenny


Re: Tomcat 9 data source configuration error

2023-06-12 Thread Ying Jin
Mark,

Thanks for your reply! Please see below for the details. BTW, I removed the
database connection info. for security reasons. The same data source
configuration and jdbc driver "ojdbc6_g" works in the Weblogic 14 server.

web.xml:
  
 project datasource
 jdbc/ariesDS
 javax.sql.DataSource
 Container

Tomcat 9.0.75 conf/context.xml:

 

Datasource lookup code:

   Context initContext = new InitialContext();
Context envContext  = (Context)initContext.lookup("java:/comp/env");
DataSource ods = (DataSource)envContext.lookup("jdbc/ariesDS");
   if (ods==null)
{
   System.out.println("ods = (OracleDataSource)
envCtx.lookup('jdbc/ariesDS') is null");
   throw new Exception ("the data souce is null, error throwed.");
}else{
   conn = ods.getConnection();
}

The database version is Oracle 19C and I found out the Oracle jdbc driver
should be ojdbc8.jar. If using this version of jar file, any code changes
need to be done for the data source lookup code?

The complete stacktrace:
[image: image.png]

Your help is greatly appreciated!

Thanks,
Jenny

On Mon, Jun 12, 2023 at 3:26 AM Mark Thomas  wrote:

> On 11/06/2023 19:33, Ying Jin wrote:
> > Hello,
> >
> > We have an old java servlet web application which uses the "ojdbc6_g" jar
> > as Oracle jdbc driver and it works in Weblogic 14 server. Recently, we
> need
> > to try to see if this application can be deployed to Tomcat or not.
> >
> > The JDBC data source has been configured in Tomcat 9.0.75 server
> according
> > to instructions below,
> >
> > https://tomcat.apache.org/tomcat-9.0-doc/jndi-resources-howto.html
> >
> > Please see below for the error we encountered in the Tomcat 9 deployment
> > and help shed some light on this problem. The Oracle database version is
> > 19c.
> >
> > Error: Cannot create JDBC driver of class 'oracle.jdbc.OracleDriver' for
> > connect URL 'jdbc:oracle:thin@xxx
> >
> > java.sql.SQLException: Cannot create JDBC driver of class
> > 'oracle.jdbc.OracleDriver' for connect URL 'jdbc:oracle:thin@
> > <
> http://jdbc:oracle%3at...@vdb04ld.hs.it.vumc.io:10920/ARDEV.vumc.vanderbilt
> >
> > '
> > at
> >
> org.apache.tomcat.dbcp.dbcp2.DriverFactory.createDriver(DriverFactory.java:74)
> > at
> >
> org.apache.tomcat.dbcp.dbcp2.BasicDataSource.createConnectionFactory(BasicDataSource.java:465)
> > at
> >
> org.apache.tomcat.dbcp.dbcp2.BasicDataSource.createDataSource(BasicDataSource.java:529)
> > at
> >
> org.apache.tomcat.dbcp.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:710)
>
> And the rest of the stack trace is?
>
> ojdbc6_g.jar has been placed where in the file system?
>
> That is a *very* old Oracle JDBC driver. It is also the debug version of
> the JAR. You might want to think about using the latest one for Oracle 19c.
>
> The changes to the configuration are? (Yes, I know you said you followed
> the docs but we still need to know what you actually changed. Not
> everyone follows the docs correctly.)
>
> Mark
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: Tomcat 9 data source configuration error

2023-06-12 Thread Ying Jin
BTW, the ojdbc6_g.jar has been put in the Tomcat9.0.75/lib folder as well
as in the project's WEB-INF/lib folder.

On Mon, Jun 12, 2023 at 10:41 AM Ying Jin  wrote:

> Mark,
>
> Thanks for your reply! Please see below for the details. BTW, I removed
> the database connection info. for security reasons. The same data source
> configuration and jdbc driver "ojdbc6_g" works in the Weblogic 14 server.
>
> web.xml:
>   
>  project datasource
>  jdbc/ariesDS
>  javax.sql.DataSource
>  Container
>
> Tomcat 9.0.75 conf/context.xml:
>
>   maxIdle="10" maxTotal="20" maxWaitMillis="-1" name="jdbc/ariesDS"
> password="PW" type="javax.sql.DataSource" 
> url="jdbc:oracle:thin@hostname:portNumber/servic
> name" username="userName"/>
>
> Datasource lookup code:
>
>Context initContext = new InitialContext();
> Context envContext  = (Context)initContext.lookup("java:/comp/env");
> DataSource ods = (DataSource)envContext.lookup("jdbc/ariesDS");
>if (ods==null)
> {
>System.out.println("ods = (OracleDataSource)
> envCtx.lookup('jdbc/ariesDS') is null");
>throw new Exception ("the data souce is null, error throwed.");
> }else{
>conn = ods.getConnection();
> }
>
> The database version is Oracle 19C and I found out the Oracle jdbc driver
> should be ojdbc8.jar. If using this version of jar file, any code changes
> need to be done for the data source lookup code?
>
> The complete stacktrace:
> [image: image.png]
>
> Your help is greatly appreciated!
>
> Thanks,
> Jenny
>
> On Mon, Jun 12, 2023 at 3:26 AM Mark Thomas  wrote:
>
>> On 11/06/2023 19:33, Ying Jin wrote:
>> > Hello,
>> >
>> > We have an old java servlet web application which uses the "ojdbc6_g"
>> jar
>> > as Oracle jdbc driver and it works in Weblogic 14 server. Recently, we
>> need
>> > to try to see if this application can be deployed to Tomcat or not.
>> >
>> > The JDBC data source has been configured in Tomcat 9.0.75 server
>> according
>> > to instructions below,
>> >
>> > https://tomcat.apache.org/tomcat-9.0-doc/jndi-resources-howto.html
>> >
>> > Please see below for the error we encountered in the Tomcat 9 deployment
>> > and help shed some light on this problem. The Oracle database version is
>> > 19c.
>> >
>> > Error: Cannot create JDBC driver of class 'oracle.jdbc.OracleDriver' for
>> > connect URL 'jdbc:oracle:thin@xxx
>> >
>> > java.sql.SQLException: Cannot create JDBC driver of class
>> > 'oracle.jdbc.OracleDriver' for connect URL 'jdbc:oracle:thin@
>> > <
>> http://jdbc:oracle%3at...@vdb04ld.hs.it.vumc.io:10920/ARDEV.vumc.vanderbilt
>> >
>> > '
>> > at
>> >
>> org.apache.tomcat.dbcp.dbcp2.DriverFactory.createDriver(DriverFactory.java:74)
>> > at
>> >
>> org.apache.tomcat.dbcp.dbcp2.BasicDataSource.createConnectionFactory(BasicDataSource.java:465)
>> > at
>> >
>> org.apache.tomcat.dbcp.dbcp2.BasicDataSource.createDataSource(BasicDataSource.java:529)
>> > at
>> >
>> org.apache.tomcat.dbcp.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:710)
>>
>> And the rest of the stack trace is?
>>
>> ojdbc6_g.jar has been placed where in the file system?
>>
>> That is a *very* old Oracle JDBC driver. It is also the debug version of
>> the JAR. You might want to think about using the latest one for Oracle
>> 19c.
>>
>> The changes to the configuration are? (Yes, I know you said you followed
>> the docs but we still need to know what you actually changed. Not
>> everyone follows the docs correctly.)
>>
>> Mark
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>
>>


Re: Tomcat 9 data source configuration error

2023-06-13 Thread Ying Jin
Mark,

Thanks for the tip. I've resolved this error by using the way you suggested
along with the newer version of jdbc driver ojdbc8.jar and modified the
connection url in the right format.

However, I encountered another problem trying to run the application in
Eclipse with JDK 11. Please see below for the error message.
I didn't have any problem running the application with JDK 8.
Any suggestions?

[image: image.png]

Many thanks!
Jenny


On Mon, Jun 12, 2023 at 11:21 AM Mark Thomas  wrote:

> On 12/06/2023 16:52, Ying Jin wrote:
> > BTW, the ojdbc6_g.jar has been put in the Tomcat9.0.75/lib folder as
> > well as in the project's WEB-INF/lib folder.
>
> Don't do that. Put it *only* in $CATALINA_BASE/lib
>
>
> > On Mon, Jun 12, 2023 at 10:41 AM Ying Jin  > <mailto:jiny4...@gmail.com>> wrote:
> >
> > Mark,
> >
> > Thanks for your reply! Please see below for the details. BTW, I
> > removed the database connection info. for security reasons. The same
> > data source configuration and jdbc driver "ojdbc6_g" works in the
> > Weblogic 14 server.
> >
> > web.xml:
> >
> >   project datasource
> >   jdbc/ariesDS
> >   javax.sql.DataSource
> >   Container
> >
> > Tomcat 9.0.75 conf/context.xml:
>
> Putting it there means you have created one instance of the resource for
> each deployed web application. You probably want to put it in:
>
> $CATALINA_BASE/conf///.xml
>
> But maybe wait until you have it working before fixing that.
>
> >> driverClassName="oracle.jdbc.OracleDriver" maxIdle="10"
> > maxTotal="20" maxWaitMillis="-1" name="jdbc/ariesDS" password="PW"
> > type="javax.sql.DataSource"
> > url="jdbc:oracle:thin@hostname:portNumber/servic name"
> > username="userName"/>
> >
> > Datasource lookup code:
> >
> > Context initContext = new InitialContext();
> >  Context envContext  =
> > (Context)initContext.lookup("java:/comp/env");
> >  DataSource ods = (DataSource)envContext.lookup("jdbc/ariesDS");
> > if (ods==null)
> >  {
> > System.out.println("ods = (OracleDataSource)
> > envCtx.lookup('jdbc/ariesDS') is null");
> > throw new Exception ("the data souce is null, error
> throwed.");
> >  }else{
> > conn = ods.getConnection();
> >  }
> >
> > The database version is Oracle 19C and I found out the Oracle jdbc
> > driver should be ojdbc8.jar. If using this version of jar file, any
> > code changes need to be done for the data source lookup code?
>
> No. The lookup code should be fine.
>
> > The complete stacktrace:
> > image.png
>
> Embedded images don't work. Please paste the full stack trace and/or
> post it online somewhere we can read it.
>
> Mark
>
>
> >
> > Your help is greatly appreciated!
> >
> > Thanks,
> > Jenny
> >
> > On Mon, Jun 12, 2023 at 3:26 AM Mark Thomas  > <mailto:ma...@apache.org>> wrote:
> >
> > On 11/06/2023 19:33, Ying Jin wrote:
> >  > Hello,
> >  >
> >  > We have an old java servlet web application which uses the
> > "ojdbc6_g" jar
> >  > as Oracle jdbc driver and it works in Weblogic 14 server.
> > Recently, we need
> >  > to try to see if this application can be deployed to Tomcat
> > or not.
> >  >
> >  > The JDBC data source has been configured in Tomcat 9.0.75
> > server according
> >  > to instructions below,
> >  >
> >  >
> >
> https://tomcat.apache.org/tomcat-9.0-doc/jndi-resources-howto.html <
> https://tomcat.apache.org/tomcat-9.0-doc/jndi-resources-howto.html>
> >  >
> >  > Please see below for the error we encountered in the Tomcat 9
> > deployment
> >  > and help shed some light on this problem. The Oracle database
> > version is
> >  > 19c.
> >  >
> >  > Error: Cannot create JDBC driver of class
> > 'oracle.jdbc.OracleDriver' for
> >  > connect URL 'jdbc:oracle:thin@xxx
> >  >
> >  > java.sql.S

Re: Tomcat 9 data source configuration error

2023-06-14 Thread Ying Jin
The tomcat server can’t be started in Eclipse due to following error when
JDK 11 is used:

-Djava.endorsed.dirs=C:\ApacheTomcat 9.0.75\apache-tomcat-9.0.75\endorsed
is not supported. Endorsed standards and standalone APIs

in modular form will be supported via the concept of upgradeable modules.


Thanks,

Jenny

On Wed, Jun 14, 2023 at 3:28 AM Mark Thomas  wrote:

> On 14/06/2023 00:20, Ying Jin wrote:
> > Mark,
> >
> > Thanks for the tip. I've resolved this error by using the way you
> > suggested along with the newer version of jdbc driver ojdbc8.jar and
> > modified the connection url in the right format.
> >
> > However, I encountered another problem trying to run the application in
> > Eclipse with JDK 11. Please see below for the error message.
> > I didn't have any problem running the application with JDK 8.
> > Any suggestions?
>
> None, since we can't see the error message.
>
> Embedded images don't work. Please paste the full stack trace and/or
> post it online somewhere we can read it.
>
> Mark
>
>
> > image.png
> >
> > Many thanks!
> > Jenny
> >
> >
> > On Mon, Jun 12, 2023 at 11:21 AM Mark Thomas  > <mailto:ma...@apache.org>> wrote:
> >
> > On 12/06/2023 16:52, Ying Jin wrote:
> >  > BTW, the ojdbc6_g.jar has been put in the Tomcat9.0.75/lib folder
> as
> >  > well as in the project's WEB-INF/lib folder.
> >
> > Don't do that. Put it *only* in $CATALINA_BASE/lib
> >
> >
> >  > On Mon, Jun 12, 2023 at 10:41 AM Ying Jin  > <mailto:jiny4...@gmail.com>
> >  > <mailto:jiny4...@gmail.com <mailto:jiny4...@gmail.com>>> wrote:
> >  >
> >  > Mark,
> >  >
> >  > Thanks for your reply! Please see below for the details. BTW,
> I
> >  > removed the database connection info. for security reasons.
> > The same
> >  > data source configuration and jdbc driver "ojdbc6_g" works in
> the
> >  > Weblogic 14 server.
> >  >
> >  > web.xml:
> >  >
> >  >   project datasource
> >  >   jdbc/ariesDS
> >  >   javax.sql.DataSource
> >  >   Container
> >  >
> >  > Tomcat 9.0.75 conf/context.xml:
> >
> > Putting it there means you have created one instance of the resource
> > for
> > each deployed web application. You probably want to put it in:
> >
> > $CATALINA_BASE/conf///.xml
> >
> > But maybe wait until you have it working before fixing that.
> >
> >  >>  > driverClassName="oracle.jdbc.OracleDriver" maxIdle="10"
> >  > maxTotal="20" maxWaitMillis="-1" name="jdbc/ariesDS"
> > password="PW"
> >  > type="javax.sql.DataSource"
> >  > url="jdbc:oracle:thin@hostname:portNumber/servic name"
> >  > username="userName"/>
> >  >
> >  > Datasource lookup code:
> >  >
> >  > Context initContext = new InitialContext();
> >  >  Context envContext  =
> >  > (Context)initContext.lookup("java:/comp/env");
> >  >  DataSource ods =
> > (DataSource)envContext.lookup("jdbc/ariesDS");
> >  > if (ods==null)
> >  >  {
> >  > System.out.println("ods = (OracleDataSource)
> >  > envCtx.lookup('jdbc/ariesDS') is null");
> >  > throw new Exception ("the data souce is null, error
> > throwed.");
> >  >  }else{
> >  > conn = ods.getConnection();
> >  >  }
> >  >
> >  > The database version is Oracle 19C and I found out the Oracle
> > jdbc
> >  > driver should be ojdbc8.jar. If using this version of jar
> > file, any
> >  > code changes need to be done for the data source lookup code?
> >
> > No. The lookup code should be fine.
> >
> >  > The complete stacktrace:
> >  > image.png
> >
> > Embedded images don't work. Please paste the full stack trace and/or
> > post it online somewhere we can read it.
> >
> > M

Re: Tomcat 9 data source configuration error

2023-06-14 Thread Ying Jin
I think I found solution of this problem. It seems that this is a bug of
older version of eclipse WTP.

I removed the endorsed directory argument from the debug configuration and
it works now.

Thanks,
Jenny

On Wed, Jun 14, 2023 at 9:43 AM Ying Jin  wrote:

> The tomcat server can’t be started in Eclipse due to following error when
> JDK 11 is used:
>
> -Djava.endorsed.dirs=C:\ApacheTomcat 9.0.75\apache-tomcat-9.0.75\endorsed
> is not supported. Endorsed standards and standalone APIs
>
> in modular form will be supported via the concept of upgradeable modules.
>
>
> Thanks,
>
> Jenny
>
> On Wed, Jun 14, 2023 at 3:28 AM Mark Thomas  wrote:
>
>> On 14/06/2023 00:20, Ying Jin wrote:
>> > Mark,
>> >
>> > Thanks for the tip. I've resolved this error by using the way you
>> > suggested along with the newer version of jdbc driver ojdbc8.jar and
>> > modified the connection url in the right format.
>> >
>> > However, I encountered another problem trying to run the application in
>> > Eclipse with JDK 11. Please see below for the error message.
>> > I didn't have any problem running the application with JDK 8.
>> > Any suggestions?
>>
>> None, since we can't see the error message.
>>
>> Embedded images don't work. Please paste the full stack trace and/or
>> post it online somewhere we can read it.
>>
>> Mark
>>
>>
>> > image.png
>> >
>> > Many thanks!
>> > Jenny
>> >
>> >
>> > On Mon, Jun 12, 2023 at 11:21 AM Mark Thomas > > <mailto:ma...@apache.org>> wrote:
>> >
>> > On 12/06/2023 16:52, Ying Jin wrote:
>> >  > BTW, the ojdbc6_g.jar has been put in the Tomcat9.0.75/lib
>> folder as
>> >  > well as in the project's WEB-INF/lib folder.
>> >
>> > Don't do that. Put it *only* in $CATALINA_BASE/lib
>> >
>> >
>> >  > On Mon, Jun 12, 2023 at 10:41 AM Ying Jin > > <mailto:jiny4...@gmail.com>
>> >  > <mailto:jiny4...@gmail.com <mailto:jiny4...@gmail.com>>> wrote:
>> >  >
>> >  > Mark,
>> >  >
>> >  > Thanks for your reply! Please see below for the details.
>> BTW, I
>> >  > removed the database connection info. for security reasons.
>> > The same
>> >  > data source configuration and jdbc driver "ojdbc6_g" works
>> in the
>> >  > Weblogic 14 server.
>> >  >
>> >  > web.xml:
>> >  >
>> >  >   project datasource
>> >  >   jdbc/ariesDS
>> >  >   javax.sql.DataSource
>> >  >   Container
>> >  >
>> >  > Tomcat 9.0.75 conf/context.xml:
>> >
>> > Putting it there means you have created one instance of the resource
>> > for
>> > each deployed web application. You probably want to put it in:
>> >
>> > $CATALINA_BASE/conf///.xml
>> >
>> > But maybe wait until you have it working before fixing that.
>> >
>> >  >   > >  > driverClassName="oracle.jdbc.OracleDriver" maxIdle="10"
>> >  > maxTotal="20" maxWaitMillis="-1" name="jdbc/ariesDS"
>> > password="PW"
>> >  > type="javax.sql.DataSource"
>> >  > url="jdbc:oracle:thin@hostname:portNumber/servic name"
>> >  > username="userName"/>
>> >  >
>> >  > Datasource lookup code:
>> >  >
>> >  > Context initContext = new InitialContext();
>> >  >  Context envContext  =
>> >  > (Context)initContext.lookup("java:/comp/env");
>> >  >  DataSource ods =
>> > (DataSource)envContext.lookup("jdbc/ariesDS");
>> >  > if (ods==null)
>> >  >  {
>> >  > System.out.println("ods = (OracleDataSource)
>> >  > envCtx.lookup('jdbc/ariesDS') is null");
>> >  > throw new Exception ("the data souce is null, error
>> > throwed.");
>> >  >  }else{
>> >  > conn = ods.getConnection();
>> >  > 

Re: Tomcat 9 data source configuration error

2023-06-14 Thread Ying Jin
Great! Thomas, thanks for your clarification. best, Jenny

On Wed, Jun 14, 2023 at 10:13 AM Thomas Hoffmann (Speed4Trade GmbH)
 wrote:

> Hello Jenny,
>
> yes, endorsed was deprecated and removed from java 11 onwards:
>
> https://docs.oracle.com/en/java/javase/11/migrate/index.html#JSMIG-GUID-8E83E51A-88A3-4E9A-8E2A-66E1D66A966C
>
> Greetings, Thoma
>
> > -Ursprüngliche Nachricht-
> > Von: Ying Jin 
> > Gesendet: Mittwoch, 14. Juni 2023 17:11
> > An: Tomcat Users List 
> > Betreff: Re: Tomcat 9 data source configuration error
> >
> > I think I found solution of this problem. It seems that this is a bug of
> older
> > version of eclipse WTP.
> >
> > I removed the endorsed directory argument from the debug configuration
> > and it works now.
> >
> > Thanks,
> > Jenny
> >
> > On Wed, Jun 14, 2023 at 9:43 AM Ying Jin  wrote:
> >
> > > The tomcat server can’t be started in Eclipse due to following error
> > > when JDK 11 is used:
> > >
> > > -Djava.endorsed.dirs=C:\ApacheTomcat
> > > 9.0.75\apache-tomcat-9.0.75\endorsed
> > > is not supported. Endorsed standards and standalone APIs
> > >
> > > in modular form will be supported via the concept of upgradeable
> modules.
> > >
> > >
> > > Thanks,
> > >
> > > Jenny
> > >
> > > On Wed, Jun 14, 2023 at 3:28 AM Mark Thomas 
> > wrote:
> > >
> > >> On 14/06/2023 00:20, Ying Jin wrote:
> > >> > Mark,
> > >> >
> > >> > Thanks for the tip. I've resolved this error by using the way you
> > >> > suggested along with the newer version of jdbc driver ojdbc8.jar
> > >> > and modified the connection url in the right format.
> > >> >
> > >> > However, I encountered another problem trying to run the
> > >> > application in Eclipse with JDK 11. Please see below for the error
> > message.
> > >> > I didn't have any problem running the application with JDK 8.
> > >> > Any suggestions?
> > >>
> > >> None, since we can't see the error message.
> > >>
> > >> Embedded images don't work. Please paste the full stack trace and/or
> > >> post it online somewhere we can read it.
> > >>
> > >> Mark
> > >>
> > >>
> > >> > image.png
> > >> >
> > >> > Many thanks!
> > >> > Jenny
> > >> >
> > >> >
> > >> > On Mon, Jun 12, 2023 at 11:21 AM Mark Thomas  > >> > <mailto:ma...@apache.org>> wrote:
> > >> >
> > >> > On 12/06/2023 16:52, Ying Jin wrote:
> > >> >  > BTW, the ojdbc6_g.jar has been put in the Tomcat9.0.75/lib
> > >> folder as
> > >> >  > well as in the project's WEB-INF/lib folder.
> > >> >
> > >> > Don't do that. Put it *only* in $CATALINA_BASE/lib
> > >> >
> > >> >
> > >> >  > On Mon, Jun 12, 2023 at 10:41 AM Ying Jin <
> jiny4...@gmail.com
> > >> > <mailto:jiny4...@gmail.com>
> > >> >  > <mailto:jiny4...@gmail.com <mailto:jiny4...@gmail.com>>>
> > wrote:
> > >> >  >
> > >> >  > Mark,
> > >> >  >
> > >> >  > Thanks for your reply! Please see below for the details.
> > >> BTW, I
> > >> >  > removed the database connection info. for security
> reasons.
> > >> > The same
> > >> >  > data source configuration and jdbc driver "ojdbc6_g"
> works
> > >> in the
> > >> >  > Weblogic 14 server.
> > >> >  >
> > >> >  > web.xml:
> > >> >  >
> > >> >  >   project datasource
> > >> >  >   jdbc/ariesDS
> > >> >  >   javax.sql.DataSource
> > >> >  >   Container
> > >> >  >
> > >> >  > Tomcat 9.0.75 conf/context.xml:
> > >> >
> > >> > Putting it there means you have created one instance of the
> resource
> > >> > for
> > >> > each deployed web application. You probably want to put it in:
> > >> >
> >