Skip to main content

[adopt-a-jsr] Re: Java EE 7 Samples

  • From: Mohamed Taman < >
  • To:
  • Subject: [adopt-a-jsr] Re: Java EE 7 Samples
  • Date: Sun, 24 Mar 2013 19:01:03 +0200

Hi Arun,

When I did as described remove all individual dependencies and just the JEE7 repo and API i got the following error.

-------------------------------------------------------------------------------
Test set: com.taman.rtrc.endpoint.data.LoginMessageTest
-------------------------------------------------------------------------------
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.228 sec <<< FAILURE!
testFromJSON(com.taman.rtrc.endpoint.data.LoginMessageTest)  Time elapsed: 0.028 sec  <<< ERROR!
javax.json.JsonException: Provider org.glassfish.json.JsonProviderImpl not found
at javax.json.spi.JsonProvider.provider(JsonProvider.java:97)
at javax.json.Json.createReader(Json.java:208)
at com.taman.rtrc.endpoint.data.LoginMessage.fromJSON(LoginMessage.java:44)
at com.taman.rtrc.endpoint.data.LoginMessageTest.testFromJSON(LoginMessageTest.java:32)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
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:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
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)
Caused by: java.lang.ClassNotFoundException: org.glassfish.json.JsonProviderImpl
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:188)
at javax.json.spi.JsonProvider.provider(JsonProvider.java:94)
... 32 more

I should add the following dependency to pass the tests normally 

<dependency>
            <groupId>org.glassfish</groupId>
            <artifactId>javax.json</artifactId>
            <version>1.0-SNAPSHOT</version>
        </dependency>

also after adding it and run tests doesn't pass throwing the following error:

-------------------------------------------------------------------------------
Test set: com.taman.rtrc.endpoint.server.RTRCServerTest
-------------------------------------------------------------------------------
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.039 sec <<< FAILURE!
com.taman.rtrc.endpoint.server.RTRCServerTest  Time elapsed: 0.052 sec  <<< ERROR!
java.lang.RuntimeException: Failed to load container provider class: org.glassfish.tyrus.container.grizzly.GrizzlyEngine
at org.glassfish.tyrus.server.ServerContainerFactory.create(ServerContainerFactory.java:95)
at org.glassfish.tyrus.server.Server.start(Server.java:120)
at com.taman.rtrc.endpoint.server.RTRCServerTest.setUpClass(RTRCServerTest.java:40)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
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:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
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)
Caused by: java.lang.ClassNotFoundException: org.glassfish.tyrus.container.grizzly.GrizzlyEngine
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:188)
at org.glassfish.tyrus.server.ServerContainerFactory.create(ServerContainerFactory.java:92)
... 24 more

Then I have to add the following dependency also:
       <dependency>
            <groupId>org.glassfish.tyrus</groupId>
            <artifactId>tyrus-container-grizzly</artifactId>
            <version>1.0-b12</version>
        </dependency> 

after run i got the following error

Mar 24, 2013 6:48:27 PM org.glassfish.tyrus.server.ServerContainerFactory create
INFO: Provider class loaded: org.glassfish.tyrus.container.grizzly.GrizzlyEngine
Mar 24, 2013 6:48:27 PM org.glassfish.grizzly.http.server.NetworkListener start
INFO: Started listener bound to [0.0.0.0:2020]
Mar 24, 2013 6:48:27 PM org.glassfish.grizzly.http.server.HttpServer start
INFO: [HttpServer] Started.
Mar 24, 2013 6:48:27 PM org.glassfish.tyrus.server.TyrusServerContainer stop
INFO: Closing down : org.glassfish.tyrus.server.TyrusEndpoint@539e922d
Mar 24, 2013 6:48:27 PM org.glassfish.grizzly.http.server.NetworkListener stop
INFO: Stopped listener bound to [0.0.0.0:2020]
Mar 24, 2013 6:48:27 PM org.glassfish.tyrus.server.TyrusServerContainer stop
INFO: Closing down : org.glassfish.tyrus.server.TyrusEndpoint@539e922d
Mar 24, 2013 6:48:27 PM org.glassfish.tyrus.server.Server stop
INFO: Websocket Server stopped.
Exception in thread "main" javax.websocket.DeploymentException: Class javax.websocket.server.ServerEndpointConfig$Configurator couldn't be instantiated

Server stopped.
at org.glassfish.tyrus.core.ErrorCollector.composeComprehensiveException(ErrorCollector.java:83)
at org.glassfish.tyrus.server.TyrusServerContainer.start(TyrusServerContainer.java:138)
at org.glassfish.tyrus.server.Server.start(Server.java:122)
at com.taman.rtrc.endpoint.server.RTRCServer.main(RTRCServer.java:98)
Java Result: 1

And when I changed all version to b13 I got the following error:

run:
Mar 24, 2013 6:52:03 PM org.glassfish.tyrus.server.ServerContainerFactory create
INFO: Provider class loaded: org.glassfish.tyrus.container.grizzly.GrizzlyEngine
Mar 24, 2013 6:52:03 PM org.glassfish.grizzly.http.server.NetworkListener start
INFO: Started listener bound to [0.0.0.0:2020]
Mar 24, 2013 6:52:03 PM org.glassfish.grizzly.http.server.HttpServer start
INFO: [HttpServer] Started.
Mar 24, 2013 6:52:04 PM org.glassfish.tyrus.server.TyrusServerContainer stop
INFO: Closing down : org.glassfish.tyrus.server.TyrusEndpoint@4110f319
Mar 24, 2013 6:52:04 PM org.glassfish.grizzly.http.server.NetworkListener stop
INFO: Stopped listener bound to [0.0.0.0:2020]
Mar 24, 2013 6:52:04 PM org.glassfish.tyrus.server.TyrusServerContainer stop
INFO: Closing down : org.glassfish.tyrus.server.TyrusEndpoint@4110f319
Server stopped.
Mar 24, 2013 6:52:04 PM org.glassfish.tyrus.server.Server stop
INFO: Websocket Server stopped.
Exception in thread "main" javax.websocket.DeploymentException: Text MessageHandler already registered.

at org.glassfish.tyrus.core.ErrorCollector.composeComprehensiveException(ErrorCollector.java:83)
at org.glassfish.tyrus.server.TyrusServerContainer.start(TyrusServerContainer.java:144)
at org.glassfish.tyrus.server.Server.start(Server.java:122)
at com.taman.rtrc.endpoint.server.RTRCServer.main(RTRCServer.java:98)
Java Result: 1


so could you please tell me the correct pom.xml file, attached is the old one could you modefy it with correct dependencies and send it back.

Regards

Mohamed Taman


On Sun, Mar 24, 2013 at 5:50 AM, Arun Gupta < " target="_blank"> > wrote:
Mohamed,

I'm getting the error:

[WARNING] The POM for org.glassfish:javax.json:jar:1.0-SNAPSHOT is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.801s
[INFO] Finished at: Sun Mar 24 04:48:23 CET 2013
[INFO] Final Memory: 5M/154M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project RTRC: Could not resolve dependencies for project com.taman.rtrc:RTRC:war:1.0-SNAPSHOT: Could not find artifact org.glassfish:javax.json:jar:1.0-SNAPSHOT -> [Help 1]

Instead of listing individual dependencies,can you specify the overall dependency as:

<repository> 
    <id>Java EE 7</id> 
    <url>https://maven.java.net/content/groups/promoted/</url>  
</repository>  
. . . 
<dependency>  
    <groupId>javax</groupId>  
    <artifactId>javaee-api</artifactId>  
    <version>7.0-b80</version>  
</dependency>


Thanks,
Arun


On 3/24/13 12:23 AM, Mohamed Taman wrote:
Hi Arun 
Try my Real Time Runners Champion example I have uploaded on Adopt-a-JSR on github.

Cheers
Mohamed Taman

Sent from my iPhone
I've got Belgian JUG Tic-Tac-Toe sample using JSR 356/WebSockets running on my machine. Awesome work guys!

Are there other Java EE 7 samples that I can have on my machine ? Would like to start showcasing them as part of my upcoming talks at several conferences.

Arun

--
http://twitter.com/arungupta
http://blogs.oracle.com/arungupta


-- 
http://twitter.com/arungupta
http://blogs.oracle.com/arungupta



--

 

Thanks & Best Regards

 

Improve your Life through Science and Art…”

Mohamed Mahmoud Taman

Business Solutions,

Systems Architect & Design Supervisor

Java Team Leader

| JCP (Java Community Process) Member

|Oracle Egypt Architects Club board member

| JavaOne & EG-JDC Speaker

| SCJP, SCWCD, OCP PL/SQL

                                                                                                         

e-finance,BLDG17, Smart Village,

KM 28 Cairo-Alex Desert Road,

Ground Floor, Giza, Egypt
Postal Code : 12577

( :  +(202) 3827 1422

(:   +(202) 3827 1499

(:   +(202) 3827 1599

È:  +(201) 00531 8017

P Before you print Think about Your ENVIRONMENTAL responsibility.

Attachment: pom.xml
Description: XML document



[adopt-a-jsr] Re: Java EE 7 Samples

(continued)

[adopt-a-jsr] Re: Java EE 7 Samples

Yosi Pramajaya 03/24/2013

[adopt-a-jsr] Re: Java EE 7 Samples

Hildeberto Mendonça 03/24/2013

[adopt-a-jsr] Re: Java EE 7 Samples

Yosi Pramajaya 03/24/2013

[adopt-a-jsr] Re: Java EE 7 Samples

Hildeberto Mendonça 03/24/2013

[adopt-a-jsr] Re: Java EE 7 Samples

Yosi Pramajaya 03/24/2013

[adopt-a-jsr] Re: Java EE 7 Samples

Hildeberto Mendonça 03/24/2013

[adopt-a-jsr] Re: Java EE 7 Samples

Arun Gupta 03/24/2013

[adopt-a-jsr] Re: Java EE 7 Samples

Yosi Pramajaya 03/24/2013

[adopt-a-jsr] Re: Java EE 7 Samples

Arun Gupta 03/24/2013

[adopt-a-jsr] Re: Java EE 7 Samples

Mohamed Taman 03/24/2013

[adopt-a-jsr] Re: Java EE 7 Samples

Mohamed Taman 03/24/2013

[adopt-a-jsr] Re: Java EE 7 Samples

Mani Sarkar 03/24/2013

[adopt-a-jsr] Re: Java EE 7 Samples

Yosi Pramajaya 03/25/2013

[adopt-a-jsr] Re: Java EE 7 Samples

Yosi Pramajaya 03/26/2013
 
 
Close
loading
Please Confirm
Close