Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to integrate GlassFish in Eclipse

2025-04-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

Editor to share with you how to integrate GlassFish in Eclipse, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

First of all, download the v2 version. I downloaded GlassFish-installer-v2ur2-b04-windows-ml.jar. Then there is the installation. The installation of GlassFish is annoying and must be supported by jdk, so we first have to set the environment variable and set the path of java. Of course, we can also specify the path of java at installation time, such as me. He he

Go to the command line, change to the directory of GlassFish*.jar, and execute:

1) set path=D:\ bea920\ jdk150_04\ bin

2) java-Xmx256m-jar GlassFish-installer-v2ur2-b04-windows-ml.jar then License Agreement appears, drag the scroll bar to the bottom, and then click "Accept". GlassFish will be installed in the current directory, so we should select the installation directory in advance, and then copy the jar to this directory for installation.

3) because we need to use ant, if we don't have ant beforehand, we have to set ant first.

4) set the path to ant and execute it under the current directory: set path=D:\ bea920\ jdk150_04\ bin;D:\ GlassFish\ v2\ lib\ ant\ bin so that GlassFish comes with ant by default, so we can use it.

5) execute it under the current directory: ant-f setup.xml.

6) if the installation is correct, * * will display: BUILD SUCCESSFUL

In this way, our installation is complete. Of course, such installations are the default settings, and if we want to change some default settings, we can modify the setup.xml file before installation. Open the setup.xml file we can easily understand, according to their own needs can be modified.

-- name of default domain-instance name-administrator user name-administrator password-administrative console port-port of application instance

After the GlassFish installation is complete, we integrate it into eclipse, and I use myeclipse6.5. Select "Windows"-"Preferences"-"Servers"-"GlassFish 2x", select "Enable" on the right, and select the GlassFish directory that has just been installed in "Home Directory". Everything else is default. "JDK" just select the JDK setting used in eclipse. When you start GlassFish 2x, you can see some of the information printed by GlassFish at startup in the console of eclipse. When you see the following message, the server starts successfully:

Information: SMGT0007: self-management rule service enabled

2008-12-30 6:33:42 com.sun.enterprise.server.PEMain main

Information: the application server starts up.

Deploy an application, and if we are a war package, copy it to% GlassFish_HOME%/domains\ domain1\ autodeploy.

GlassFish is very similar to weblogic, if you are familiar with weblogic, then it must be easy to master GlassFish, directory structure, management methods are strikingly similar. Developing and deploying a web application on GlassFish is very easy, which is no different from that on tomcat. No matter what you do on tomcat, you can also do it on GlassFish.

Today is mainly about learning to develop and deploy JMS on GlassFish. First create the JMS resource. Http://localhost:4848/ logs in to the management console. Default user: admin password: adminadmin

Under the configuration menu, click Java message Services, select physical destination, click the New button, create a target, and enter: myQueueDes in the name. Select "javax.jms.Queue" and click "OK".

After creating the physical purpose of the number, we "Resources" menu, click "JMS Resources", create a connection factory, click "connection Factory", click "New" button, enter: jms/myCF, resource type, select "javax.jms.ConnectionFactory" in the "JNDI name". Other can be modified by default or according to your own needs, * Click "OK" to complete the creation of the JMS connection factory. Then click "destination Resource", create a new target, click the "New" button, enter: jms/myQueue in the "JNDI name", and enter the physical destination name we just created in the physical destination. Here is: myQueueDes, resource type selection: javax.jms.Queue

These are all the contents of the article "how to integrate GlassFish in Eclipse". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report