Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

Java EE 6, JAX-RS as EJB beans

 
Ranch Hand
Posts: 89
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi to everyone,

I downloaded Enthuware trial tests. One of tasks was to choose a correct JAX-RS resources implementation by EJB component. The right answers were:



But I can't create such a resource by myself. The beans are deployed and registered on containers successfully but when I try to access them through a client (browser) I am always getting 404 error.

Is this sample is a correct EJB implementation? Must the bean be packaged is a ejb or war module, what are the other ways to create JAX-RS root resources as EJB 3.1 beans?
 
Creator of Enthuware JWS+ V6
Posts: 3294
297
Android Eclipse IDE Chrome
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!

You have to use a "Dynamic Web Project" in Eclipse, so the bean is packaged in a war. Furthermore make sure you have an EE6-server (and not EE7 because you will have a different version of JAX-RS).

I have used Glassfish 3.1.2 as it includes Jersey (and you should know about Jersey on the exam).

This code example runs without problems:

URL: http://localhost:8080/[insert name of dynamic web project]/jax/rs/add/1/3
Output:

4



By the way: you can better ask questions on the Enthuware forums ( http://enthuware.com/forum/viewforum.php?f=40 ) because I will receive an email instantly.
 
Ranch Hand
Posts: 45
2
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Frits,

thanks für the Enthuware test with the topic WebServices.

I got some questions concerning some answers.

Is it allowed to post it here? I would post some snippets from the test. My proxy (which is not changeable) does not allow discussing it at the Enthuware-forum.

Best regards and thanks in advance,


Uwe
 
Frits Walraven
Creator of Enthuware JWS+ V6
Posts: 3294
297
Android Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Uwe,

I prefer to keep the feedback in one place because that is easier for all the customers. They also read the discussions about certain questions.

Just send me a PM.

Regards,
Frits
 
Get me the mayor's office! I need to tell her about this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!