Eclipse -> Run as -> Run on server - How to get it to work with JBoss?

23,755

Solution 1

First of all, check if you have JBoss Tools installed in your Eclipse IDE. You can find them here.

By default JBoss AS Adapter uses .metadata/.plugins/org.jboss.ide.eclipse.as.core/JBoss-AS-5.1.0.GA/deploy folder to deploy your project and then register this temp folder in JBoss. In other words, if you are starting JBoss AS from Eclipse, you have to deploy your project to this directory.

You can try this (taken from JBoss community site), helped me too:

  1. Server configuration (in Servers view in your Eclipse IDE)

  2. Deployment > "Use the JBoss Deploy folder"

  3. Save Server configuration

  4. Select your project on server and make a "Ful Publish" using project context menu

  5. Start server

If you have everything configured correctly, the "add and remove" method from the previous answer should be working, too...

Let me know, if you got it working.

Solution 2

I would recommend another approach. First Build both projects in eclipse (right click on project -> Build), then left click on your server -> Add and Remove ... and check if both projects are added. Now you can use Run on server or Publish in server context menu.

If there will be still no progress, try to undeploy your projects from JBoss which were Exported to autodeploy directory.

Share:
23,755
nyxz
Author by

nyxz

Updated on July 29, 2020

Comments

  • nyxz
    nyxz almost 4 years

    I use Eclipse Juno and I've made 2 projects:

    • One of them is actually a EAR containing an EJB project and a project to hold only the interfaces for the EJBs. I deploy it on the server by going to the:
      EAR Project -> Export -> Java EE -> EAR file
      and in the destination box I set the auto-deploy folder of the server (which is JBoss AS 6). Then the project is deployed and the EJBs are initialized.
    • The second project is a simple WAR project depending on the project holding the interfaces. In it I have a dummy servlet calling the EJBs. The procedure of deploying is almost the same. The difference is that I choose WEB -> WAR file in the export navigation menu. After the WAR is deployed everything works fine.

    Now the reason I do the whole "Export" thing is because the Run as -> Run on server does not build and deploy my projects. I thought that is its primary goal. Am I wrong? Is there a way to make this command work as I expected it to? I think it worked this way with Tomcat and web projects...

    I know this could be easily done by build script but that is not my point!

    Thanks in advance for your help and suggestions.

  • klimpond
    klimpond almost 11 years
    Are you getting some error in server or eclipse log? Or the project is just not available?
  • nyxz
    nyxz almost 11 years
    Thank you. This is just what I needed. It works like a charm.
  • Smajl
    Smajl almost 11 years
    No problem, glad I could help :-)
  • Paweł Dulęba
    Paweł Dulęba about 9 years
    I was trying to find this Deployment section (No. 2) for some time. It is small tab - shown in this topic
  • med_alpa
    med_alpa over 7 years
    @Smajl Is it possible to deploy the last builded ear with a custom profile? I tried the 3 options of deployment. the ear deployed is not the same as the one generated by "mvn install -PsomeProfile" (someProfile includes specific files like persistence.xml and application.xml). I think that the only way would be to use jboss-as:deploy goal instead of "run on server".