0

I am trying to complete this introduction to java apps on IBM Bluemix:

github.com/IBM-Bluemix/get-started-java

When I get to step 4.4 'Run your application locally on Liberty' I get the following error message:

"Server Error: The selection did not contain any resources that can run on a server."

I have followed the guide step-by-step and this is the first issue I encounter. I am new to Bluemix, eclipse and Liberty, so I am not really sure where to look for the solution to this problem.

I have to restart eclipse to reproduce this problem since I only have the option of "Run as -> Run on Server" the first time I attempt.

EDIT:


This is where I click to "Run on server":

Trying to do step 4.1 - Run on server

This is the error:

Error message I get

Thanks for the answers, guys!

EDIT 2:


If I do "Run -> Run Configurations..." and select Liberty Server it looks like it goes through the same steps as when you run:

mvn install liberty:run-server

in the terminal. But if I do this and go to localhost:9080/GetStartedJava/ I get the following message:

Context Root Not Found

Does this help anyone as to the source of my problems?

Jonathan Hansen
  • 113
  • 1
  • 7
  • Did running the app locally from command line work properly (Step 2)? – F Rowe Apr 21 '17 at 13:41
  • I just tried these steps with no issues. One possibility is the maven import of get-started failed. You could try deleting the project from eclipse, checking the "Delete project contents on disk" option and re-importing, making certain to select the top-level directory of the project (get-started-java) – F Rowe Apr 21 '17 at 15:57
  • @FRowe Thank you for your answer. I have just completely reinstalled eclipse and followed the same guide again and I still get the same error. – Jonathan Hansen Apr 24 '17 at 13:17
  • @FRowe I have also deleted and imported the project. Running the app locally from command line works fine. – Jonathan Hansen Apr 24 '17 at 13:25
  • Can you post a screenshot of your Eclipse and tell us where you're right clicking? – Ram Vennam May 09 '17 at 18:10

2 Answers2

0

Try this. Right click on the Liberty server in the Servers view and select Add and Remove. Then, move the application from the left side to the right side. enter image description here

If you don't see your GetStartedJava project in your Add and Remove windows, then this is likely a problem with the Eclipse project import. A screenshot of your Eclipse window will help

Ram Vennam
  • 3,536
  • 1
  • 12
  • 19
  • I tried this, when I press "Add and Remove..." I get an error saying: "There are no resources that can be added or removed from the server.". – Jonathan Hansen May 17 '17 at 09:05
0

This question remained unanswered and I had the same issue;

File > Properties > Project Facets > Select Dynamic Web Module

Select OK

Right click on the server and select Add Remove and you should be able to add your WAR file there.

mharris
  • 16
  • 1
  • Thank you, @mharris! That got me a step further. I find eclipse extremely confusing, so I would never have figured that out. Now I get `Context Root Not Found` when I run the app on the server. There is loads of different questions about this out there, so I will investigate. – Jonathan Hansen Aug 10 '17 at 07:16
  • I still have some issues with this and I have a support query open with Bluemix. Make a change to the deployment, say the cloundant.properties file and then run the server and the change won't populate through. This is what leads to the Context Root Not Found error. The project doesn't export properly. – mharris Aug 11 '17 at 10:08
  • I have a workaround, which is to install with the mvn install liberty:run-server command. That will install the liberty server in the get-started-java project. Then when you add your server in Eclipse, link to this server (rather than installing a fresh one) and then you can start and stop it through eclipse. Unfortunately when you want to push your changes through, you will need to run the maven command again. It's a really ugly solution and I'm still waiting on a proper solution from IBM. – mharris Aug 11 '17 at 10:12
  • Thanks again, @mharris. Please share anything you get from Bluemix support - it really bugs me that I can't get this to work. – Jonathan Hansen Aug 16 '17 at 06:49