1

并提前感谢您的帮助。

我试图让 oracle weblogic mvn 插件在我的机器上正常运行,但我最终在连接到管理服务器时遇到了困难,并且插件错误消息在跟踪问题时不是很有用。

概述:我基本上遵循以下两页:(a)在我的本地存储库上安装插件:http: //docs.oracle.com/cd/E24329_01/web.1211/e24443/maven_deployer.htm#DEPGD383 (b ) 配置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>

上述配置中似乎没有任何错误: (a) (t3Url x 用户名 x 密码) 我可以很容易地验证这些是有效的

$ 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 连接到服务器: Initializing WebLogic Sc​​ripting Tool (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.

(c) 上一点显示 (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]

上面的异常消息是一个非常笨拙的消息:(a)插件知道它给出的 url,它知道它没有被告知使用 http 它是 t3 协议(b)如果使用 url 端口并设置无效端口,我确实得到了一个套接字异常,并且来自插件的异常消息是完全相同的......

应该有一个配置方面我错了,管理服务器名称,隐藏的安全策略......一些东西,但我现在没有看到它可能是什么。

顺便说一句,我已经评论了对服务器 pom 的依赖,因为你无法从远程存储库中获取这些依赖,而且我不知道 web 逻辑服务器中的哪个 jar 隐藏了 pom。否则,我也会安装在我的本地存储库中。我怀疑这是否相关,因为该插件似乎对尝试连接到 weblogic 感到满意。

非常感谢。

4

3 回答 3

2

您可以在文件夹 /weblogic/weblogic12/wlserver/modules 中的 com.oracle.weblogic.security.encryption_1.0.0.0.jar 中找到“KeyStoreConfiguration”。只需把KeyStoreConfiguration.class 输入weblogic-maven-plugin,一切顺利!

于 2014-12-04T03:22:10.637 回答
2

通过遵循有关如何安装 maven 插件的不同 oracle 指南修复了该问题。

本指南似乎在安装 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命令构建成功。希望您从此体验中获得的 weblogic 插件会比第一个指南安装的插件更好。

在此之后,我唯一需要更改配置的就是插件版本。

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

瞧,这一次我得到了一个工作插件,而不是一个虚构的玩具。

于 2014-11-08T10:39:46.540 回答
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 jar

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

将此 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
于 2016-04-09T01:11:39.773 回答