반응형


* 예전 블로그 복사 - http://blog.daum.net/7dbwnckd/7972581 


아래와 같은 에러는...

 

심각: Error reading tld listeners java.lang.NullPointerException
java.lang.NullPointerException
 at org.apache.log4j.Category.isEnabledFor(Category.java:746)
 at org.apache.commons.logging.impl.Log4JLogger.isTraceEnabled(Log4JLogger.java:327)
 at org.apache.catalina.startup.TldConfig.tldScanResourcePaths(TldConfig.java:581)
 at org.apache.catalina.startup.TldConfig.execute(TldConfig.java:282)
 at org.apache.catalina.core.StandardContext.processTlds(StandardContext.java:4307)
 at org.apache.catalina.core.StandardContext.start(StandardContext.java:4144)
 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
 at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
 at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
 at org.apache.catalina.core.StandardService.start(StandardService.java:448)
 at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
 at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 at java.lang.reflect.Method.invoke(Unknown Source)
 at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
 at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)

 

-------------------------------------------------------------------------------------------------

log4j 1.2.x버전과 1.3.x버전을 쓰실 때 
현재 배포된 commons-logging-1.1.jar파일과 문제를 일으켜
웹 컨테이너 리로딩 시 불필요한 Exception이 발생합니다.
Apahce site에서 확인 한 결과
[1.0.4 Release - 16 Jun 2004]
"The 1.0.4 release of commons-logging is a service release containing support for both the 1.2.x and 1.3.x series of Log4J releases. "
log4j 1.2.x와 1.3.x를 commons-logging-1.0.4에서 지원합니다.
원래는 1.0.4 이상에서도 지원 한다고 되어 있는데
commons-logging-1.1과 commons-logging-1.1.1에서는 위와 같은 문제가 발생하고 있습니다.

-------------------------------------------------------------------------------------------------

는 내용을 알게 되었다.

반응형
반응형


* 예전 블로그 복사 - http://blog.daum.net/7dbwnckd/1616463


java.lang.UnsupportedClassVersionError

 

(Unsupported major.minor version 49.0)

 

 

 

이 에러는 자바의 컴파일 버전이 충돌이 나서이다.

 

하위버전의 클래스파일을 상위버전이 읽어들일때는 상관없지만

 

상위버전의 클래스파일을 하위버전이 읽어올때는 위와 같은 에러를 낸다

 

 

< 에러 상세코드 >


version 50.0   컴파일 버전 : 1.6

version 49.0   컴파일 버전 : 1.5

version 48.0   컴파일 버전 : 1.4

 

해결책>>

 

내텀퓨터 ->속성 -> 고급-> 환경변수에서

 

자바의 버전을 알맞게 셋팅한다.

 

즉... 상위 버전에서 컴파일된 파일들은 모두 자신이 현재 쓸려고 하는 하위버전대로 다시 컴파일 하여야 한다.

반응형
반응형


* 예전 블로그 복사 -  http://blog.daum.net/7dbwnckd/1616449


/conf/catalina/localhost/ContextName.xml 을 넣어야 잘 돈다. Root에서는 다시 해 보겠음.

 

 


<Context path="/framework" docBase="${catalina.home}/webapps/framework" debug="5" reloadable="true" crossContext="true">

 <Logger className="org.apache.catalina.logger.FileLogger" prefix="localhost_dbwnckd_log." suffix=".txt" timestamp="true"/>

 <Resource name="jdbc/dbwnckd" auth="Container" type="javax.sql.DataSource"/>

 <ResourceParams name="jdbc/dbwnckd">
  <parameter>
  <name>factory</name>
  <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
  </parameter>

  <!-- Maximum number of dB connections in pool. Make sure you
  configure your mysqld max_connections large enough to handle
  all of your db connections. Set to 0 for no limit.
  -->
  <parameter>
  <name>maxActive</name>
  <value>100</value>
  </parameter>

  <!-- Maximum number of idle dB connections to retain in pool.
  Set to -1 for no limit.  See also the DBCP documentation on this
  and the minEvictableIdleTimeMillis configuration parameter.
  -->
  <parameter>
  <name>maxIdle</name>
  <value>30</value>
  </parameter>

  <!-- Maximum time to wait for a dB connection to become available
  in ms, in this example 10 seconds. An Exception is thrown if
  this timeout is exceeded.  Set to -1 to wait indefinitely.
  -->
  <parameter>
  <name>maxWait</name>
  <value>10000</value>
  </parameter>

  <!-- MySQL dB username and password for dB connections  -->
  <parameter>
  <name>username</name>
  <value>root</value>
  </parameter>
  <parameter>
  <name>password</name>
  <value>admin</value>
  </parameter>

  <!-- Class name for the old mm.mysql JDBC driver - uncomment this entry and comment next
  if you want to use this driver - we recommend using Connector/J though
  <parameter>
  <name>driverClassName</name>
  <value>org.gjt.mm.mysql.Driver</value>
  </parameter>
  -->

  <!-- Class name for the official MySQL Connector/J driver -->
  <parameter>
  <name>driverClassName</name>
  <value>com.mysql.jdbc.Driver</value>
  </parameter>

  <!-- The JDBC connection url for connecting to your MySQL dB.
  The autoReconnect=true argument to the url makes sure that the
  mm.mysql JDBC Driver will automatically reconnect if mysqld closed the
  connection.  mysqld by default closes idle connections after 8 hours.
  -->
  <parameter>
  <name>url</name>
  <value>jdbc:mysql://localhost:3306/test?autoReconnect=true</value>
  </parameter>
 </ResourceParams>
</Context>

반응형
반응형


* 예전 블로그 복사 - http://blog.daum.net/7dbwnckd/1616426


이번에 다시 sql과 연동을 시도하면서 새로운 문제에 부딪히게 되었는데~

 

예전 처럼(Tomcat 5.0) 시도하면 Tomcat 시작 시 Warning이 뜨게 된다.

 

따라서 다른 방법으로 시도해야 하는데~

 

바로... 아래와 같다.

 

 

* 각각의 context밑의 web.xml의 설정

 

<?xml version="1.0" encoding="ISO-8859-1"?>

<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
    version="2.4">

    <description>
      JSP 2.0 Examples.
    </description>
    <display-name>JSP 2.0 Examples</display-name>


 <resource-ref>
  <description>DB Connection</description>
  <res-ref-name>jdbc/dbwnckd</res-ref-name>
  <res-type>javax.sql.DataSource</res-type>
  <res-auth>Container</res-auth>
 </resource-ref>


</web-app>


* 각각의 context밑의 context.xml의 설정

 

<Context path="" docBase="emergency" debug="5" reloadable="true" crossContext="true">

 <Logger className="org.apache.catalina.logger.FileLogger" prefix="localhost_emergency_log." suffix=".txt" timestamp="true"/>
 
 <Resource name="jdbc/dbwnckd" 
   auth="Container" 
   type="javax.sql.DataSource"
   maxActive="100" 
   maxIdle="30" 
   maxWait="10000"
     username="root" 
     password="admin" 
     driverClassName="com.mysql.jdbc.Driver"
     url="jdbc:mysql://localhost:3306/mysql?autoReconnect=true"/>
      
   <WatchedResource>WEB-INF/web.xml</WatchedResource>

 

</Context>

 

반응형

+ Recent posts