锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲视频手机在线,亚洲精品国产日韩无码AV永久免费网 ,亚洲精品人成网线在线播放va http://www.tkk7.com/RR00/category/15207.html涓嶈鍩嬪ご鑻﹀共錛岃瀛︿範錛屽涔狅紝鍐嶅涔犮傘傘傘傘? <br> powered by <font color='orange'>R.Zeus</font>zh-cnSat, 24 May 2008 17:16:00 GMTSat, 24 May 2008 17:16:00 GMT60birt tomcat Cannot load JDBC Driver classhttp://www.tkk7.com/RR00/articles/202435.htmlR.ZeusR.ZeusFri, 23 May 2008 08:24:00 GMThttp://www.tkk7.com/RR00/articles/202435.htmlhttp://www.tkk7.com/RR00/comments/202435.htmlhttp://www.tkk7.com/RR00/articles/202435.html#Feedback0http://www.tkk7.com/RR00/comments/commentRss/202435.htmlhttp://www.tkk7.com/RR00/services/trackbacks/202435.html
fuck !! because of  deleting the temp dir in tomcat,it report this error! foolish birt! why can't it create a temp dir for the db driver to store!!


R.Zeus 2008-05-23 16:24 鍙戣〃璇勮
]]>
<Context ../>http://www.tkk7.com/RR00/articles/162447.htmlR.ZeusR.ZeusThu, 22 Nov 2007 11:07:00 GMThttp://www.tkk7.com/RR00/articles/162447.htmlhttp://www.tkk7.com/RR00/comments/162447.htmlhttp://www.tkk7.com/RR00/articles/162447.html#Feedback0http://www.tkk7.com/RR00/comments/commentRss/162447.htmlhttp://www.tkk7.com/RR00/services/trackbacks/162447.html           debug="0" privileged="true"/>


R.Zeus 2007-11-22 19:07 鍙戣〃璇勮
]]>
瑁呬簡n嬈omcat鍚巘omcat涓嶈兘鍚姩http://www.tkk7.com/RR00/articles/92681.htmlR.ZeusR.ZeusTue, 09 Jan 2007 09:56:00 GMThttp://www.tkk7.com/RR00/articles/92681.htmlhttp://www.tkk7.com/RR00/comments/92681.htmlhttp://www.tkk7.com/RR00/articles/92681.html#Feedback0http://www.tkk7.com/RR00/comments/commentRss/92681.htmlhttp://www.tkk7.com/RR00/services/trackbacks/92681.html

R.Zeus 2007-01-09 17:56 鍙戣〃璇勮
]]>
Resin searchhttp://www.tkk7.com/RR00/articles/79447.htmlR.ZeusR.ZeusMon, 06 Nov 2006 09:43:00 GMThttp://www.tkk7.com/RR00/articles/79447.htmlhttp://www.tkk7.com/RR00/comments/79447.htmlhttp://www.tkk7.com/RR00/articles/79447.html#Feedback0http://www.tkk7.com/RR00/comments/commentRss/79447.htmlhttp://www.tkk7.com/RR00/services/trackbacks/79447.html1.cache for IE.I don't konw intellij IDE make this trick or the resin.no matter I change the jsp or delete it,the page seem never change.after I change the struts-comfig.xml or the tiles.xml pointing to another jsp coping from the sick page,then I can do what I want and not restart the server.
2.the resin will create a dir named 'work' in the 'web-inf'.and when compile,the java file in the
'work' dir may be reported error.so I delete it.
3.Hibernate error.for associate relation,Tomcat doesn't check but Resign check strictly.this may be becaust of the jsp-compile way.
4.For intellij-IDE's聽 resin plug,it didn't compile before run just as Tomcat plug.so you must compile yourself if any class changed.
5.the most different聽between Tomcat and Resin is the JSTL compile.Resin will generate the fast-jstl code and Tomcat do nothing.Resin contains the jstl-11.jar.In my former聽 training demo,the company jar we used seems associate with the jstl-xx.jar,so I can't delete the jstl jar
from the demo lib.Then the demo run error when in Resin until close the fast-jstl.

resin.conf
聽<web-app-default>
...
聽 <jsp fast-jstl='false'/>
....
聽</web-app-default>


it also can set for a appointed web-app.

version:
intellij IDE: 6.0.1
Resin:resin-pro-3.0.21
DB: sql-server


R.Zeus 2006-11-06 17:43 鍙戣〃璇勮
]]>
more server run applicatin on the same database will be error!http://www.tkk7.com/RR00/articles/76370.htmlR.ZeusR.ZeusFri, 20 Oct 2006 05:35:00 GMThttp://www.tkk7.com/RR00/articles/76370.htmlhttp://www.tkk7.com/RR00/comments/76370.htmlhttp://www.tkk7.com/RR00/articles/76370.html#Feedback0http://www.tkk7.com/RR00/comments/commentRss/76370.htmlhttp://www.tkk7.com/RR00/services/trackbacks/76370.html聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽if there are more than two server run with the same system code
聽聽聽聽聽聽聽聽聽聽聽 and call the save method at the same time ,it will be result of hibernate
聽聽聽聽聽聽聽聽聽聽聽 error!because hibernate get the max id for ganerator and store it in
聽聽聽聽聽聽聽聽聽聽聽 cache for next time using.so one server will get the expired id if another
聽聽聽聽聽聽聽聽聽聽聽 server change the database following.
聽聽聽聽聽聽聽聽聽聽聽 befroe save object,hibernate will excute this sql after the server start up once:
聽聽聽聽聽聽聽聽聽聽聽聽 Hibernate: select max(ID) from TB_LOG
聽聽聽聽聽聽聽聽聽聽聽 TB_LOG is my log table.



R.Zeus 2006-10-20 13:35 鍙戣〃璇勮
]]>
Set the Logging Level Over a Tomcat Cluster Dynamicallyhttp://www.tkk7.com/RR00/articles/69693.htmlR.ZeusR.ZeusThu, 14 Sep 2006 09:03:00 GMThttp://www.tkk7.com/RR00/articles/69693.htmlhttp://www.tkk7.com/RR00/comments/69693.htmlhttp://www.tkk7.com/RR00/articles/69693.html#Feedback0http://www.tkk7.com/RR00/comments/commentRss/69693.htmlhttp://www.tkk7.com/RR00/services/trackbacks/69693.html
Set the Logging Level Over a Tomcat Cluster Dynamically
Rather than modifying your Log4J configuration and then redeploying the correct code version with the modified logging level, you can dynamically set the Log4J logging level over each node in a Tomcat cluster with JMX.聽


henever you have to fix a problem in a production environment, one of the most common issues is retrieving some useful debug information to tell you what happened. Of course, to avoid needless notifications and enormous log files, most production systems are configured to log only errors. To avoid having to modify your Log4J configuration and then redeploy the correct version of the code with the modified logging level, why not just implement a mechanism for dynamically changing the logging level?聽

Log4J registers a number of MBeans, one of which provides access to the root logger. You can dynamically modify the logging level of the root logger by implementing the following servlet to set the appropriate MBean property through JMX:

public class SetLog4jLevelServlet extends HttpServlet {
    private static final Log log = LogFactory.getLog(SetLog4jLevelServlet.class);

    protected void doGet(HttpServletRequest request, 
            HttpServletResponse response) 
            throws ServletException, IOException {
        List list = MBeanServerFactory.findMBeanServer(null);
        MBeanServer server  = (MBeanServer)list.iterator().next();

        try {
            String loggingLevel = request.getParameter("level");
            Attribute attribute = new Attribute("priority", loggingLevel);
            ObjectName objectName = new ObjectName("log4j:logger=root");
            server.setAttribute(objectName, attribute);
        } catch (Exception e) {
            log.error("log4j:logger=root", e);
        }
    }
}

The first two lines of the doGet method look up the MBeanServer. Log4J registers the root logger with the name log4j:logger=root. This MBean provides a property to set the logging level of the root logger. You set the priority of the root logger by passing the ObjectName of the MBean to operate on, along with an instance of javax.management.Attribute to the MBean Server. In this case, you want to set the "priority" attribute. The value will be the new logging level you have specified

A Log4J MBean for Each Log4J Configuration

Although this technique seems simple, if your Tomcat cluster hosts a number of Web applications鈥攅ach with its own Log4J configuration that allows it to log to a separate log file鈥攖hen you will run into your first problem. Given multiple Log4J configurations, only the first one loaded by the JVM will have a root logger MBean associated with it. The reason for this is Log4J hard-codes the JMX Domain that it uses when registering its MBeans as log4j, and the JMX server doesn't allow duplicate names.

The way round this is to leave a Tomcat server Log4J configuration (jars under server/lib and property files under server/classes) registered under the default Log4J name log4j:logger=root. Then register the root logger for each Web application in a startup servlet, using the Web application name to identify the domain:


public class RegisterLog4JMBeanServlet extends HttpServlet {

    private static final Log log = LogFactory.getLog(RegisterLog4JMBeanServlet.class);

    public void init(ServletConfig servletConfig) 
            throws ServletException {
        ServletContext context = servletConfig.getServletContext();
        String webappName = context.getServletContextName();
        Hashtable<String, String> nameParameters = new Hashtable<String, String>();
        nameParameters.put("logger", "root");

        Logger rootLogger = LogManager.getRootLogger();
        LoggerDynamicMBean mbean = new LoggerDynamicMBean(rootLogger);
        List list = MBeanServerFactory.findMBeanServer(null);
        MBeanServer server  = (MBeanServer)list.iterator().next();

        ObjectName objectName = null;
        try {
            objectName = new ObjectName(webappName, nameParameters);
            server.registerMBean(mbean, objectName);
        } catch (Exception e) {
            log.error("Problems registering Log4J MBean", e);
        }
    }
}

You will end up with an MBean named <web-app-name>: logger=root for each Web application. The webappName is retrieved from the <display-name> element in your application's web.xml file, and the application's root logger is retrieved by calling LogManager.getRootLogger(). Then you can use the LoggerDynamicMBean class from Log4J to create your MBean from the root logger definition.

To create a distinct ObjectName for the new MBean, you should use the Web application name as the JMX domain (this is the text before the colon) and then register the Root Logger MBean with the new ObjectName. This will guard against conflicts with other Log4J MBeans.

Now that you have registered your Root Logger under a different domain, you must modify the servlet that sets the logging level. So in SetLog4JlevelServlet, change this:


ObjectName objectName = new ObjectName("log4j:logger=root");

To this:


ServletContext context = servletConfig.getServletContext();
String webappName = context.getServletContextName();
Hashtable<String, String> nameParameters = new Hashtable<String, String>();
nameParameters.put("logger", "root");
ObjectName objectName = new ObjectName(webappName, nameParameters);

When setting up your Log4J configuration, give your Log4J appenders unique names. Otherwise, they will not get registered to the JMX server and you will get lots of the following errors in your log files at startup:


ERROR main org.apache.log4j.jmx.LoggerDynamicMBean ? - Could not add appenderMBean for [<appender_name>].
javax.management.InstanceAlreadyExistsException: log4j:appender=<appender_name>

Again, the reason for this is because the JMX domain name his hard-coded to log4j, so if you have repeated appender names then only the first of these will be registered.

At this point, configuring the MX4J HTTP adaptor in your Tomcat server might be useful. This will give you a visual representation of the MBeans you are creating and manipulating, and show you what else is exposed via MBeans within Tomcat. To do this, you must put the mx4j-tools.jar file (download it at mx4j.sourceforge.net) in your common/lib directory. Then configure your server.xml file to set up the connector as follows:


    <Connector port="8010" 
           handler.list="mx" 
           mx.enabled="true" 
           mx.httpHost="localhost"
           mx.httpPort="8013"
           protocol="AJP/1.3"/>

When you start your server, you will be able to access the MX4J HTTP connector through your browser at http://localhost:8013, assuming you have no other Tomcat connector running on port 8010.

Set the Logging Level for All the Nodes in Your Cluster

Once you have made the previously discussed changes, you will be able to set the Log4J logging level dynamically for any application running in Tomcat. The next challenge is to make sure you can set the logging level for every node in the cluster. You could either call this servlet manually on each node in the cluster or get the servlet to send a message to every other node in the cluster so the logging levels are always the same across the cluster

To send a message to the other nodes in a Tomcat cluster, you need to call the send(ClusterMessage) method on the org.apache.catalina.cluster.SimpleTcpCluster class. When implementing a ClusterMessage, you must populate the details of the cluster node that was responsible for sending the request. (Listing 1 provides an example that retrieves the information through the Tomcat MBeans.) The first step is to provide an implementation of the ClusterMessage interface to pass the new logging level and to determine for which application you want to set the logging level.

It may seem strange, but you must use JMX over RMI to send the message to the cluster because the interface implemented in Listing 1 is defined within the Tomcat server class loader (i.e., it exists in a jar file in the server directory). You will instantiate that class in a Web application, which uses a totally separate class loader (it exists in the WEB-INF directory of your Web application). This means that the cluster message you instantiate in your Web application and send to the SimpleTcpCluster class will be different from the cluster message definition that is placed in the Tomcat server class loader. If you try to send your message directly through JMX, your cluster message instance will not match the cluster message definition accessible to the SimpleTcpCluster class and the call will fail. (See the Tomcat documentation on class loaders for a definition of how the class loaders are configured for the Tomcat server.)

The workaround is to use JMX over RMI so the cluster message is serialized in the Web application class loader, instantiated in the Tomcat server class loader (and that is the important point), and then de-serialized. The following method opens a connection to the local JVM's JMX server over RMI, looks up the MBean that wraps the SimpleTcpCluster, and then invokes the send(ClusterMessage) operation on the MBean:


public static void sendLogMessageEvent(String applicationName, String logLevel) {
    String port = System.getProperty("com.sun.management.jmxremote.port");
    String urlForJMX = JMX_SERVICE_PREFIX + HOST + ":" + port + JMX_SERVICE_SUFFIX;

    try {
        JMXServiceURL url = new JMXServiceURL(urlForJMX);
        JMXConnector connector = JMXConnectorFactory.connect(url, null);
        MBeanServerConnection server = connector.getMBeanServerConnection();
        ObjectName cluster = new ObjectName("Catalina:type=Cluster,host=localhost");
        log.debug("Cluster cluster: " + cluster.toString());

        LogLevelMessage message = new LogLevelMessage();
        message.setLoggingLevel(logLevel);
        message.setApplication(applicationName);

        Object[] params = new Object[] {message};
        String[] types = new String[] {"org.apache.catalina.cluster.ClusterMessage"};
        server.invoke(cluster, "send", params, types);
    } catch (Exception e) {
        log.error(e.getMessage(), e);
    }
}

You should call this method in your SetLog4JLevelServlet to ensure that a message is sent to the other members of the cluster when you set the logging level.

You will need to configure your Tomcat server to allow a JMX connection to be opened up over RMI. Simply add the following line to your catalina.bat file in the bin directory:


set JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremote.port=8012 
-Dcom.sun.management.jmxremote.authenticate=false 
-Dcom.sun.management.jmxremote.ssl=false

For a quick guide on applying security to this configuration, see the Tomcat documentation. For a more in-depth look at configuring JMX Remote, see the Sun documentation.

Receiving the Message in the Other Nodes

Once you are able to send these messages to the other nodes in the cluster, you will need to implement a Tomcat ClusterListener to receive the events. This implementation will set the logging level for the correct MBean determined by the application name that is passed as part of the message:

public class ClusterLoggingListener extends ClusterListener {

    private static final Log log = LogFactory.getLog(ClusterLoggingListener.class);
    
    public void messageReceived(ClusterMessage message) {
        if(message instanceof LogLevelMessage) {
            LogLevelMessage logMessage = (LogLevelMessage) message;
            List list = MBeanServerFactory.findMBeanServer(null);
            MBeanServer server  = (MBeanServer)list.iterator().next();
            Hashtable<String, String> nameParameters = new Hashtable<String, String>();
            nameParameters.put("logger", "root");
            try {
                ObjectName logBean = new ObjectName(logMessage.getApplication(), nameParameters);
                Attribute attribute = new Attribute("priority", logMessage.getLoggingLevel());
                server.setAttribute(logBean, attribute);
            } catch (Exception e) {
                log.error("Problem setting the logging level for application " + 
                        logMessage.getApplication() + " to level " + 
                        logMessage.getLoggingLevel(),e);
            }
        }
    }
    public boolean accept(ClusterMessage message) {
        return message instanceof LogLevelMessage;
    }
}

You must deploy this class in the server directory and enter it in the Tomcat server.xml file as a ClusterListener within the <Cluster> element:


<ClusterListener className="dynamiclogging.tomcat.ClusterLoggingListener"/>

You should now be able to set the logging level for any application, over all nodes, in the cluster by calling SetLog4JLevelServlet on any node in the cluster.

Deploying the Example Code

To deploy the example code for setting the logging level in your cluster, take the following steps:
  1. Load the Eclipse project and build it using the dist target. This will create set-log-levels.war and set-log-levels-server.jar in the dist directory.
  2. Put the set-log-levels-server.jar in the Tomcat server\lib directory and deploy the set-log-levels.war file across the cluster.
  3. Use the SetLog4jLevelServlet (e.g., /setLogLevel?level=debug) to set the logging level and use PerformLogTestServlet (/testLogLevel) to test the logging level changes.



R.Zeus 2006-09-14 17:03 鍙戣〃璇勮
]]>
log4j in tomcathttp://www.tkk7.com/RR00/articles/69638.htmlR.ZeusR.ZeusThu, 14 Sep 2006 06:41:00 GMThttp://www.tkk7.com/RR00/articles/69638.htmlhttp://www.tkk7.com/RR00/comments/69638.htmlhttp://www.tkk7.com/RR00/articles/69638.html#Feedback0http://www.tkk7.com/RR00/comments/commentRss/69638.htmlhttp://www.tkk7.com/RR00/services/trackbacks/69638.htmllog4j.xml 鍙互鏀懼湪2涓湴鏂癸細
1銆変嬌鐢?strong>springframework鍦╳eb.xml涓厤緗?br />//璁劇疆webAppRootKey鐨勫埆鍚嶏紝
//濡傛灉涓嶈緗紝鍦╨og4j.xml涓緗負<param name="File" value="${webapp.root}/WEB-INF/log/frame.log " />
//鍚﹀垯錛屽彲浠ヨ緗負<param name="File" value="${demo.root}/WEB-INF/log/frame.log " />
//濡傛灉涓嶄嬌鐢?font color="#0000ff">${webapp.root
}錛屽氨浼氭寚鍚?{TOMCAT_HOM},涔熷氨鏄痶omcat鐨勫畨瑁呯洰褰?font color="#ff0000">銆?/font>
聽<context-param>
聽聽<param-name>webAppRootKey</param-name>
聽聽<param-value>demo.root</param-value>
聽</context-param>

//璁劇疆閰嶇疆鏂囦歡聽聽聽
<context-param>
聽聽聽聽聽聽聽 <param-name>log4jConfigLocation</param-name>
聽聽聽聽聽聽聽 <param-value>/WEB-INF/log4j.xml</param-value>
聽聽聽 </context-param>

//璁劇疆鐩戝惉鍣?br />聽 <listener>
聽聽<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
聽</listener>
榪欐牱log4j.xml 灝卞彲浠EB-INF閲岄潰鐨勪換浣曡礬寰勩?br />
Source:

initLogging->
{
聽聽聽聽聽聽WebUtils.setWebAppRootSystemProperty(servletContext);
聽聽聽聽聽聽{
聽聽聽聽聽聽String root = servletContext.getRealPath("/");
聽聽聽聽聽聽String param = servletContext.getInitParameter(WEB_APP_ROOT_KEY_PARAM);
聽聽聽聽聽聽聽String key = (param != null ? param : DEFAULT_WEB_APP_ROOT_KEY);
聽聽聽聽聽聽聽聽System.setProperty(key, root);
聽聽聽聽聽聽//use system property聽to聽deal with
${webapp.root} or聽its聽alias.
聽聽聽聽聽聽//once聽I聽writed careless聽${webapp.root}聽to {webapp.root}聽,and聽look up聽the error for聽much time.
聽聽聽聽聽聽聽聽聽聽}
聽聽聽聽聽聽String location = servletContext.getInitParameter(CONFIG_LOCATION_PARAM);
聽聽聽聽聽聽Log4jConfigurer.initLogging(location);
聽聽聽聽聽聽{

聽聽聽聽聽聽聽聽聽//distinguish the log4j.xml聽and聽log4j.properties
聽聽聽聽聽聽聽聽聽if (resolvedLocation.toLowerCase().endsWith(XML_FILE_EXTENSION)) {
聽聽聽聽聽聽聽聽聽聽聽聽DOMConfigurator.configure(url);
聽聽聽聽聽聽聽聽}
聽聽聽聽聽else {
聽聽聽聽聽聽聽聽聽PropertyConfigurator.configure(url);
聽聽聽聽聽}
聽聽聽聽聽聽}
}
use DOMConfigurator.configure("log4j.xml"); to init config ,then LogFactory can work. the "log4j.xml "
may be any name .DOMConfigurator may use cache mechanism聽as聽in LogFactory class .cache machanism is
another way to implement "single" design pattern.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
2銆塛EB-INF/classes涓嬮潰

閲囧彇榪欑鏂瑰紡錛屽畠鐨勬枃浠禷ppender鐨勭浉瀵硅礬寰勬繪槸鎸囧悜${TOMCAT_HOM},涔熷氨鏄痶omcat鐨勫畨瑁呯洰褰?font color="#ff0000">銆?lt;param name="File" value="demo.log" /> 浼氭妸demo.log 淇濆瓨鍒?/font>${TOMCAT_HOM}/demo.log 錛?br />閲囩敤緇濆璺緞鍒欏彲浠ヤ換鎰忚緗?br />
涓轟簡浣跨敤鐩稿璺緞錛屾垜浠妸project鏀懼埌${TOMCAT_HOMe}/webapps涓媎eploy銆?br />濡俻roject鍚嶄負demo錛宭og瑕佷繚瀛樺湪demo/log/demo.log鏂囦歡閲岋紝鍒欏彲浠ヨ涓猴細
<param name="File" value="webapps\\demo\\log\\framefile.log" />

---------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------
娉ㄦ剰鈥淺" 瑕佺敤杞箟瀛楃"\\",濡傛灉娌″姞,tomcat鍚姩灞忎腑鐨勮礬寰勪細鍙樹負涔辯爜.

tomcat涓技涔庨噰鍙栦簡鏌愮瀹夊叏絳栫暐
,<param name="Append" value="false" />涓嶈搗浣滅敤銆?br />
鏈嶅姟鍣ㄩ噸璧峰悗灝變細鏂板緩涓涓猯og鏂囦歡.



R.Zeus 2006-09-14 14:41 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 国产偷国产偷亚洲高清在线| 一级做a爱过程免费视| 狠狠色伊人亚洲综合成人| 夫妻免费无码V看片| 久久久久免费看黄a级试看| 五月婷婷免费视频| 亚洲熟妇成人精品一区| 中文字幕亚洲第一在线| 国产亚洲人成无码网在线观看| 免费永久在线观看黄网站| 成人免费视频小说| 五月婷婷综合免费| 91免费国产自产地址入| 国产免费爽爽视频在线观看| 猫咪免费人成网站在线观看| 亚洲А∨精品天堂在线| 99精品视频免费| 亚洲av无码一区二区三区乱子伦| 久久国产精品萌白酱免费| 77777_亚洲午夜久久多人| 97人伦色伦成人免费视频| 亚洲av日韩av永久在线观看| 亚洲国产成人影院播放| 黄色网站软件app在线观看免费| 亚洲一区二区三区电影| 无码视频免费一区二三区| 成在线人直播免费视频| 亚洲人成电影网站免费| 亚洲精品美女久久久久9999| 久久久久亚洲AV无码永不| 99久久亚洲综合精品成人网| 亚洲视频.com| 日韩亚洲Av人人夜夜澡人人爽| 99爱免费观看视频在线| 鲁死你资源站亚洲av| 亚洲综合日韩久久成人AV| 97国产免费全部免费观看| 羞羞网站在线免费观看| 久久亚洲综合色一区二区三区| 美女视频黄的全免费视频网站| 日日躁狠狠躁狠狠爱免费视频|