1

私たちのプロジェクトはjettyサーバーにあり、完全に機能し、このプロジェクトはGlassfishサーバーにデプロイされますが、ここでエラーが発生します。

ロガーなどのようなもの。

エラー ::

    [#|2012-06-27T17:14:18.710+0530|SEVERE|glassfish3.1.2|org.apache.catalina.core.ContainerBase|_ThreadID=52;_ThreadName=AutoDeployer;|ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: java.lang.IllegalArgumentException: javax.servlet.ServletException: java.lang.ExceptionInInitializerError
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:5332)
        at com.sun.enterprise.web.WebModule.start(WebModule.java:498)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:917)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:901)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:733)
        at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2018)
        at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1669)
        at com.sun.enterprise.web.WebApplication.start(WebApplication.java:109)
        at org.glassfish.internal.data.EngineRef.start(EngineRef.java:130)
        at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:269)
        at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:301)
        at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:461)
        at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
        at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:389)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:353)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:363)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1085)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:95)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1291)
        at org.glassfish.deployment.autodeploy.AutoOperation.run(AutoOperation.java:145)
        at org.glassfish.deployment.autodeploy.AutoDeployer.deploy(AutoDeployer.java:575)
        at org.glassfish.deployment.autodeploy.AutoDeployer.deployAll(AutoDeployer.java:461)
        at org.glassfish.deployment.autodeploy.AutoDeployer.run(AutoDeployer.java:389)
        at org.glassfish.deployment.autodeploy.AutoDeployer.run(AutoDeployer.java:380)
        at org.glassfish.deployment.autodeploy.AutoDeployService$1.run(AutoDeployService.java:220)
        at java.util.TimerThread.mainLoop(Timer.java:555)
        at java.util.TimerThread.run(Timer.java:505)
Caused by: java.lang.IllegalArgumentException: javax.servlet.ServletException: java.lang.ExceptionInInitializerError
        at org.apache.catalina.core.StandardContext.addListener(StandardContext.java:2743)
        at org.apache.catalina.core.StandardContext.addApplicationListener(StandardContext.java:1966)
        at com.sun.enterprise.web.TomcatDeploymentConfig.configureApplicationListener(TomcatDeploymentConfig.java:235)
        at com.sun.enterprise.web.TomcatDeploymentConfig.configureWebModule(TomcatDeploymentConfig.java:94)
        at com.sun.enterprise.web.WebModuleContextConfig.start(WebModuleContextConfig.java:274)
        at com.sun.enterprise.web.WebModuleContextConfig.lifecycleEvent(WebModuleContextConfig.java:172)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:149)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:5329)
        ... 26 more
Caused by: javax.servlet.ServletException: java.lang.ExceptionInInitializerError
        at org.apache.catalina.core.StandardContext.createListener(StandardContext.java:2853)
        at org.apache.catalina.core.StandardContext.loadListener(StandardContext.java:4806)
        at com.sun.enterprise.web.WebModule.loadListener(WebModule.java:1599)
        at org.apache.catalina.core.StandardContext.addListener(StandardContext.java:2740)
        ... 33 more
Caused by: java.lang.ExceptionInInitializerError
        at org.apache.log4j.Logger.getLogger(Logger.java:118)
        at mwp.slktechlabs.web.SessionListener.<clinit>(SessionListener.java:35)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
        at com.sun.enterprise.container.common.impl.util.InjectionManagerImpl.createManagedObject(InjectionManagerImpl.java:307)
        at com.sun.enterprise.web.WebContainer.createListenerInstance(WebContainer.java:761)
        at com.sun.enterprise.web.WebModule.createListenerInstance(WebModule.java:1987)
        at org.apache.catalina.core.StandardContext.createListener(StandardContext.java:2851)
        ... 36 more
Caused by: java.lang.SecurityException: Access to default session denied
        at javax.mail.Session.getDefaultInstance(Session.java:320)
        at mwp.slktechlabs.log.SMTPSSLAppender.createSession(SMTPSSLAppender.java:31)
        at org.apache.log4j.net.SMTPAppender.activateOptions(SMTPAppender.java:121)
        at org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:257)
        at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:133)
        at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:97)
        at org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:689)
        at org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:647)
        at org.apache.log4j.PropertyConfigurator.parseCatsAndRenderers(PropertyConfigurator.java:568)
        at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:442)
        at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:476)
        at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:471)
        at org.apache.log4j.LogManager.<clinit>(LogManager.java:125)
        ... 46 more
|#]

mwp は私たちのプロジェクトとロガーのエラーです。

Caused by: java.lang.ExceptionInInitializerError
        at org.apache.log4j.Logger.getLogger(Logger.java:118)
        at mwp.slktechlabs.web.SessionListener.<clinit>(SessionListener.java:35)

と行番号: 35 は

private static final Logger logger = Logger.getLogger(SessionListener.class);

mwp.slktechlabs.web.SessionListener.java ファイル内。

このエラーを取り除く方法を教えてください。

ありがとう、

カムレシュ

4

1 に答える 1

1

電子メール転送も使用するようにロガーを構成しました。

原因: java.lang.SecurityException: mwp.slktechlabs.log.SMTPSSLAppender.createSession(SMTPSSLAppender.java:31) の javax.mail.Session.getDefaultInstance(Session.java:320) で拒否されたデフォルト セッションへのアクセス

セキュリティ マネージャーは設定でそれを許可しないため、電子メールを送信しないようにロガーを再設定するか、これを許可するようにセキュリティ マネージャーを再設定する必要があります。

于 2012-06-27T12:44:14.200 に答える