[jboss-user] [EJB 3.0] - Re: EJB3: org.hibernate.type.SerializationException: could n

2009-05-03 Thread D6L
Hi,

I have the same opinion like you know. I must change the PK in DB to get it run.
I have already changed it and works fine!

Thanks a lot for your time, Wolfgang

Best Regards 
D6L

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4228212#4228212

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4228212
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [EJB 3.0] - Re: EJB3: org.hibernate.type.SerializationException: could n

2009-04-30 Thread D6L
First, Sorry for the Route/Road mismatch! In fact is it Road, i checked it 
before.

The structure:

Location ___|___Road
___ |

IATA   PK--->  ORIGINPK  +FK
spacee --->  DESTINATIONPK + FK

So IATA is a String of an Location/Place and Road has a StartPoint (ORIGIN) and 
an EndPoint (DESTINATION). So Road has a double relation with Location.
The idea behind this structure, in Java, is to know from one Road, for example, 
which the Details of the Origin/Destination from type Location are without 
using SQL and just work with Java classes.

Best regards 
D6L

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4227478#4227478

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4227478
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [EJB 3.0] - Re: EJB3: org.hibernate.type.SerializationException: could n

2009-04-29 Thread D6L
Hi,

the problem is that i don't have the permission to make changes on the DB 
because it's a LIVE/Production DB. So problems with releases/changes and so on. 
I tried to access now my attributs via @NamedQuery like this:
SELECT r.roadPK.origin.iata,r.roadPK.destination.iata, r.availabilityMethod 
FROM Road r

but there I got a compiler error:

Caused by: org.hibernate.HibernateException: Errors in named queries: 
Road.listAll
  | at 
org.hibernate.impl.SessionFactoryImpl.(SessionFactoryImpl.java:397)
  | at 
org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1327)
  | at 
org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)
  | at 
org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:669)
  | ... 75 more

By testing with 

SELECT r.roadPK.origin, r.roadPK.destination,r.availabilityMethod FROM Route r
i didn't get any error but also any output. lol Like i told it before, with 
SELECT r.availabilityMethod FROM Route r is no problem!

So logically I can access my attributs via r.roadPK.origin.iata but I get there 
the error! So I think that my mapping is wrong.

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4227445#4227445

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4227445
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [EJB 3.0] - Re: EJB3: org.hibernate.type.SerializationException: could n

2009-04-28 Thread D6L
First, thanks for the fast answer.

I also tried two to make the FechType to lazy but that didn't change anything.

But for the first point with the ID.
Can you explain me more in detail what do you mean. For example, where to set 
the ID? Do you want to set an new phyiscal ID in the Tables and to work with it 
or do you want to change the ID type in ROAD?

thx 

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4227166#4227166

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4227166
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [EJB 3.0] - The Stacktrace

2009-04-28 Thread D6L
INFO: EJB5018: An exception was thrown during an ejb invocation on [RoadDAO]
  | INFO: javax.ejb.EJBException
  | at 
com.sun.ejb.containers.BaseContainer.processSystemException(BaseContainer.java:3894)
  | at 
com.sun.ejb.containers.BaseContainer.completeNewTx(BaseContainer.java:3794)
  | at 
com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:3596)
  | at 
com.sun.ejb.containers.WebServiceInvocationHandler.invoke(WebServiceInvocationHandler.java:201)
  | at $Proxy220.listRoad(Unknown Source)
  | 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:585)
  | at com.sun.enterprise.webservice.InvokerImpl.invoke(InvokerImpl.java:78)
  | at 
com.sun.enterprise.webservice.EjbInvokerImpl.invoke(EjbInvokerImpl.java:82)
  | at com.sun.xml.ws.server.InvokerTube$2.invoke(InvokerTube.java:146)
  | at 
com.sun.xml.ws.server.sei.EndpointMethodHandler.invoke(EndpointMethodHandler.java:257)
  | at 
com.sun.xml.ws.server.sei.SEIInvokerTube.processRequest(SEIInvokerTube.java:93)
  | at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:595)
  | at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:554)
  | at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:539)
  | at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:436)
  | at 
com.sun.xml.ws.api.pipe.helper.AbstractTubeImpl.process(AbstractTubeImpl.java:106)
  | at 
com.sun.enterprise.webservice.MonitoringPipe.process(MonitoringPipe.java:147)
  | at 
com.sun.xml.ws.api.pipe.helper.PipeAdapter.processRequest(PipeAdapter.java:115)
  | at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:595)
  | at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:554)
  | at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:539)
  | at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:436)
  | at 
com.sun.xml.ws.api.pipe.helper.AbstractTubeImpl.process(AbstractTubeImpl.java:106)
  | at com.sun.xml.ws.tx.service.TxServerPipe.process(TxServerPipe.java:317)
  | at 
com.sun.enterprise.webservice.CommonServerSecurityPipe.processRequest(CommonServerSecurityPipe.java:222)
  | at 
com.sun.enterprise.webservice.CommonServerSecurityPipe.process(CommonServerSecurityPipe.java:133)
  | at 
com.sun.xml.ws.api.pipe.helper.PipeAdapter.processRequest(PipeAdapter.java:115)
  | at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:595)
  | at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:554)
  | at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:539)
  | at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:436)
  | at 
com.sun.xml.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:243)
  | at 
com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:444)
  | at 
com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:244)
  | at 
com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:135)
  | at 
com.sun.enterprise.webservice.Ejb3MessageDispatcher.handlePost(Ejb3MessageDispatcher.java:113)
  | at 
com.sun.enterprise.webservice.Ejb3MessageDispatcher.invoke(Ejb3MessageDispatcher.java:87)
  | at 
com.sun.enterprise.webservice.EjbWebServiceServlet.dispatchToEjbEndpoint(EjbWebServiceServlet.java:228)
  | at 
com.sun.enterprise.webservice.EjbWebServiceServlet.service(EjbWebServiceServlet.java:157)
  | at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
  | at 
com.sun.enterprise.web.AdHocContextValve.invoke(AdHocContextValve.java:114)
  | at 
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
  | at 
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
  | at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587)
  | at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:87)
  | at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:222)
  | at 
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
  | at 
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
  | at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587)
  | at 
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1096)
  | at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:166)
  | at 
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
  | at 
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
  | at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587)
  | at 
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.ja

[jboss-user] [EJB 3.0] - EJB3: org.hibernate.type.SerializationException: could not d

2009-04-28 Thread D6L
Hi everybody,
I would get an Output of an Table Road (Oracle Database) via EntityManager and 
Web Services. I got the following error :
org.hibernate.type.SerializationException: could not deserialize

Eclipe3.4.1/Glassfish V2.1/SoapUI 2.5 (for testing)

Enviroment:

  Class  :  Location  
  IATA(PK) 
 Class  :  Road  
   Origin(PK)(FK of IATA)
   Destination  (PK)(FK of IATA)
 
To manage the composite ID I generated a class RoadPK which is below:

import java.io.Serializable;
  | import javax.persistence.Embeddable;
  | @Embeddable
  | public class RoadPK  implements Serializable {
  |   
  | /**
  |  * Variable of type Location
  |  */
  | private Location origin = null;
  | 
  | private Location destination = null;
  | ..(Getter/Setter).
  | 

Class Road have the attributs(the composite ID).
 I locate the Problem here in the @nameQuery. I can show all availability 
methods when I write SELECT r.availabilityMethod  FROM ROADS r. 
But I can't access origin and destination by SELECT r.origin.iata FROM ROADS r 
. So my Question is: 
Is my mapping wrong or is there no posssibility to work with Type classes for 
attributes in composite IDs in EJB3?

@Entity
  | @NamedQuery(
  | name = "ROADS.listAll",
  | query = "SELECT r FROM ROADS r")/*
  | 
  | @Table(name="ROADS")
  | public class ROADS implements Serializable {
  | 
  |  private RoadPK  roadPK  = null;
  |  private String availabilityMethod = null;
  | 
  | @EmbeddedId
  | public RoadPK  getRoadPK() {
  | return roadPK  ;
  | }
  | 
  | public void setRoadPK(RoadPK  roadPK  ) {
  | this.roadPK  = roadPK  ;
  |}
  |@Column(name="AVAILABILITY_METHOD")
  | public String getAvailabilityMethod() {
  | return availabilityMethod;
  | }
  | 
  | 
  | public void setAvailabilityMethod(final String availabilityMethodParam) 
{
  | this.availabilityMethod = availabilityMethodParam;
  | }
  | 
  | 
  | }

Class Location:

@Entity
  | @Table(name = "LOCATIONS")
  | public class Location implements Serializable {
  |  
  |  private String iata = null;
  | 
  |  /**
  |  * The Roads
  |  */
  |  private Set roadsorigin;
  | 
  |  private Set roadsdestination;
  | 
  |  @Id
  |  @Column(name = "IATA")
  |  public String getIata() {
  | return iata;
  |  }
  | //...
  | @OneToMany(mappedBy = "roadPK.origin", fetch = FetchType.EAGER, cascade 
= CascadeType.ALL)
  | public Set getRoadsorigin() {
  |return roadsorigin;
  | }
  | 
  | public void setRoadsorigin(Set roadsorigin) {
  | this.roadsorigin= roadsorigin;
  | }
  | 
  | @OneToMany(mappedBy = "roadPK.destination", fetch = FetchType.EAGER, 
cascade = CascadeType.ALL)
  | public Set getRoadsdestination() {
  | return roadsdestination;
  | }
  | 
  | public void setRoadsdestination(Set roadsdestination) {
  | this.roadsdestination = roadsdestination;
  | }
  | }

The class RoadDAO offers the WebServices:

@WebService
  | @Stateless(name="RoadDAO")
  | public class RoadDAOimplements Serializable {
  | 
  | @PersistenceContext(name="ResourceDS")
  | private EntityManager em;
  |  //  
  |  @SuppressWarnings("unchecked")
  | @WebMethod
  | @WebResult(name="RoadsList")
  |  public final List < Road> listRoad() {
  | return em.createNamedQuery("Road.listAll").getResultList();
  | }
  | //  
  | }

Thanks for reading


View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4227131#4227131

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4227131
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user