Cannot start my Spring application on tcServer from SpringTools

痴心易碎 提交于 2019-12-11 05:55:14

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/23266834/cannot-start-my-spring-application-on-tcserver-from-springtools

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!