SpringSource工具套件 - 无法运行Spring模板项目

时间:2011-11-03 05:37:11

标签: spring sts-springsourcetoolsuite springsource tcserver

我正在尝试使用SpringSource Tool Suite了解Spring。在这个阶段,我没有太多成功经验。

到目前为止,我已经能够安装STS并创建一个新项目,但还没有进一步深入。在tc服务器上运行应用程序时似乎会出现此问题。我将完成我所采取的步骤,也许有人可以指出我哪里出错了。为了记录,我正在使用Ubuntu 11.10。

  • 我使用this link安装了STS,我在上面找到了 SpringSource工具套件下载页面。
  • 在安装STS期间,我选择安装在我的主文件夹中 /家庭/路/ SpringSource的。我留下了所有选中的包: SpringSource Tool Suite 2.8.0.RELEASE; vFabric tc服务器 2.6.1.RELEASE; Spring Roo 1.1.5.RELEASE; Apache Maven 3.0.3
  • 选择JDK路径时,我选择了/ usr / lib / jvm / default-java 链接到/ usr / lib / jvm / java-6-openjdk。
  • 安装成功完成,我手动启动STS 转到安装目录 /home/luke/springsource/sts-2.8.0.RELEASE并执行文件STS。 尽管检查了盒子,我还是必须这样才能让STS运行 现在在安装结束时运行STS(不确定这是否真实 问题,但认为值得一提。)。
  • 我选择了我的工作区 /home/luke/Documents/workspace-sts-2.8.0.RELEASE并单击确定。所以 那么好吗?
  • 在信息中心中,我点击创建>春天模板项目。
  • 在下面的对话框中,我单击Spring MVC Project并单击Next, 然后同意下载。
  • 在“项目设置”对话框中,我为项目命名为springmvc, 和一个有效的顶级包,然后单击Finish。
  • 我现在可以在Package Explorer中看到我新创建的项目了 以及Servers文件夹,以及VMware vFabric tc Server Developer 服务器窗口中的v2.6版。
  • 我将项目拖到服务器窗口和项目中的服务器上 出现[同步]状态。然后我右键单击 在Package Explorer中单击项目,然后单击Run As>在服务器上运行。 上面提到的服务器已经选中,所以我点击Next。该 我创建的项目位于下一个屏幕的Configured部分,所以 我点击完成。我被问到是否要使用Spring Insight,所以我点击了 是的,服务器启动。

这就是大麻烦开始的地方。

  • 我得到以下输出到控制台和一条404消息 浏览器窗口,指向http://localhost:8080/springmvc/

控制台输出:

Nov 3, 2011 4:21:29 PM com.springsource.tcserver.security.PropertyDecoder <init>
INFO: tc Runtime property decoder using memory-based key
Nov 3, 2011 4:21:30 PM com.springsource.tcserver.security.PropertyDecoder <init>
INFO: tcServer Runtime property decoder has been initialized in 924 ms
Nov 3, 2011 4:21:32 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Nov 3, 2011 4:21:32 PM com.springsource.tcserver.serviceability.rmi.JmxSocketListener init
INFO: Started up JMX registry on 127.0.0.1:6969 in 368 ms
Nov 3, 2011 4:21:32 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 3809 ms
Nov 3, 2011 4:21:32 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Nov 3, 2011 4:21:32 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: VMware vFabric tc Runtime 2.6.1.RELEASE/7.0.20.B.RELEASE
Nov 3, 2011 4:21:32 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor springmvc.xml from /home/luke/springsource/vfabric-tc-server-developer-2.6.1.RELEASE/spring-insight-instance/conf/Catalina/localhost
Nov 3, 2011 4:21:33 PM org.apache.catalina.startup.SetContextPropertiesRule begin
WARNING: [SetContextPropertiesRule]{Context} Setting property 'source' to 'org.eclipse.jst.jee.server:springmvc' did not find a matching property.
Nov 3, 2011 4:21:33 PM com.springsource.insight.collection.tcserver.ltw.TomcatWeavingInsightClassLoader start
INFO: Context [localhost|springmvc] will not be woven
Nov 3, 2011 4:21:34 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Error configuring application listener of class org.springframework.web.context.ContextLoaderListener
java.lang.NoClassDefFoundError: org/springframework/context/ApplicationContextException
    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Class.java:2406)
    at java.lang.Class.getConstructor0(Class.java:2716)
    at java.lang.Class.newInstance0(Class.java:343)
    at java.lang.Class.newInstance(Class.java:325)
    at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:119)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4660)
    at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5226)
    at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5221)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
    at java.util.concurrent.FutureTask.run(FutureTask.java:166)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:679)
Caused by: java.lang.ClassNotFoundException: org.springframework.context.ApplicationContextException
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1678)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1523)
    ... 14 more
Nov 3, 2011 4:21:34 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Skipped installing application listeners due to previous error(s)
Nov 3, 2011 4:21:34 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error listenerStart
Nov 3, 2011 4:21:34 PM org.apache.catalina.util.SessionIdGenerator createSecureRandom
INFO: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [227] milliseconds.
Nov 3, 2011 4:21:34 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/springmvc] startup failed due to previous errors
Nov 3, 2011 4:21:34 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor insight.xml from /home/luke/springsource/vfabric-tc-server-developer-2.6.1.RELEASE/spring-insight-instance/conf/Catalina/localhost
Nov 3, 2011 4:21:41 PM com.springsource.insight.collection.tcserver.ltw.TomcatWeavingInsightClassLoader start
INFO: Context [localhost|insight] will not be woven
Nov 3, 2011 4:21:42 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Nov 3, 2011 4:22:00 PM org.apache.jasper.compiler.TldLocationsCache tldScanJar
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
Nov 3, 2011 4:22:11 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring FrameworkServlet 'Spring MVC Dispatcher Servlet'
Nov 3, 2011 4:22:18 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory manager
Nov 3, 2011 4:22:18 PM com.springsource.insight.collection.tcserver.ltw.TomcatWeavingInsightClassLoader start
INFO: Context [localhost|manager] will not be woven
Nov 3, 2011 4:22:18 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory ROOT
Nov 3, 2011 4:22:18 PM com.springsource.insight.collection.tcserver.ltw.TomcatWeavingInsightClassLoader start
INFO: Context [localhost|ROOT] will not be woven
Nov 3, 2011 4:22:18 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Nov 3, 2011 4:22:19 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 46286 ms

任何帮助解读这个,找出解决方案并指出我在这里看起来像一个非常简单的STS用例的错误,将不胜感激。

2 个答案:

答案 0 :(得分:4)

同上拉尔夫。

选择了顶级项目,转到

Run As > Maven Clean  
Run As > Maven Install  
Run As > Run on Server  

它正确地完成了。我不知道为什么它首先失败了,或者为什么安装它两次修复它。

答案 1 :(得分:3)

看起来Project未正确部署到服务器。 服务器的上下文菜单包含一个清除它的选项。清理后,使用相同的上下文菜单并发布应用程序。 然后再试一次。

(此问题的另一个原因可能是编译器出现故障。)