类写的绝对没有问题 ,main 方法也没有任何问题 ,使用自己安装的 JDK JRE 命令行执行也没有问题。
但是在eclipse 3.6中则不行,没办法调试也没没发执行 抛出上面的异常。eclipse 编译生成了class文件,但是无论采用eclipse 的jre 还是 选择自己安装的jre 都无法执行 。
另外一个eclipse3.2 则可以 。 两个eclipse ini文件配置相同。请问一下谁遇到过这种错误么,我必须要使用 报错的那个eclipse3.6 因为必须支持 TOMCATE7
但是在eclipse 3.6中则不行,没办法调试也没没发执行 抛出上面的异常。eclipse 编译生成了class文件,但是无论采用eclipse 的jre 还是 选择自己安装的jre 都无法执行 。
另外一个eclipse3.2 则可以 。 两个eclipse ini文件配置相同。请问一下谁遇到过这种错误么,我必须要使用 报错的那个eclipse3.6 因为必须支持 TOMCATE7
解决方案 »
- jsp 连接数据库的问题
- 现在学习SSH框架,请大家推荐个高效的开源项目来学习!
- Axis做WS开发,如何使用代理?
- hibernate继承映射的问题
- lomboz的疑惑!!!!
- 我到BEA网站注册之后怎么找不到weblogic下载的地方???
- 集,关于EJB的事务处理中的隔离级别
- 学习EJB中遇到了几个很困惑我的问题,诚心向高手请教!
- Java in a Nutshell,2nd Edition 的电子版何处可以download?(英文的也可以)
- ajax局部刷新,在页面顶部填写用户名密码,成功转换成用户名+欢迎,不能跳转,求解决,或者给个新的方法
- maven vm spring 版本冲突 eclipse一系列问题,求大牛解答
- 求领航致远OA源代码。。。。。。。。。。。。。。。。
3.6不行的。。3.6 和3.2的另外一个区别是 3.6装了maven插件
Some Maven plugins may not work when importing projects or updating source folders.装了maven 一直报这个错误,我把这个错误解决了, 就是让 eclipse 运行在 jdk 中 ,结果之前的问题也好了
jre是运行环境,只能运行编译好的java class。jdk是开发环境,支持将java源代码编译为class文件。既然你要用Eclipse做开发,必然应该给它配好JDK。
我QQ 251021539
Test set: edu.hzsf.storm.dal.dao.daoibatis.UserDAOTest
-------------------------------------------------------------------------------
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 3.562 sec <<< FAILURE!
testGetUser(edu.hzsf.storm.dal.dao.daoibatis.UserDAOTest) Time elapsed: 3.472 sec <<< ERROR!
java.lang.NoSuchMethodError: org.springframework.core.MethodParameter.getParameterAnnotations()[Ljava/lang/Object;
at org.springframework.beans.factory.config.DependencyDescriptor.getAnnotations(DependencyDescriptor.java:203)
at org.springframework.beans.factory.annotation.QualifierAnnotationAutowireCandidateResolver.isAutowireCandidate(QualifierAnnotationAutowireCandidateResolver.java:106)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.isAutowireCandidate(DefaultListableBeanFactory.java:377)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.isAutowireCandidate(DefaultListableBeanFactory.java:364)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:670)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:610)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByType(AbstractAutowireCapableBeanFactory.java:1076)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:982)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireBeanProperties(AbstractAutowireCapableBeanFactory.java:329)
at org.springframework.test.AbstractDependencyInjectionSpringContextTests.injectDependencies(AbstractDependencyInjectionSpringContextTests.java:208)
at org.springframework.test.AbstractDependencyInjectionSpringContextTests.prepareTestInstance(AbstractDependencyInjectionSpringContextTests.java:183)
at org.springframework.test.AbstractSingleSpringContextTests.setUp(AbstractSingleSpringContextTests.java:103)
at junit.framework.TestCase.runBare(TestCase.java:132)
at org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCase.java:79)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at junit.framework.TestSuite.runTest(TestSuite.java:243)
at junit.framework.TestSuite.run(TestSuite.java:238)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:53)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:123)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:104)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110)
at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:175)
at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcessWhenForked(SurefireStarter.java:107)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:68)
1. 我不用maven 管理的项目 , Se项目 可以正常运行,用maven 管理的为本项目 ,我在俩面弄了个main函数都就跑不了
2.如果是eclipse的问题 ,那么我用mvn test 的时候 编译和运行 是使用的哪个JDK 和JRE ,MAVEN 插件还是环境变量配置的?
3.JDK 里面的 jre 与 和jdk 同一目录下的jre 的区别在哪
顺便说下:“3.JDK 里面的 jre 与 和jdk 同一目录下的jre 的区别在哪。” 这个区别不大,但JDK重要的是bin目录,我们所说的JDK都是指bin目录的上级目录。另一个我认为比较大的问题,是你若干个项目所用的Spring包,版本应该是不一样的。而Eclipse中所安装maven插件只能支持其中的一个版本,具体是什么版本,应该能从maven的帮助信息或什么地方查的到。
Test set: edu.hzsf.storm.dal.dao.daoibatis.UserDAOTest
-------------------------------------------------------------------------------
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.02 sec <<< FAILURE!
warning(junit.framework.TestSuite$1) Time elapsed: 0.015 sec <<< FAILURE!
junit.framework.AssertionFailedError: No tests found in edu.hzsf.storm.dal.dao.daoibatis.UserDAOTest
at junit.framework.Assert.fail(Assert.java:47)
at junit.framework.TestSuite$1.runTest(TestSuite.java:97)
at junit.framework.TestCase.runBare(TestCase.java:134)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at junit.framework.TestSuite.runTest(TestSuite.java:243)
at junit.framework.TestSuite.run(TestSuite.java:238)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:53)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:123)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:104)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110)
at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:175)
at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcessWhenForked(SurefireStarter.java:107)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:68)
找到原因了 maven项目忘了 mvn eclipse:eclipse 了
版权所有 (c) 2009 Microsoft Corporation。保留所有权利。C:\Users\meran>d:D:\>cd worspace
系统找不到指定的路径。D:\>cd workD:\work>cd workspaceD:\work\workspace> cd stormD:\work\workspace\storm>mvn test -e
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for
edu.hzsf:storm:war:0.0.1-SNAPSHOT
[WARNING] 'dependencies.dependency.systemPath' for com.sun:tools:jar should use
a variable instead of a hard-coded path C:/Program Files/Java/jdk1.6.0_18/lib/to
ols.jar @ line 156, column 23
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-comp
iler-plugin is missing. @ line 166, column 9
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten t
he stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support buildin
g such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building storm Maven Webapp 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ storm ---
[debug] execute contextualize
[WARNING] Using platform encoding (GBK actually) to copy filtered resources, i.e
. build is platform dependent!
[INFO] Copying 10 resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ storm ---
[WARNING] File encoding has not been set, using platform encoding GBK, i.e. buil
d is platform dependent!
[INFO] Compiling 29 source files to D:\work\workspace\storm\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] \work\workspace\storm\src\main\java\edu\hzsf\storm\dal\dao\BaseTestCase.
java:[6,7] 无法访问 junit.framework.TestCase
未找到 junit.framework.TestCase 的类文件
public class BaseTestCase extends AbstractDependencyInjectionSpringContextTests{[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.949s
[INFO] Finished at: Sat Feb 18 11:25:50 CST 2012
[INFO] Final Memory: 8M/20M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.
3.2:compile (default-compile) on project storm: Compilation failure
[ERROR] \work\workspace\storm\src\main\java\edu\hzsf\storm\dal\dao\BaseTestCase.
java:[6,7] 无法访问 junit.framework.TestCase
[ERROR] 未找到 junit.framework.TestCase 的类文件
[ERROR] public class BaseTestCase extends AbstractDependencyInjectionSpringConte
xtTests{
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal o
rg.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on
project storm: Compilation failure
\work\workspace\storm\src\main\java\edu\hzsf\storm\dal\dao\BaseTestCase.java:[6,
7] 无法访问 junit.framework.TestCase
未找到 junit.framework.TestCase 的类文件
public class BaseTestCase extends AbstractDependencyInjectionSpringContextTests{
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:213)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
ct(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
ct(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBu
ild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl
eStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun
cher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav
a:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La
uncher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:
352)
Caused by: org.apache.maven.plugin.CompilationFailureException: Compilation fail
ure
\work\workspace\storm\src\main\java\edu\hzsf\storm\dal\dao\BaseTestCase.java:[6,
7] 无法访问 junit.framework.TestCase
未找到 junit.framework.TestCase 的类文件
public class BaseTestCase extends AbstractDependencyInjectionSpringContextTests{
at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompiler
Mojo.java:656)
at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:128)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Default
BuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:209)
... 19 more
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureExc
eption
'cmd' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
D:\work\workspace\storm>^Ah这个你看看啊 。这个也解决了 那个帖子的分也都给你了啊
java:[6,7] 无法访问 junit.framework.TestCase
未找到 junit.framework.TestCase 的类文件检查下你maven的启动脚本 或 配置,是不是在CLASSPATH里面漏了 junit 的JAR包?