【Arquillian】Incorrect Summary

来源:互联网 发布:js正则匹配指定字符串 编辑:程序博客网 时间:2024/06/05 20:51

        For recently vincent had done any research for Arquillian about EJB Unit Test,During this progress, i encountered and resolved some problems, so i decided to record them. 

         Firstly:About Jboss Set Up

        (1)ERROR [org.jboss.remoting.remote.connection] (Remoting "desktop-amafbol:MANAGEMENT" read-1) JBREM000200: Remote connection failed: java.io.IOException: 你的主机中的软件中止了一个已建立的连接。

        solution: Restart your jboss server, maybe you had start the jboss server already. And maybe this fault is because the prot has been occupancied.

        

        (2)ERROR [org.hibernate.tool.hbm2ddl.SchemaExport] (ServerService Thread Pool -- 48) HHH000389: Unsuccessful: drop sequence hibernate_sequence. ERROR [org.hibernate.tool.hbm2ddl.SchemaExport] (ServerService Thread Pool -- 48) Sequence "HIBERNATE_SEQUENCE" not found; SQL statement:

        solution: maybe the jar file downloaded failed, check out your  local maven respoitory, see if the jar is completed. Besided, checkout the pom.xml about the <dependencies>,see if there's any spell fault or version fault.


       (3)about pom's dependency version

[INFO] Scanning for projects...[ERROR] [ERROR] Some problems were encountered while processing the POMs:[ERROR] 'build.plugins.plugin.version' for org.jboss.as.plugins:jboss-as-maven-plugin must be a valid version but is '${version.jboss.maven.plugin}'. @ com.dynamic:itoo-cloud-dictionary-core:[unknown-version], D:\eclipse\itoo-cloud-dictionary-core\pom.xml, line 234, column 14 @ [ERROR] The build could not read 1 project -> [Help 1][ERROR]   [ERROR]   The project com.dynamic:itoo-cloud-dictionary-core:0.0.1-SNAPSHOT (D:\eclipse\itoo-cloud-dictionary-core\pom.xml) has 1 error[ERROR]     'build.plugins.plugin.version' for org.jboss.as.plugins:jboss-as-maven-plugin must be a valid version but is '${version.jboss.maven.plugin}'. @ com.dynamic:itoo-cloud-dictionary-core:[unknown-version], D:\eclipse\itoo-cloud-dictionary-core\pom.xml, line 234, column 14
       Solution: look at here that shows the 'org.jboss.as.plugins:jboss-as-maven-plugin''s version is not match, i should user the certain version to show in the dependency.and not only about the plugins,but also the <dependency> elements.

   

     (4) Failure to transfer org.apache.maven.plugins:maven-surefire-plugin:pom:${version.maven.surefire} from http://192.168.22.246:8081/nexus/content/groups/

 dynamic-public was cached in the local repository, resolution will not be reattempted until the update interval of nexus has elapsed or updates are forced. 
 Original error: Could not transfer artifact org.apache.maven.plugins:maven-surefire-plugin:pom:${version.maven.surefire} from/to nexus (http://
 192.168.22.246:8081/nexus/content/groups/dynamic-public): Illegal character in path at index 111: http://192.168.22.246:8081/nexus/content/groups/dynamic-
 public/org/apache/maven/plugins/maven-surefire-plugin/${version.maven.surefire}/maven-surefire-plugin-${version.maven.surefire}.pom
“Failure to transfer * from * was cached in the local repository”

       Solution: please reference  http://stackoverflow.com/questions/5074063/maven-error-failure-to-transfer  at stackoverflow ,there's two command two solve it.

cd %userprofile%\.m2\repository
for /r %i in (*.lastUpdated) do del %i
       as for why, u can reference that link.  


     Secondly:About Container

      (1)java.lang.NoSuchFieldError:TRACE

四月 09, 2017 12:19:55 下午 org.jboss.as.arquillian.container.managed.ManagedDeployableContainer startInternal警告: Bundles path is deprecated and no longer used.四月 09, 2017 12:19:55 下午 org.jboss.as.arquillian.container.managed.ManagedDeployableContainer startInternal信息: Starting container with: [D:\jdk1.8.0_25\bin\java, -D[Standalone], -Xms64m, -Xmx512m, -Djava.net.preferIPv4Stack=true, -Djava.awt.headless=true, -Djboss.modules.system.pkgs=org.jboss.byteman, -ea, -Djboss.home.dir=D:\jboss-eap-7.0.0, -Dorg.jboss.boot.log.file=D:\jboss-eap-7.0.0\standalone\log\server.log, -Dlogging.configuration=file:D:\jboss-eap-7.0.0\standalone\configuration\logging.properties, -jar, D:\jboss-eap-7.0.0\jboss-modules.jar, -mp, D:\jboss-eap-7.0.0\modules, org.jboss.as.standalone, -Djboss.home.dir=D:\jboss-eap-7.0.0, -Djboss.server.base.dir=D:\jboss-eap-7.0.0\standalone, -Djboss.server.log.dir=D:\jboss-eap-7.0.0\standalone\log, -Djboss.server.config.dir=D:\jboss-eap-7.0.0\standalone\configuration]java.lang.NoSuchFieldError: TRACE    at org.jboss.logging.Log4jLogger.translate(Log4jLogger.java:60)    at org.jboss.logging.Log4jLogger.isEnabled(Log4jLogger.java:35)    at org.jboss.logging.Logger.logf(Logger.java:2397)    at org.jboss.logging.DelegatingBasicLogger.tracef(DelegatingBasicLogger.java:124)    at org.jboss.as.protocol.mgmt.AbstractMessageHandler.registerActiveOperation(AbstractMessageHandler.java:404)    at org.jboss.as.protocol.mgmt.AbstractMessageHandler.registerActiveOperation(AbstractMessageHandler.java:353)    at org.jboss.as.protocol.mgmt.ManagementChannelHandler.executeRequest(ManagementChannelHandler.java:109)    at org.jboss.as.controller.client.impl.AbstractModelControllerClient.executeRequest(AbstractModelControllerClient.java:263)    at org.jboss.as.controller.client.impl.AbstractModelControllerClient.execute(AbstractModelControllerClient.java:168)    at org.jboss.as.controller.client.impl.AbstractModelControllerClient.executeForResult(AbstractModelControllerClient.java:147)    at org.jboss.as.controller.client.impl.AbstractModelControllerClient.execute(AbstractModelControllerClient.java:75)    at org.jboss.as.arquillian.container.ManagementClient.isServerInRunningState(ManagementClient.java:255)    at org.jboss.as.arquillian.container.managed.ManagedDeployableContainer.startInternal(ManagedDeployableContainer.java:147)    at org.jboss.as.arquillian.container.CommonDeployableContainer.start(CommonDeployableContainer.java:115)    at org.jboss.arquillian.container.impl.ContainerImpl.start(ContainerImpl.java:199)    at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController$8.perform(ContainerLifecycleController.java:163)    at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController$8.perform(ContainerLifecycleController.java:157)    at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController.forContainer(ContainerLifecycleController.java:255)    at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController.startContainer(ContainerLifecycleController.java:156)    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)    at java.lang.reflect.Method.invoke(Method.java:483)    at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:96)    at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)    at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)    at org.jboss.arquillian.container.impl.client.ContainerDeploymentContextHandler.createContainerContext(ContainerDeploymentContextHandler.java:57)    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)    at java.lang.reflect.Method.invoke(Method.java:483)    at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:96)    at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)    at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:145)    at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:116)    at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)    at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController$2.perform(ContainerLifecycleController.java:77)    at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController$2.perform(ContainerLifecycleController.java:70)    at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController.forEachSuiteContainer(ContainerLifecycleController.java:221)    at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController.startSuiteContainers(ContainerLifecycleController.java:69)    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)    at java.lang.reflect.Method.invoke(Method.java:483)    at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:96)    at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)    at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)    at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:145)    at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:116)    at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)    at org.jboss.arquillian.container.test.impl.client.ContainerEventController.execute(ContainerEventController.java:86)    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)    at java.lang.reflect.Method.invoke(Method.java:483)    at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:96)    at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)    at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)    at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:73)    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)    at java.lang.reflect.Method.invoke(Method.java:483)    at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:96)    at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)    at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:145)    at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:116)    at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.beforeSuite(EventTestRunnerAdaptor.java:75)    at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:116)    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)

     As the error info, we know that the Container's lifecycle has mistake , Could not start container. To solve this question, i had added a <build> element in the pom,besides, i think the version's difference in the reason leaded this problem.


      About  Environment

      (1)D:\eclipse\itoo-cloud-dictionary-web\target\m2e-wtp\web-resources\META-INF\MANIFEST.MF (系统找不到指定的路径).

        we click "eclipse-->Project-->Clean" you can select below's. For why we encounter this problem, we should reference this: 

        http://stackoverflow.com/questions/14659891/m2e-wtp-error-path-target-m2e-wtp-web-resources-meta-inf-manifest-mf-no-such


      (2) the error info shows that the source 1.6 can't match the diamond operator:

[ERROR] COMPILATION ERROR : [INFO] -------------------------------------------------------------[ERROR] \eclipse\itoo-cloud-dictionary-core\src\main\java\com\tgb\itoo\cloud\eao\impl\DictionaryEaoImpl.java:[54,49] 错误: -source 1.6 中不支持 diamond 运算符[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project itoo-cloud-dictionary-core: Compilation failure[ERROR] \eclipse\itoo-cloud-dictionary-core\src\main\java\com\tgb\itoo\cloud\eao\impl\DictionaryEaoImpl.java:[54,49] 错误: -source 1.6 中不支持 diamond 运算符
       and another error info like:

'<>' operator is not allowed for source level below 1.7
        So i can understand maybe i set the jdk edition by the pom file's <dependency> jdk below 1.7 such like 1.6 edition. as u know, there has two settings for jdk edition, click "windows-->preference-->java-->JDK Compliance" to set the edition. besides select "java-->Installed JREs" to keep same.

        Java compiler level does not match the version of the installed Java project facet.


      (3) Fragment "/common.jsp" was not found at expected path /itoo-cloud-dictionary-web/src/main/webapp/common.jsp

      and for this is a very common question, the solution is that select the project then right-click choose "property", and click "Target Runtimes", choose "JBoss EAP 6.1+ Runtime".


      (4)when i execute "clean" command to ear:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project jboss-kitchensink-ear-ejb: There are test failures.[ERROR] [ERROR] Please refer to C:\Users\vincent\Desktop\kitchensink-ear\ejb\target\surefire-reports for the individual test results.[ERROR] -> [Help 1][ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.[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 read the following articles:[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException[ERROR] [ERROR] After correcting the problems, you can resume the build with the command[ERROR]   mvn <goals> -rf :jboss-kitchensink-ear-ejb
        Solution: i added the plugins in the <build> element:

<plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-surefire-plugin</artifactId><configuration><testFailureIgnore>true</testFailureIgnore></configuration></plugin>


      About  Arquillian itself

     (1)Arquillian JPA tutorial: Could not create new instance of class org.jboss.arquillian.test.impl.EventTestRunnerAdaptor

       Perhapse you don't know that this is the most difficult problem i had encounted. The pom.xml of the project has some of the profiles like arquillian-weld-ee-embedded, arquillian-glassfish-embedded, and arquillian-jbossas-managed.and none of them is active by default,so to make the Arquillian container workable,you need to make any of these profile default.  

       During this progress, i reference this: http://stackoverflow.com/questions/18931491/arquillian-jpa-tutorial-could-not-create-new-instance-of-class-org-jboss-arquil#comment30236765_18931491  (nearly all the message comes froms stackoverflow) to change my preference like this:

<profiles>    <profile>        <id>arquillian-jbossas-embedded</id>        <activation>   //这里加入了激活属性的标签            <activeByDefault>true</activeByDefault>        </activation>        <dependencies>            <dependency>                <groupId>org.jboss.spec</groupId>                <artifactId>jboss-javaee-6.0</artifactId>                <version>1.0.0.Final</version>                <type>pom</type>                <scope>provided</scope>            </dependency>            <dependency>                <groupId>org.jboss.arquillian.container</groupId>                <artifactId>arquillian-weld-ee-embedded-1.1</artifactId>                <version>1.0.0.CR7</version>            </dependency>            <dependency>                <groupId>org.jboss.weld</groupId>                <artifactId>weld-core</artifactId>                <version>2.1.0.Final</version>                <scope>test</scope>            </dependency>            <dependency>                <groupId>org.slf4j</groupId>                <artifactId>slf4j-simple</artifactId>                <version>1.6.4</version>                <scope>test</scope>            </dependency>        </dependencies>    </profile>    <profile>        <id>arquillian-jbossas-managed</id>        <dependencies>            <dependency>                <groupId>org.jboss.spec</groupId>                <artifactId>jboss-javaee-6.0</artifactId>                <version>1.0.0.Final</version>                <type>pom</type>                <scope>provided</scope>            </dependency>            <dependency>            <groupId>org.jboss.as</groupId>            <artifactId>jboss-as-arquillian-container-managed</artifactId>                <version>7.1.1.Final</version>                <scope>test</scope>            </dependency>            <dependency>                <groupId>org.jboss.arquillian.protocol</groupId>                <artifactId>arquillian-protocol-servlet</artifactId>                <scope>test</scope>            </dependency>        </dependencies>    </profile></profiles>


    (2)"No org.jboss.arquillian.container.spi.client.protocol.metadata.HTTPContext found in org.jboss.arquillian.container.spi.client.protocol.metadata.ProtocolMetaData."
java.lang.IllegalArgumentException: No org.jboss.arquillian.container.spi.client.protocol.metadata.HTTPContext found in org.jboss.arquillian.container.spi.client.protocol.metadata.ProtocolMetaData. Servlet protocol can not be usedat org.jboss.arquillian.protocol.servlet.BaseServletProtocol.getExecutor(BaseServletProtocol.java:65)at org.jboss.arquillian.protocol.servlet.BaseServletProtocol.getExecutor(BaseServletProtocol.java:35)at org.jboss.arquillian.container.test.impl.execution.RemoteTestExecuter.getContainerMethodExecutor(RemoteTestExecuter.java:118)at org.jboss.arquillian.container.test.impl.execution.RemoteTestExecuter.execute(RemoteTestExecuter.java:108)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)at java.lang.reflect.Method.invoke(Method.java:483)at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:145)at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:116)at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)at org.jboss.arquillian.container.test.impl.execution.ClientTestExecuter.execute(ClientTestExecuter.java:57)
       Solution1: Reference:  https://developer.jboss.org/message/883328   by using others dependency files.

       Solution2: http://stackoverflow.com/questions/17824754/arquillian-no-httpcontext-found-when-launching-in-embedded-weld-ee-container to delete the "<defaultProtocol type="Servlet 3.0" />" because servlet3.0 is incompatible with the eap container.

       Solution3: pay attention "the embedded Weld EE container does not support the Servlet 3.0 protocol" to change the container is a better choice.

       However i solve this problem by solution2.


       And finally:


       it's succeed.

0 0