2014-11-08 36 views
1

並且提前感謝您的幫助。Weblogic Mvn Plugin部署失敗,無法連接到服務器t3:// localhost:7001

我試圖讓oracle weblogic mvn插件在我的機器上正常運行,但是我最終無法連接到管理服務器,並且插件錯誤消息在跟蹤問題時並不是非常有用。

概述: 我已經基本上遵循以下兩個頁面: (一)在我的本地庫安裝插件: http://docs.oracle.com/cd/E24329_01/web.1211/e24443/maven_deployer.htm#DEPGD383 (二)配置Maven插件 http://www.oracle.com/technetwork/articles/soa/eisele-weblogic-netbeans-2193786.html

所以我的配置看起來如下:

<profiles> 
     <profile> 
      <id>weblogicDeploy</id> 
      <properties> 
       <weblogic.server.version>12.1.2.0</weblogic.server.version> 
       <weblogic.server.adminurl>t3://127.0.0.1:7001</weblogic.server.adminurl> 
       <weblogic.server.middlewareHome>D:/appservers/weblogic</weblogic.server.middlewareHome>  
       <weblogic.server.serverName>AdminServer</weblogic.server.serverName>         
       <weblogic.server.userName>weblogic</weblogic.server.userName>         
       <weblogic.server.password>welcome1</weblogic.server.password>         
      </properties> 
      <dependencies> 
       <!--dependency> 
        <groupId>com.oracle.weblogic</groupId> 
        <artifactId>weblogic-server-pom</artifactId> 
        <version>${weblogic.server.version}</version> 
        <type>pom</type> 
        <scope>provided</scope> 
       </dependency--> 
      </dependencies> 

      <build> 
       <plugins> 
        <!-- 
         To have access to this plugin one must follow this guide: 
         http://docs.oracle.com/cd/E24329_01/web.1211/e24443/maven_deployer.htm#DEPGD383 
         The plugin is bundled with the web logic server - we cannot get it from the web unless we install it 
         into our nexus ...       
         (1) D:\weblogic\wlserver\server\lib>java -jar wljarbuilder.jar -profile weblogic-maven-plugin 
         (2) jar xvf c:\tmp\weblogic-maven-plugin.jar META-INF/maven/com.oracle.weblogic/weblogic-maven-plugin/pom.xml 
         (3) mvn install:install-file -Dfile=weblogic-maven-plugin.jar -DpomFile=META-INF/maven/com.oracle.weblogic/weblogic-maven-plugin/pom.xml 
        --> 
        <plugin> 
         <!-- This is the configuration for the weblogic-maven-plugin --> 
         <groupId>com.oracle.weblogic</groupId> 
         <artifactId>weblogic-maven-plugin</artifactId> 
         <version>${weblogic.server.version}</version> 
         <configuration> 
          <middlewareHome>${weblogic.server.middlewareHome}</middlewareHome> 
         </configuration> 
         <executions> 
          <!-- Deploy the application to the WebLogic Server in the pre-integration-test phase --> 
          <execution> 
           <id>wls-deploy</id> 
           <!-- Summary Of phase: 
            process and deploy the package if necessary into an environment where integration tests can be run 
           --> 
           <phase>pre-integration-test</phase> 
           <goals> 
            <goal>deploy</goal> 
           </goals> 
           <configuration> 
            <!--The admin URL where the app is deployed. 
            Here use the plugin's default value t3://localhost:7001--> 
            <adminurl>${weblogic.server.adminurl}</adminurl> 
            <user>${weblogic.server.userName}</user> 
            <password>${weblogic.server.password}</password> 
            <!--The location of the file or directory to be deployed--> 
            <source>${project.build.directory}/${project.build.finalName}.${project.packaging}</source> 
            <!--The target servers where the application is deployed. --> 
            <!--targets>${weblogic.server.serverName}</targets--> 
            <verbose>true</verbose> 
            <name>${project.build.finalName}</name> 
           </configuration> 
          </execution> 
         </executions> 
        </plugin> 
       </plugins> 
      </build> 
     </profile> 
    </profiles> 

沒有什麼在上述結構中,似乎是錯誤的: (一)(t3Url X使用者X密碼)1 CA ñ很容易驗證,這些都是有效的

$ netstat -an | grep "LISTEN" | grep "7001" 
    TCP 0.0.0.0:7001   0.0.0.0:0    LISTENING 
    TCP 0.0.0.0:7001   0.0.0.0:0    LISTENING 
    TCP 0.0.0.0:7001   0.0.0.0:0    LISTENING 
    TCP 0.0.0.0:7001   0.0.0.0:0    LISTENING 
    TCP 0.0.0.0:7001   0.0.0.0:0    LISTENING 
    TCP 0.0.0.0:7001   0.0.0.0:0    LISTENING 
    TCP 0.0.0.0:7001   0.0.0.0:0    LISTENING 
    TCP 0.0.0.0:7001   0.0.0.0:0    LISTENING 
    TCP 127.0.0.1:7001   0.0.0.0:0    LISTENING 
.... 

我也可以使用WLST連接到服務器: 初始化WebLogic腳本工具(WLST)...

Welcome to WebLogic Server Administration Scripting Shell 

Type help() for help on available commands 

wls:/offline> connect('weblogic','welcome1','t3://127.0.0.1:7001') 
Connecting to t3://127.0.0.1:7001 with userid weblogic ... 
Successfully connected to Admin Server "AdminServer" that belongs to domain "whateverdomain". 

Warning: An insecure protocol was used to connect to the 
server. To ensure on-the-wire security, the SSL port or 
Admin port should be used instead. 

(三)前點(a)url,(b)用戶名,(c)密碼,(d)目標管理服務器......基本上都是。

但是在運行mvn插件的mvn中,我最終總是會遇到以下異常。

Failed to execute goal com.oracle.weblogic:weblogic-maven-plugin:12.1.2.0:deploy (wls-deploy) on project whatevermy-war: weblogic.deploy.api.tools.deployer.DeployerException: Unable to connect to 't3://127.0.0.1:7001': weblogic.security.utils.KeyStoreConfiguration. Ensure the url represents a running admin server and that the credentials are correct. If using http protocol, tunneling must be enabled on the admin server. -> [Help 1] 

上述異常消息是非常clumnsy之一: (一)插件知道它被賦予的URL,它知道它沒有被告知使用http它是T3通訊協定 (b)如使用網址端口和設置一個無效的端口,我得到一個套接字異常和插件異常消息是完全一樣的東西...

那裏應該是配置方面,我有錯,管理服務器名稱,隱藏的安全策略......有些事情,但我在這一點上並不在意它可能是什麼。

通過這種方式,我已經評論了服務器pom的依賴關係,因爲無法從遠程存儲庫獲取這些依賴關係,並且我不知道Web邏輯服務器中的哪個jar會隱藏pom。否則,我會安裝在我的本地存儲庫中。我懷疑這是相關的,因爲插件似乎對嘗試連接到weblogic感到滿意。

非常感謝。

回答

2

通過遵循不同的oracle指南來解決如何安裝maven插件的問題。

本指南似乎在安裝Web邏輯插件方面做得更好。 http://docs.oracle.com/middleware/1213/wls/WLPRG/maven.htm

引用oracle安裝指南的相關部分。

Install the Oracle Maven sync plug-in and run the push goal: 

Change directory to ORACLE_HOME\oracle_common\plugins\maven\com\oracle\maven\oracle-maven-sync\12.1.3. 

mvn install:install-file -DpomFile=oracle-maven-sync-12.1.3.pom -Dfile=oracle-maven-sync-12.1.3.jar. 

mvn com.oracle.maven:oracle-maven-sync:push -Doracle-maven-sync.oracleHome=c:\oracle\middleware\oracle_home\. 

將指南調整到您自己的產品安裝路徑,並等待maven push命令成功構建。希望這個experiecen的weblogic插件能夠比第一個指南安裝的更好。

之後,我需要改變我的配置唯一的事情是插件版本。

<weblogic.server.version>12.1.2-0-0</weblogic.server.version> 

而瞧,這次我有一個工作插件,而不是一個虛構的玩具。

2

您可以在文件夾/weblogic/weblogic12/wlserver/modules中的com.oracle.weblogic.security.encryption_1.0.0.0.jar中找到'KeyStoreConfiguration'。 只需將KeyStoreConfiguration.class輸入weblogic-maven-plugin,一切順利!

+0

感謝您的回答。雖然它是downvoted兩次,我試過這種方式,並將jar作爲依賴項在POM.xml文件中。它正在工作。 – Kumar 2015-01-14 10:41:17

+0

我給了你一個觀點:D對我來說太有用了,我正在從Weblogic外部的服務器配置我的Maven 3.3,所以當我使用weblogic-maven-plugin時出現了這個錯誤。我只是將該jar添加到存儲庫中的同一文件夾,並且必須修改MANIFEST才能加載該jar並完成...好的技巧 – 2015-07-29 17:50:44

+0

Thanx很多!我認爲這是正確的解決方案。由於oracle-maven-sync:push會安裝/部署所有需要的依賴項。 – 2015-10-06 10:16:16

1

這與@crimsonwisp給出的答案相同。感謝@DanielHernández的評論。下面是我遵循的步驟,以擺脫

Failed to execute goal com.oracle.weblogic:weblogic-maven-plugin:12.1.2.0:deploy (wls-deploy) on project whatevermy-war: weblogic.deploy.api.tools.deployer.DeployerException: Unable to connect to 't3://127.0.0.1:7001': weblogic.security.utils.KeyStoreConfiguration. Ensure the url represents a running admin server and that the credentials are correct. If using http protocol, tunneling must be enabled on the admin server. -> [Help 1] 

從你wlserver,找到weblogic.security.encryption罐子

$ find . -name com.oracle.weblogic.security.encryption* 
./modules/com.oracle.weblogic.security.encryption_2.0.0.0.jar 

複製這個罐子的內容到weblogic-maven-plugin.jar。假設你在INSTALL_HOME/wlserver/server/lib目錄中。

$ mkdir -p /tmp/wlsmaven 
$ cp ../../modules/com.oracle.weblogic.security.encryption_2.0.0.0.jar /tmp/wlsmaven/ 
$ cp weblogic-maven-plugin.jar /tmp/wlsmaven/ 
$ cd /tmp/wlsmaven 
$ jar xvf com.oracle.weblogic.security.encryption_2.0.0.0.jar 
# Update jar with classes from weblogic.security.encryption jar 
$ jar uvf weblogic-maven-plugin.jar weblogic 
$ cd - 
$ cp /tmp/wlsmaven/weblogic-maven-plugin.jar . 

運行再次安裝maven命令以安裝在您當地的倉庫或無論您希望如此。

$ mvn install:install-file -Dfile=weblogic-maven-plugin.jar -DpomFile=pom.xml 
相關問題