当前位置: 首页 > 知识库问答 >
问题:

Weblogic Mvn插件部署无法连接到服务器t3://localhost:7001

谢洛城
2023-03-14

并提前感谢您的帮助。

我正试图让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 userName x password)我可以很容易地验证这些配置是否有效

$ 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.

(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,它知道它没有被告知使用超文本传输协议,它是t3协议(b)如果使用url端口并设置无效端口,我确实得到一个套接字异常,来自插件的异常消息是完全一样的...

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

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

非常感谢。

共有3个答案

柯鸿振
2023-03-14

这与@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。安全加密jar

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

将这个jar的内容复制到weblogic maven插件中。jar。假设您位于INSTALL\u 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命令,将其安装在本地repo或任何您想要的地方。

$ mvn install:install-file -Dfile=weblogic-maven-plugin.jar -DpomFile=pom.xml
柴琦
2023-03-14

你可以找到'KeyStoreConfiguration'在com.oracle.weblogic.security.encryption_1.0.0.0. jar在文件夹 /weblogic/weblogic12/wlserver/modules.只是把KeyStoreConfiguration.class输入weblogic-maven-plugin,一切顺利!

楚丰羽
2023-03-14

通过遵循关于如何安装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推送命令成功构建。希望您从这次体验中获得的weblogic插件会比第一个指南安装的插件更好。

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

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

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

 类似资料:
  • 我正在尝试使用 javamail 连接到本地后缀鸽子服务器。我已经使用 Thunderbird 成功连接到服务器,所以我知道我的用户名和密码是正确的,但我总是得到 我所知道的唯一一件事就是改变java。禁用一些不太安全的协议。dovecot需要什么协议?还是我看错了方向。 如果这是一个协议问题,是否有任何方法可以将参数传递给编译器?我确实有其他服务,我想阻止支持禁用的协议 编辑: 这是我使用的代码

  • 问题内容: 当我尝试使用PHP发送电子邮件时,我一直收到此错误消息: 我的php.ini看起来像这样: 我将笔记本电脑用作服务器。.我在做什么错?谢谢。 问题答案: 您需要在本地运行邮件服务器。如果是Unix,请启用sendmail。如果是Windows,请安装IIs的“简单邮​​件传输服务器”(不确定名称是否正确)组件。

  • 我正在尝试连接到我的电子邮件服务器使用我的spring boot应用程序。当我从命令提示符telnet localhost25时,我看到下面的- 220 Microsoft ESMTP邮件服务准备就绪2016年5月18日星期三11:09:30-0400 但是,当我尝试从我的程序连接时,我看到下面的错误 原因:org.springframework.Mail.mailsendexception:邮件

  • 我在设置打开班次时遇到问题,并在连接到我的服务器域后收到以下错误: 我不确定这是在告诉我做什么。我尝试按字面意思使用指令,但它无法识别命令。 有什么想法吗?

  • 问题内容: 我不确定如何解决此问题 我不知道为什么在尝试以下操作时会出现此错误: 当我尝试连接到postgres时: 问题答案: 可能是一些问题: PostgreSQL没有运行。用sudo检查 你的PostgresSQl不在端口5432上运行。你可以检查其键入 尝试连接到数据库时出现错误,例如用户名,密码或数据库名。检查它们是否是postgres要求你连接的对象,并且这是你要访问的db_name。