如何在eclipse中运行weblogic中的springboot maven项目进行开发

时间:2018-01-16 09:50:34

标签: eclipse maven spring-boot weblogic

我有一个在eclipse neon中创建的springboot webservices项目,并且使用spring boot提供的嵌入式tomcat工作正常,但我希望我的spring-boot maven webservices项目能够在weblogic而不是tomcat上运行,因为在一天结束时我们我们将在welogic中部署我们的项目作为web服务,将由angulr5使用。

到目前为止我尝试了什么。

我的pom.xml看起来像这样。

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.example</groupId>
    <artifactId>springboot</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>war</packaging>

    <name>springboot</name>
    <description>Demo project for Spring Boot</description>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.5.9.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <java.version>1.8</java.version>
    </properties>

    <dependencies>
        <!-- <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>-->

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <exclusions>
                <exclusion>
                    <artifactId>tomcat-embed-el</artifactId>
                    <groupId>org.apache.tomcat.embed</groupId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-tomcat</artifactId>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <artifactId>tomcat-embed-el</artifactId>
                    <groupId>org.apache.tomcat.embed</groupId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <skip>true</skip>
                </configuration>
            </plugin>
        </plugins>
    </build>


</project>

我的src-&gt; main-&gt; webapp-&gt; WEB-INF-&gt; weblogic.xml是,

<?xml version="1.0" encoding="UTF-8"?>
<wls:weblogic-web-app 
xmlns:wls="http://xmlns.oracle.com/weblogic/weblogic-web-app" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee         
http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd         
http://xmlns.oracle.com/weblogic/weblogic-web-app         
http://xmlns.oracle.com/weblogic/weblogic-web-app/1.4/weblogic-web-app.xsd">
    <wls:container-descriptor>
        <wls:prefer-application-packages>
            <wls:package-name>org.slf4j.*</wls:package-name>
        </wls:prefer-application-packages>
    </wls:container-descriptor>
</wls:weblogic-web-app>

我收到此错误。

.
.
JAVA Memory arguments: -Xms256m -Xmx512m -XX:CompileThreshold=8000
.
CLASSPATH=C:\PROGRA~1\Java\JDK18~1.0_1\lib\tools.jar;C:\Oracle\MIDDLE~1\ORACLE~1\wlserver\server\lib\weblogic.jar;C:\Oracle\MIDDLE~1\ORACLE~1\oracle_common\modules\net.sf.antcontrib_1.1.0.0_1-0b3\lib\ant-contrib.jar;C:\Oracle\MIDDLE~1\ORACLE~1\wlserver\modules\features\oracle.wls.common.nodemanager.jar;C:\Oracle\MIDDLE~1\ORACLE~1\wlserver\common\derby\lib\derbynet.jar;C:\Oracle\MIDDLE~1\ORACLE~1\wlserver\common\derby\lib\derbyclient.jar;C:\Oracle\MIDDLE~1\ORACLE~1\wlserver\common\derby\lib\derby.jar
.
PATH=C:\Oracle\MIDDLE~1\ORACLE~1\USER_P~1\domains\BASE_D~1\bin;;C:\Oracle\MIDDLE~1\ORACLE~1\wlserver\server\native\win\x64;C:\Oracle\MIDDLE~1\ORACLE~1\wlserver\server\bin;C:\Oracle\MIDDLE~1\ORACLE~1\oracle_common\modules\org.apache.ant_1.9.2\bin;C:\PROGRA~1\Java\JDK18~1.0_1\jre\bin;C:\PROGRA~1\Java\JDK18~1.0_1\bin;C:\Oracle\MIDDLE~1\ORACLE~1\wlserver\server\native\win\x64\oci920_8;C:\PROGRA~1\Java\JRE18~1.0_1\bin\server;C:\PROGRA~1\Java\JRE18~1.0_1\bin;C:\PROGRA~1\Java\JRE18~1.0_1\lib\amd64;C:\PROGRA~3\Oracle\Java\javapath;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WINDOW~1\v1.0\;C:\PROGRA~1\TORTOI~1\bin;C:\PROGRA~1\Intel\WiFi\bin\;C:\PROGRA~1\COMMON~1\Intel\WIRELE~1\;C:\PROGRA~1\nodejs\;C:\PROGRA~1\Java\JDK18~1.0_1\bin;D:\softwares\apache-maven-3.5.2-bin\apache-maven-3.5.2\bin;C:\Users\Adarsha\AppData\Local\MICROS~1\WINDOW~1;C:\Users\Adarsha\AppData\Roaming\npm;C:\PROGRA~1\Java\JDK18~1.0_1\bin;D:\softwares\apache-maven-3.5.2-bin\apache-maven-3.5.2\bin;C:\PROGRA~1\MICROS~2\bin;D:\softwares\eclipse
.
***************************************************
*  To start WebLogic Server, use a username and   *
*  password assigned to an admin-level user.  For *
*  server administration, use the WebLogic Server *
*  console at http:\\hostname:port\console        *
***************************************************
Starting WLS with line:
C:\PROGRA~1\Java\JDK18~1.0_1\bin\java -server   -Xms256m -Xmx512m -XX:CompileThreshold=8000 -Dweblogic.Name=AdminServer -Djava.security.policy=C:\Oracle\MIDDLE~1\ORACLE~1\wlserver\server\lib\weblogic.policy -Xverify:none  -Djava.system.class.loader=com.oracle.classloader.weblogic.LaunchClassLoader  -javaagent:C:\Oracle\MIDDLE~1\ORACLE~1\wlserver\server\lib\debugpatch-agent.jar -da -Dwls.home=C:\Oracle\MIDDLE~1\ORACLE~1\wlserver\server -Dweblogic.home=C:\Oracle\MIDDLE~1\ORACLE~1\wlserver\server      weblogic.Server
<16 Jan, 2018 5:18:57 PM SGT> <Info> <Security> <BEA-090905> <Disabling the CryptoJ JCE Provider self-integrity check for better startup performance. To enable this check, specify -Dweblogic.security.allowCryptoJDefaultJCEVerification=true.> 
<16 Jan, 2018 5:18:58 PM SGT> <Info> <Security> <BEA-090906> <Changing the default Random Number Generator in RSA CryptoJ from ECDRBG128 to HMACDRBG. To disable this change, specify -Dweblogic.security.allowCryptoJDefaultPRNG=true.> 
<16 Jan, 2018 5:18:58 PM SGT> <Info> <WebLogicServer> <BEA-000377> <Starting WebLogic Server with Java HotSpot(TM) 64-Bit Server VM Version 25.152-b16 from Oracle Corporation.> 
<16 Jan, 2018 5:18:58 PM SGT> <Info> <RCM> <BEA-2165021> <"ResourceManagement" is not enabled in this JVM. Enable "ResourceManagement" to use the WebLogic Server "Resource Consumption Management" feature. To enable "ResourceManagement", you must specify the following JVM options in the WebLogic Server instance in which the JVM runs: -XX:+UnlockCommercialFeatures -XX:+ResourceManagement.> 
<16 Jan, 2018 5:18:59 PM SGT> <Info> <Management> <BEA-141107> <Version: WebLogic Server 12.2.1.2.0 Mon Oct  3 04:35:36 PDT 2016 1827450> 
<16 Jan, 2018 5:19:00 PM SGT> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING.> 
<16 Jan, 2018 5:19:00 PM SGT> <Info> <WorkManager> <BEA-002900> <Initializing self-tuning thread pool.> 
<16 Jan, 2018 5:19:00 PM SGT> <Info> <WorkManager> <BEA-002942> <CMM memory level becomes 0. Setting standby thread pool size to 256.> 
<16 Jan, 2018, 5:19:01,707 PM SGT> <Notice> <Log Management> <BEA-170019> <The server log file weblogic.logging.FileStreamHandler instance=1211306809
Current log file=C:\Oracle\Middleware\Oracle_Home\user_projects\domains\base_domain\servers\AdminServer\logs\AdminServer.log
Rotation dir=C:\Oracle\Middleware\Oracle_Home\user_projects\domains\base_domain\servers\AdminServer\logs
 is opened. All server side log events will be written to this file.> 
<16 Jan, 2018, 5:19:01,927 PM SGT> <Notice> <Security> <BEA-090946> <Security pre-initializing using security realm: myrealm> 
<16 Jan, 2018, 5:19:02,215 PM SGT> <Notice> <Security> <BEA-090947> <Security post-initializing using security realm: myrealm> 
<16 Jan, 2018, 5:19:02,729 PM SGT> <Notice> <Security> <BEA-090082> <Security initialized using administrative security realm: myrealm> 
<16 Jan, 2018, 5:19:03,304 PM SGT> <Warning> <JMX> <BEA-149512> <JMX Connector Server started at service:jmx:iiop://192.168.0.221:7001/jndi/weblogic.management.mbeanservers.runtime.> 
<16 Jan, 2018, 5:19:03,850 PM SGT> <Warning> <JMX> <BEA-149512> <JMX Connector Server started at service:jmx:iiop://192.168.0.221:7001/jndi/weblogic.management.mbeanservers.domainruntime.> 
<16 Jan, 2018, 5:19:04,93 PM SGT> <Warning> <JMX> <BEA-149512> <JMX Connector Server started at service:jmx:iiop://192.168.0.221:7001/jndi/weblogic.management.mbeanservers.edit.> 
<16 Jan, 2018, 5:19:04,842 PM SGT> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STANDBY.> 
<16 Jan, 2018, 5:19:04,843 PM SGT> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING.> 
<16 Jan, 2018, 5:19:04,886 PM SGT> <Notice> <Log Management> <BEA-170036> <The Logging monitoring service timer has started to check for logged message counts every 30 seconds.> 
<16 Jan, 2018, 5:19:08,402 PM SGT> <Error> <HTTP> <BEA-101165> <Could not load user defined filter in web.xml: weblogic.websocket.tyrus.TyrusServletFilter.
java.lang.ClassCastException: org.apache.tomcat.websocket.server.WsServerContainer cannot be cast to org.glassfish.tyrus.server.TyrusServerContainer
    at weblogic.websocket.tyrus.TyrusServletFilter.init(TyrusServletFilter.java:80)
    at weblogic.servlet.internal.FilterManager$FilterInitAction.run(FilterManager.java:400)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:326)
    at weblogic.security.service.SecurityManager.runAsForUserCode(SecurityManager.java:197)
    at weblogic.servlet.provider.WlsSecurityProvider.runAsForUserCode(WlsSecurityProvider.java:203)
    Truncated. see log file for complete stacktrace
> 
<16 Jan, 2018, 5:19:08,425 PM SGT> <Notice> <Log Management> <BEA-170027> <The server has successfully established a connection with the Domain level Diagnostic Service.> 
<16 Jan, 2018, 5:19:08,472 PM SGT> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to ADMIN.> 
<16 Jan, 2018, 5:19:08,678 PM SGT> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RESUMING.> 
<16 Jan, 2018, 5:19:08,738 PM SGT> <Notice> <Server> <BEA-002613> <Channel "Default[2]" is now listening on 127.0.0.1:7001 for protocols iiop, t3, ldap, snmp, http.> 
<16 Jan, 2018, 5:19:10,143 PM SGT> <Warning> <Server> <BEA-002611> <The hostname "Adarsha", maps to multiple IP addresses: 192.168.0.221, fe80:0:0:0:20a3:a0e4:2ddb:1b94%20, fe80:0:0:0:3c28:330d:88b4:e09d%7, 2001:0:9d38:6abd:3c28:330d:88b4:e09d.> 
<16 Jan, 2018, 5:19:10,145 PM SGT> <Notice> <Server> <BEA-002613> <Channel "Default[1]" is now listening on 2001:0:9d38:6abd:3c28:330d:88b4:e09d:7001 for protocols iiop, t3, ldap, snmp, http.> 
<16 Jan, 2018, 5:19:10,149 PM SGT> <Notice> <Server> <BEA-002613> <Channel "Default[3]" is now listening on 0:0:0:0:0:0:0:1:7001 for protocols iiop, t3, ldap, snmp, http.> 
<16 Jan, 2018, 5:19:10,157 PM SGT> <Notice> <Server> <BEA-002613> <Channel "Default" is now listening on 192.168.0.221:7001 for protocols iiop, t3, ldap, snmp, http.> 
<16 Jan, 2018, 5:19:10,158 PM SGT> <Notice> <WebLogicServer> <BEA-000331> <Started the WebLogic Server Administration Server "AdminServer" for domain "base_domain" running in development mode.> 
<16 Jan, 2018, 5:19:10,158 PM SGT> <Notice> <Server> <BEA-002613> <Channel "Default[2]" is now listening on 127.0.0.1:7001 for protocols iiop, t3, ldap, snmp, http.> 
<16 Jan, 2018, 5:19:10,159 PM SGT> <Notice> <Server> <BEA-002613> <Channel "Default[1]" is now listening on 2001:0:9d38:6abd:3c28:330d:88b4:e09d:7001 for protocols iiop, t3, ldap, snmp, http.> 
<16 Jan, 2018, 5:19:10,160 PM SGT> <Notice> <Server> <BEA-002613> <Channel "Default[3]" is now listening on 0:0:0:0:0:0:0:1:7001 for protocols iiop, t3, ldap, snmp, http.> 
<16 Jan, 2018, 5:19:10,161 PM SGT> <Notice> <Server> <BEA-002613> <Channel "Default" is now listening on 192.168.0.221:7001 for protocols iiop, t3, ldap, snmp, http.> 
<16 Jan, 2018, 5:19:10,165 PM SGT> <Notice> <WebLogicServer> <BEA-000360> <The server started in RUNNING mode.> 
<16 Jan, 2018, 5:19:10,178 PM SGT> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RUNNING.> 
<16 Jan, 2018, 5:19:15,339 PM SGT> <Warning> <JMX> <BEA-149535> <JMX Resiliency Activity Server=AdminServer : Initializing callbacks> 
<16 Jan, 2018, 5:19:15,341 PM SGT> <Warning> <JMX> <BEA-149535> <JMX Resiliency Activity Server=AdminServer : Added MBeanServerConnection in DomainRuntimeServiceMBean > 
<16 Jan, 2018, 5:19:15,342 PM SGT> <Warning> <JMX> <BEA-149535> <JMX Resiliency Activity Server=AdminServer : Callback is done> 
<16 Jan, 2018, 5:19:15,344 PM SGT> <Warning> <JMX> <BEA-149535> <JMX Resiliency Activity Server=AdminServer : Connection already exists for the server. Did not attempt to connect to the server> 
<16 Jan, 2018, 5:19:15,470 PM SGT> <Warning> <JMX> <BEA-149535> <JMX Resiliency Activity Server=All Servers : Resolving connection list DomainRuntimeServiceMBean> 
<16 Jan, 2018, 5:19:36,553 PM SGT> <Error> <Deployer> <BEA-149265> <Failure occurred in the execution of deployment request with ID "142248479790392" for task "2" on [partition-name: DOMAIN]. Error is: "weblogic.application.ModuleException: java.lang.ClassNotFoundException: org.apache.tomcat.websocket.pojo.PojoEndpointBase"
weblogic.application.ModuleException: java.lang.ClassNotFoundException: org.apache.tomcat.websocket.pojo.PojoEndpointBase
    at weblogic.application.internal.ExtensibleModuleWrapper.start(ExtensibleModuleWrapper.java:140)
    at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:124)
    at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:233)
    at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:228)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:45)
    Truncated. see log file for complete stacktrace
Caused By: java.lang.ClassNotFoundException: org.apache.tomcat.websocket.pojo.PojoEndpointBase
    at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:1026)
    at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:987)
    at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:83)
    at weblogic.utils.classloaders.GenericClassLoader.doFindClass(GenericClassLoader.java:608)
    at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:540)
    Truncated. see log file for complete stacktrace
> 
<16 Jan, 2018, 5:19:36,568 PM SGT> <Error> <Deployer> <BEA-149202> <Encountered an exception while attempting to commit the 7 task for the application "_auto_generated_ear_" on [partition-name: DOMAIN].> 
<16 Jan, 2018, 5:19:36,575 PM SGT> <Warning> <Deployer> <BEA-149004> <Failures were detected while initiating start task for application "_auto_generated_ear_".> 
<16 Jan, 2018, 5:19:36,575 PM SGT> <Warning> <Deployer> <BEA-149078> <Stack trace for message 149004
weblogic.application.ModuleException: java.lang.ClassNotFoundException: org.apache.tomcat.websocket.pojo.PojoEndpointBase
    at weblogic.application.internal.ExtensibleModuleWrapper.start(ExtensibleModuleWrapper.java:140)
    at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:124)
    at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:233)
    at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:228)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:45)
    Truncated. see log file for complete stacktrace
Caused By: java.lang.ClassNotFoundException: org.apache.tomcat.websocket.pojo.PojoEndpointBase
    at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:1026)
    at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:987)
    at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:83)
    at weblogic.utils.classloaders.GenericClassLoader.doFindClass(GenericClassLoader.java:608)
    at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:540)
    Truncated. see log file for complete stacktrace

请帮我解决这个问题。

0 个答案:

没有答案