Question

Unfortunately I am quite new to Spring development so cannot explain in great detail the problem but this is what I am having trouble with. I have an existing Spring application, it compiles and it works when deployed to tomcat 6 ether from Spring Tool Suite or via Maven goal. The problem is that I cannot start it on tcServer that comes with Spring Tool Suite in order to use Spring Insight (I would like to profile this application because there are some bottlenecks). I managed to add the server instance and start it but then when I tried to run the application on it I get this error:

Error: Could not find or load main class Spring

I don't have a clue what is happening and couldn't find anything about this error via google and I searched for hours. How could I remove this error and make it work?

Additional info: I am on Windows 64 bit and using 64 bit JDK 7 JRE 7 Suggested by comment : sts-3.5.0.RELEASE, vfabric-tc-server-developer-2.9.5.SR1 New findings: I have tested this same setup on Linux machine with same project and don't get that annoying exception. Would still like to know why it happens on windows although the answer about the work around with starting server outside Sts helped greatly.

Was it helpful?

Solution

Try this outside STS.

  1. Get the .war file just like the one you tested in Tomcat

  2. Open a new Command Prompt window but open it with "Run as administrator"

  3. Change directory to vfabric-tc-server-developer-2.9.5.SR1 folder

  4. Run vfabric-tc-server-developer-2.9.5.SR1>tcruntime-instance.bat create -t insight test_spring_insight. This creates a tc Server instance with the "insight" template.

  5. Copy your .war file to vfabric-tc-server-developer-2.9.5.SR1\test_spring_insight\webapps

  6. Run vfabric-tc-server-developer-2.9.5.SR1>tcruntime-ctl.bat test_spring_insight install. This installs the tc Server instance as a service.

  7. Run vfabric-tc-server-developer-2.9.5.SR1>tcruntime-ctl.bat test_spring_insight start. This starts the tc Server instance.

Now you should be able to access the insight app at http://localhost:8080/insight.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top