使用websphere配置类的Spring启动不起作用

时间:2015-09-22 07:55:35

标签: java spring spring-boot websphere

使用springboot tomcat运行应用程序时出现以下错误。以下错误消息不断重复。请帮忙。

  

2015-09-22 03:37:09.477 ERROR 20112 --- [主要]   c.i.w.naming.java.javaURLContextFactory:NMSV0307E:一个ja​​va:URL名称   使用,b ut Naming未配置为处理java:URL名称。   可能的原因是用户在尝试指定java:URL时出错   非J2EE客户端或服务器环境中的名称。投掷   的ConfigurationException。

依赖关系

<dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>log4j-over-slf4j</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.aredis</groupId>
            <artifactId>aredis</artifactId>
            <version>1.4</version>

        </dependency>
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <!-- <version>1.2.16</version> -->

        </dependency>
        <dependency>
            <groupId>net.sf.joesnmp</groupId>
            <artifactId>joesnmp</artifactId>
            <version>0.3.4</version>

        </dependency>
        <dependency>
                <groupId>com.ibm.ws.admin</groupId>  
                <artifactId>adminClient</artifactId>  
                <version>8.5.0</version>  
        </dependency>
        <dependency>
            <groupId>com.ibm.ws.runtime</groupId>
            <artifactId>ibmRuntime</artifactId>
            <version>1.0</version>
        </dependency>

        <dependency>
            <groupId>com.ibm.websphere</groupId>
            <artifactId>ibmorb</artifactId>
            <version>8.5</version>
        </dependency>

        <dependency>
            <groupId>com.ibm.websphere</groupId>
            <artifactId>ibmorbapi</artifactId>
            <version>8.5</version>
        </dependency>

        <dependency>
            <groupId>com.ibm.websphere</groupId>
            <artifactId>orb</artifactId>
            <version>8.5</version>
        </dependency> 

    </dependencies>
    <properties>
        <start-class>com.springboot.main.ConfigInitializer</start-class>
        <jersey-version>1.5</jersey-version>
    </properties>

1 个答案:

答案 0 :(得分:1)

On Spring Boot v1.5.6.RELEASE我必须这样做才能在类路径上加载WebSphere类:

/src/main/resources/application.properties:

spring.jmx.enabled=false

/src/main/resources/spring.properties:

spring.jndi.ignore=true