-
1. Re: Move ear from Jboss AS 6.1.0 to Jboss AS 7.1.1
sfcoy Jul 4, 2013 7:36 AM (in response to beepeers)You have quite a few issues here.
Are you using only the JPA interfaces, or are you using Hibernate ORM interfaces as well?
Which of these modules actually contain EJBs?
What are you trying to achieve with the common-ro jar?
-
2. Re: Move ear from Jboss AS 6.1.0 to Jboss AS 7.1.1
beepeers Jul 4, 2013 8:32 AM (in response to sfcoy)Hi Stephen,
(sorry im a rookie with application server dev')
i guess i'm using the Hibernate ORM interface, there is only the logic module wich contain EJBs
and the common-ro jar is only here to translate the entities from data into json objects.
-
3. Re: Move ear from Jboss AS 6.1.0 to Jboss AS 7.1.1
sfcoy Jul 4, 2013 9:33 AM (in response to beepeers)To begin with, here's a crack at sorting out your maven build .
It currently assumes that common-ro is something separate, but they may not be correct because it's still not clear why you segregated it the way you did:
{code:xml}<module>../../COMMON/r-o</module>{code}
If you're using the JavaEE 6 compatible JAX-RS apis then you probably don't need any of the resteasy dependencies.
-
mikebee.zip 26.6 KB
-
-
4. Re: Move ear from Jboss AS 6.1.0 to Jboss AS 7.1.1
beepeers Jul 4, 2013 12:13 PM (in response to sfcoy)Here i am Stephen !
First off all thanks for your attention its very helpfull !
Now the deployement works perfectly well but now when i try to request my server with my litle restClient i get these errors:
18:09:31 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) java.lang.ClassCastException: com.beepeers.server.logic.operation.AdminFacade$$$view1367 cannot be cast to com.beepeers.server.logic.operation.AdminFacade
18:09:31 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at com.beepeers.server.api.resources.v2.admin.impl.RestResource.<init>(RestResource.java:17)
18:09:31 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at com.beepeers.server.api.resources.v2.admin.impl.FeedResource.<init>(FeedResource.java:14)
18:09:31 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
18:09:31 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
18:09:31 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
18:09:31 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
18:09:31 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at org.jboss.resteasy.core.ConstructorInjectorImpl.construct(ConstructorInjectorImpl.java:82)
18:09:31 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at org.jboss.resteasy.plugins.server.resourcefactory.POJOResourceFactory.createResource(POJOResourceFactory.java:43)
18:09:31 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:210)
18:09:31 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:525)
18:09:31 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:502)
18:09:31 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:119)
18:09:31 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208)
18:09:31 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55)
18:09:31 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50)
18:09:31 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
18:09:31 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329)
18:09:31 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
18:09:31 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)
18:09:31 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
18:09:31 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50)
18:09:31 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153)
18:09:31 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)
18:09:31 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
18:09:31 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
18:09:31 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368)
18:09:31 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)
18:09:31 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671)
18:09:31 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930)
18:09:31 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at java.lang.Thread.run(Thread.java:724)
plus, i have 2 errors eclipse is telling that the project facet EAR cant be changed to 6.0 and data cant be changed to EJB 3.0
-
5. Re: Move ear from Jboss AS 6.1.0 to Jboss AS 7.1.1
sfcoy Jul 4, 2013 11:14 PM (in response to beepeers)1 of 1 people found this helpfulThe ClassCastException means that you probably have two copies of the com.beepeers.server.logic.operation.AdminFacade class in your ear. Maybe a copy of the EJB jar made its way into your WAR component.
Make sure you're using Eclipse Kepler with JBoss Tools installed. This works great, but you may need to recreate your workspace. Do a
mvn eclipse:clean
from the command line before importing your maven projects back in.
-
6. Re: Move ear from Jboss AS 6.1.0 to Jboss AS 7.1.1
beepeers Jul 5, 2013 5:56 AM (in response to sfcoy)Hi stephen !
i saw something strange yesterday cause in my jboss 6 with my old maven config
when i deployed my ear, it looks like:
ear
|-api
|-config
|-data
|-logic
|-r-o
|web
and now in the jboss 7 with the new maven config:
ear
|--api
|--logic
|--config
|--data
|--config
|--data
|--logic
|--r-o
|--web
|--logic
|--config
|--data
|--r-o
maybe you know why ?
-
7. Re: Move ear from Jboss AS 6.1.0 to Jboss AS 7.1.1
sfcoy Jul 5, 2013 8:01 AM (in response to beepeers)How are you deploying your application?
What does the application structure look like if you build it from the command line?
It's important that your maven-ear-plugin is at least version 2.8, which was specified in the pluginManagement section of the parent pom.xml.
In additition, it's important that it contains the configuration element:
{code:xml}<skinnyWars>true</skinnyWars>{code}
-
8. Re: Move ear from Jboss AS 6.1.0 to Jboss AS 7.1.1
beepeers Jul 5, 2013 10:23 AM (in response to sfcoy)Hi Stephen,
i didn't modified your pom
i deployed my ear in eclipse without maven build... well now i run a maven build with clean install package, i use the web interface to deploy the ear and at first call to the server with my rest client i get:
16:13:31 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) java.lang.NullPointerException
16:13:31 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at com.beepeers.server.api.resources.v2.admin.impl.ContextResource.getContextRO(ContextResource.java:16)
16:13:31 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
16:13:31 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
16:13:31 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
16:13:31 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at java.lang.reflect.Method.invoke(Method.java:597)
16:13:31 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:155)
16:13:31 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:257)
16:13:31 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:222)
16:13:31 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:211)
16:13:31 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:525)
16:13:31 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:502)
16:13:31 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:119)
16:13:31 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208)
16:13:31 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55)
16:13:31 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50)
16:13:31 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
16:13:31 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329)
16:13:31 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
16:13:31 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)
16:13:31 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
16:13:31 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50)
16:13:31 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153)
16:13:31 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)
16:13:31 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
16:13:31 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
16:13:31 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368)
16:13:31 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)
16:13:31 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671)
16:13:31 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930)
16:13:31 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) at java.lang.Thread.run(Thread.java:662)
maybe i missed to tell you something ?
i call services resources in api (like ContextResource) which call a facade then the manager (in logic), the dao, the manager transform in RO then the Response in api is sent in Json to the client.
-
9. Re: Move ear from Jboss AS 6.1.0 to Jboss AS 7.1.1
sfcoy Jul 5, 2013 11:32 AM (in response to beepeers)What happens in line 16 of com.beepeers.server.api.resources.v2.admin.impl.ContextResource?
-
10. Re: Move ear from Jboss AS 6.1.0 to Jboss AS 7.1.1
beepeers Jul 5, 2013 11:37 AM (in response to sfcoy)here my IContextResource
@Path("v2/admin/context")
public interface IContextResource {
@GET
@Produces("application/json; charset=UTF-8")
public Response getContextRO(@HeaderParam("Authorization") String token) throws BadParametersException, BadRequestException, Exception;
public class ContextResource extends RestResource implements IContextResource {
public Response getContextRO(String token) throws BadParametersException, BadRequestException, Exception {
line 16 -> ContextRO contextRO = this.adminFacade.getContextRO(token);
return this.success(contextRO);
}
and here my RestResource
protected RestResource() {
InitialContext ic;
try {
ic = new InitialContext();
this.adminFacade = (AdminFacade) ic.lookup("java:global/ear/logic/AdminFacade");
} catch (NamingException e) {
}
}
-
11. Re: Move ear from Jboss AS 6.1.0 to Jboss AS 7.1.1
sfcoy Jul 5, 2013 11:50 AM (in response to beepeers)It looks like your JNDI lookup is failing (swallowing exceptions is evil). Are you sure you have the correct lookup name?
Incidentally, you should be able to inject the reference:
{code:java}@EJB protected AdminFacade adminFacade;{code}
instead of the JNDI lookup.
-
12. Re: Move ear from Jboss AS 6.1.0 to Jboss AS 7.1.1
beepeers Jul 7, 2013 9:06 AM (in response to sfcoy)"(swallowing exceptions is evil)" yeah i know, this guy does not work anymore with us...
i removed the try catch in the constructor and added the @EJB for the AdminFacade but get the same result.
i guess i need to learn something more cause the project works great on the jboss 6 and it's like hell to move to jboss 7..
it's time to learn more about jboss / maven / ejb / hiberate i guess
-
13. Re: Move ear from Jboss AS 6.1.0 to Jboss AS 7.1.1
beepeers Jul 9, 2013 5:00 AM (in response to beepeers)Hi Stephen !
I found this post: http://howtojboss.com/2012/04/30/jboss-trading-java-ee-5-to-java-ee-6-migration-part-i-cdi-1-0-jax-rs-1-1/
maybe it could help me, what do you think of it ?
-
14. Re: Move ear from Jboss AS 6.1.0 to Jboss AS 7.1.1
beepeers Jul 10, 2013 9:57 AM (in response to beepeers)Hi Stephen !
I found the solution, the project is now working as well ! thanks for your help !