[EJB 3.0] - EJB3: org.hibernate.type.SerializationException: could not d
by 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<Road> roadsorigin;
|
| private Set<Road> roadsdestination;
|
| @Id
| @Column(name = "IATA")
| public String getIata() {
| return iata;
| }
| //...................
| @OneToMany(mappedBy = "roadPK.origin", fetch = FetchType.EAGER, cascade = CascadeType.ALL)
| public Set<Road> getRoadsorigin() {
| return roadsorigin;
| }
|
| public void setRoadsorigin(Set<ROAD> roadsorigin) {
| this.roadsorigin= roadsorigin;
| }
|
| @OneToMany(mappedBy = "roadPK.destination", fetch = FetchType.EAGER, cascade = CascadeType.ALL)
| public Set<Road> getRoadsdestination() {
| return roadsdestination;
| }
|
| public void setRoadsdestination(Set<Road> 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
16 years, 12 months
[JBoss Portal] - Re: Any one for Apache Jetspeed2 and JBoss 5?
by ebross
Perhaps, you didn't read my initial entry as well as it was intended to be read: I have already done a bit of reading -- including the "JBossHowTo" -- during my initial research. And I thought on a "JBoss Portal" forum (Indeed the most likely place), I might find someone who might have also used or sampled jetspeed2 with JBoss-5.0.x.GA to share their experiences with a fellow JBossAS user.
The point to note about the "accessory and car" analogy is that JBoss made the car, and so, it is legitimate to ask drivers of [JBoss] cars about their experiences of using other non-JBoss accessories? Further, your irritations would be understanding if the question was wholly about jetspeed2, but on the contrary, it is about jetspeed2 AND JBoss-5.0.x.GA.
Anyway thanks, while I move on!
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4227130#4227130
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4227130
16 years, 12 months
Threads in runnable state
by Anand Raman
hi all
Our production environment consists of Apache in front of the jboss
installation and communicating over AJP protocol on port 8009. We are
seeing many threads in the following state
"TP-Processor1537" daemon prio=1 tid=0x2faeada0 nid=0x5623 runnable
[0x1f56f000..0x1f56fe20]
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
at java.io.BufferedInputStream.read1(BufferedInputStream.java:256)
at java.io.BufferedInputStream.read(BufferedInputStream.java:313)
- locked <0x80de4330> (a java.io.BufferedInputStream)
at org.apache.jk.common.ChannelSocket.read(ChannelSocket.java:620)
at org.apache.jk.common.ChannelSocket.receive(ChannelSocket.java:558)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:685)
at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:889)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
We take a thread dump at 5 minutes interval and find that threads
continue to be in this state. While I understand the frequency of
thread dump is very low, we have seen some threads move to doing some
actual work and finally returning to this state.
I would like to understand what these threads are doing. Why don’t
these threads return to the normal wait state
"TP-Processor1535" daemon prio=1 tid=0x30fca128 nid=0x5621 in
Object.wait() [0x1f8f6000..0x1f8f7120]
at java.lang.Object.wait(Native Method)
- waiting on <0x66735340> (a
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable)
at java.lang.Object.wait(Object.java:474)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:656)
- locked <0x66735340> (a
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable)
at java.lang.Thread.run(Thread.java:595)
Any help would be greatly appreciated.
Thanks in advance
anand
16 years, 12 months