Copying a new project today made a low-level mistake and recorded it as a warning:
Copied the project, copied the configuration file, modified the service name, launched Tomcat, the error is as follows:
Severe: creation of the naming context failed: javax.naming.operationnotsupportedexception: context is read Onlyjavax.naming.namenotfoundexception: name [comp/env/testservice] is not bound in this Context. Unable to find [comp].at Org.apache.naming.NamingContext.lookup (namingcontext.java:819) At org.apache.naming.namingcontext.lookup ( namingcontext.java:167) At org.apache.naming.selectorcontext.lookup (selectorcontext.java:156) at Javax.naming.InitialContext.lookup (initialcontext.java:411) at com.jerehnet.util.dbutil.dbhelper.< Clinit> (dbhelper.java:55) At com.jerehnet.manage.applicationlistener.getcategorymapgift ( applicationlistener.java:82) at com.jerehnet.manage.applicationlistener.contextinitialized ( applicationlistener.java:29) At org.apache.catalina.core.standardcontext.listenerstart ( standardcontext.java:4973) At org.apache.catalina. Core. Standardcontext.startinternal (standardcontext.java:5467) At org.apache.catalina.util.lifecyclebase.start ( lifecyclebase.java:150) At org.apache.catalina.core.containerbase$startchild.call (ContainerBase.java:1559) At org.apache.catalina.core.containerbase$startchild.call (containerbase.java:1549) at Java.util.concurrent.FutureTask.run (futuretask.java:262) at Java.util.concurrent.ThreadPoolExecutor.runWorker (threadpoolexecutor.java:1145) at Java.util.concurrent.threadpoolexecutor$worker.run (threadpoolexecutor.java:615) At java.lang.Thread.run ( thread.java:745)
The survey only found that the configuration file has errors:
Original:
<service name= "Test" > <connector port= "1111" Maxhttpheadersize= "8192" maxthreads= "2048" minsparethreads= " maxsparethreads=" 475 " enablelookups= "false" redirectport= "8443" acceptcount= " " connectiontimeout= "20000" disableuploadtimeout= "true" uriencoding= "Utf-8"/> <engine name= "test" defaulthost= "localhost" > <realm classname= "Org.apache.catalina.realm.UserDatabaseRealm" resourcename= " Userdatabase "/> Copy the NEW:
<service name= "Test2" > <connector port= "1111" maxhttpheadersize= "8192" maxthreads= "2048" minsparethreads= " maxsparethreads=" 475 " enablelookups= "false" redirectPort= " 8443 " acceptcount=" connectiontimeout= "20000" disableuploadtimeout= "true" uriencoding= "Utf-8"/> <engine name= "test" defaulthost= "localhost" > <realm classname= "Org.apache.catalina.realm.UserDatabaseRealm" Resourcename= "userdatabase"/> The error is to modify only the server name
<service name= "Test2" >
Without modification
Engine Name
After adjusting the problem as follows, if you are also this error, you can try to see if this is the problem!
<service name= "Test2" > <connector port= "1111" maxhttpheadersize= "8192" maxthreads= "2048" MinS parethreads= "maxsparethreads=" 475 "enablelookups=" false "redirectport=" 8443 "acceptcount=" 800 " connectiontimeout= "20000" disableuploadtimeout= "true" uriencoding= "Utf-8"/> <engine name= "Test2" DefaultHo st= "localhost" >
Copy Project start error