在web应用中发送和接收Jakarta消息

在web应用中发送和接收Jakarta消息,第1张

在web应用中发送接收Jakarta消息

Running the websimplemessage Example

To Package and Deploy websimplemessage Using Maven

_1、Make sure that GlassFish Server has been started (see Starting and Stopping GlassFish Server).

_2、In a terminal window, go to:

tut-install/examples/jms/websimplemessage/

_3、To compile the source files and package and deploy the application, use the following command:

mvn install

[root@eclipse websimplemessage]# cd /work/jakartaee-tutorial-examples/jms/websimplemessage

[root@eclipse websimplemessage]# ls

pom.xml src

[root@eclipse websimplemessage]# mvn install

[INFO] Scanning for projects...

[INFO]

[INFO] ---------------< jakarta.tutorial.jms:websimplemessage >----------------

[INFO] Building websimplemessage 9.0-SNAPSHOT

[INFO] --------------------------------[ war ]---------------------------------

[INFO]

[INFO] --- maven-enforcer-plugin:3.0.0-M3:enforce (enforce-versions) @ websimplemessage ---

[INFO]

[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ websimplemessage ---

[INFO] Using 'UTF-8' encoding to copy filtered resources.

[INFO] skip non existing resourceDirectory /work/jakartaee-tutorial-examples/jms/websimplemessage/src/main/resources

[INFO]

[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ websimplemessage ---

[INFO] Changes detected - recompiling the module!

[INFO] Compiling 2 source files to /work/jakartaee-tutorial-examples/jms/websimplemessage/target/classes

[INFO]

[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ websimplemessage ---

[INFO] Using 'UTF-8' encoding to copy filtered resources.

[INFO] skip non existing resourceDirectory /work/jakartaee-tutorial-examples/jms/websimplemessage/src/test/resources

[INFO]

[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ websimplemessage ---

[INFO] No sources to compile

[INFO]

[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ websimplemessage ---

[INFO] No tests to run.

[INFO]

[INFO] --- maven-war-plugin:3.3.1:war (default-war) @ websimplemessage ---

[INFO] Packaging webapp

[INFO] Assembling webapp [websimplemessage] in [/work/jakartaee-tutorial-examples/jms/websimplemessage/target/websimplemessage]

[INFO] Processing war project

[INFO] Copying webapp resources [/work/jakartaee-tutorial-examples/jms/websimplemessage/src/main/webapp]

[INFO] Building war: /work/jakartaee-tutorial-examples/jms/websimplemessage/target/websimplemessage.war

[INFO]

[INFO] --- cargo-maven2-plugin:1.8.3:redeploy (deploy) @ websimplemessage ---

[INFO] [DeployerRedeployMojo] Resolved container artifact org.codehaus.cargo:cargo-core-container-glassfish:jar:1.8.3 for container glassfish6x

[INFO] [talledLocalContainer] Parsed GlassFish version = [6.2.3]

[INFO] [talledLocalContainer] Application deployed with name websimplemessage.

[INFO] [talledLocalContainer] Command deploy executed successfully.

[INFO]

[INFO] --- maven-install-plugin:2.4:install (default-install) @ websimplemessage ---

[INFO] Installing /work/jakartaee-tutorial-examples/jms/websimplemessage/target/websimplemessage.war to /root/.m2/repository/jakarta/tutorial/jms/websimplemessage/9.0-SN

APSHOT/websimplemessage-9.0-SNAPSHOT.war

[INFO] Installing /work/jakartaee-tutorial-examples/jms/websimplemessage/pom.xml to /root/.m2/repository/jakarta/tutorial/jms/websimplemessage/9.0-SNAPSHOT/websimplemess

age-9.0-SNAPSHOT.pom

[INFO] ------------------------------------------------------------------------

[INFO] BUILD SUCCESS

[INFO] ------------------------------------------------------------------------

[INFO] Total time: 9.638 s

[INFO] Finished at: 2022-01-17T16:44:53+08:00

[INFO] ------------------------------------------------------------------------

[root@eclipse websimplemessage]#

To Run the websimplemessage Example

_1、In a web browser, enter the following URL:

http://localhost:8080/websimplemessage

_2、Enter a message in the text field and click Send Message.

If, for example, you enter "Hello, Duke", the following appears below the buttons:

Sent message: Message from producer: Hello, Duke

_3、Click Go to Receive Page.

_4、Click Receive Message.

The following appears below the buttons:

Reading message: Message from producer: Hello, Duke

_5、Click Send Another Message to return to the sending page.

_6、After you have finished running the application, undeploy it using either the Services tab of NetBeans IDE or the mvn cargo:undeploy command.


 


 

 

 


 


 


 


 

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5708339.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-17
下一篇 2022-12-17

发表评论

登录后才能评论

评论列表(0条)

保存