从IDEA运行时的java.io.FileNotFoundException config \ security.properties

时间:2014-11-17 08:58:11

标签: java intellij-idea

当我从IDEA运行我的应用程序时,我收到以下警告(见下文)。从IDEA外部运行相同的代码时,不会出现此警告(即使文件不存在也是如此)。 似乎一切都运转正常,但仍然,这有点烦人......我怎么能摆脱它? (顺便说一句,我正在使用Tomcat嵌入式)。

    java.io.FileNotFoundException: C:\...\config\security.properties (The system cannot find the path specified)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(FileInputStream.java:138)
    at com.sun.enterprise.util.Utility.getPropertiesFromFile(Utility.java:56)
    at com.sun.enterprise.iiop.POAEJBORB.<clinit>(POAEJBORB.java:83)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:340)
    at org.omg.CORBA.ORB.create_impl(ORB.java:308)
    at org.omg.CORBA.ORB.init(ORB.java:351)
    at com.sun.enterprise.util.ORBManager.createORB(ORBManager.java:140)
    at com.sun.enterprise.util.ORBManager.init(ORBManager.java:69)
    at com.sun.enterprise.naming.SerialInitContextFactory.<init>(SerialInitContextFactory.java:35)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
    at java.lang.Class.newInstance(Class.java:433)
    at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:672)
    at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:313)
    at javax.naming.InitialContext.init(InitialContext.java:244)
    at javax.naming.InitialContext.<init>(InitialContext.java:192)
    at com.sun.jersey.server.impl.InitialContextHelper.getInitialContext(InitialContextHelper.java:56)
    at com.sun.jersey.spi.container.servlet.WebComponent.configureJndiResources(WebComponent.java:805)
    at com.sun.jersey.spi.container.servlet.WebComponent.configure(WebComponent.java:530)
    at com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.configure(ServletContainer.java:314)
    at com.sun.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:604)
    at com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:207)
    at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:376)
    at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:559)
    at javax.servlet.GenericServlet.init(GenericServlet.java:160)
    at org.apache.catalina.startup.Tomcat$ExistingStandardWrapper.loadServlet(Tomcat.java:855)
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1088)
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5123)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5407)
    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:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
java.io.FileNotFoundException: C:\...\config\ejb.properties (The system cannot find the path specified)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(FileInputStream.java:138)
    at com.sun.enterprise.util.Utility.getPropertiesFromFile(Utility.java:56)
    at com.sun.enterprise.iiop.J2EEInitializer.<init>(J2EEInitializer.java:57)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
    at java.lang.Class.newInstance(Class.java:433)
    at com.sun.corba.ee.internal.Interceptors.PIORB.registerORBInitializers(PIORB.java:373)
    at com.sun.corba.ee.internal.Interceptors.PIORB.parseProperties(PIORB.java:343)
    at com.sun.corba.ee.internal.TxPOA.TxPIORB.parseProperties(TxPIORB.java:116)
    at com.sun.corba.ee.internal.corba.ORB.set_parameters(ORB.java:449)
    at com.sun.corba.ee.internal.POA.POAORB.set_parameters(POAORB.java:152)
    at com.sun.corba.ee.internal.Interceptors.PIORB.set_parameters(PIORB.java:332)
    at org.omg.CORBA.ORB.init(ORB.java:353)
    at com.sun.enterprise.util.ORBManager.createORB(ORBManager.java:140)
    at com.sun.enterprise.util.ORBManager.init(ORBManager.java:69)
    at com.sun.enterprise.naming.SerialInitContextFactory.<init>(SerialInitContextFactory.java:35)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
    at java.lang.Class.newInstance(Class.java:433)
    at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:672)
    at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:313)
    at javax.naming.InitialContext.init(InitialContext.java:244)
    at javax.naming.InitialContext.<init>(InitialContext.java:192)
    at com.sun.jersey.server.impl.InitialContextHelper.getInitialContext(InitialContextHelper.java:56)
    at com.sun.jersey.spi.container.servlet.WebComponent.configureJndiResources(WebComponent.java:805)
    at com.sun.jersey.spi.container.servlet.WebComponent.configure(WebComponent.java:530)
    at com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.configure(ServletContainer.java:314)
    at com.sun.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:604)
    at com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:207)
    at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:376)
    at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:559)
    at javax.servlet.GenericServlet.init(GenericServlet.java:160)
    at org.apache.catalina.startup.Tomcat$ExistingStandardWrapper.loadServlet(Tomcat.java:855)
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1088)
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5123)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5407)
    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:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

1 个答案:

答案 0 :(得分:0)

根据您的问题,目前尚不清楚哪个记录器正在记录此警告(看起来像是Tomcat之一)以及您使用的是哪个版本的Tomcat,但您通常可以微调Tomcat中的日志级别。更多信息: http://tomcat.apache.org/tomcat-6.0-doc/logging.html

我不会建议您禁用警告。