[JBossWS] - Re: Problems returning arrays from Webservice Method
by kaza
Sorry Jason, but I don't know exactly what you mean by "jira issue" but here is my server code and a snippet of a junit test that tries to access this (I simplified things a bit to focus on the problem)
First of all my ServiceWS class
public class ServiceWS {
private Long id;
private String name;
public Long getId(){ return this.id;}
public void setId(Long id) {this.id = id;}
public String getName(){return this.name;};
public void setName(String name){this.name=name;}
}
Then there is the ServiceWSArray class
public class ServiceWSArray {
private ServiceWS[] value;
public ServiceWSArray() {
}
public ServiceWS[] getValue() {
return this.value;
}
public void setValue(ServiceWS[] value) {
this.value = value;
}
}
And finally there is my webservice endpoint
@Stateless
@WebService(serviceName="MyWebService")
@SOAPBinding(style=Style.RPC,use=Use.LITERAL)
public class FacadeWS {
@WebMethod public ServiceWSArray getServiceInfos()
throws UnknownServiceProviderException {
if (this.logger.isTraceEnabled())
this.logger.trace("SOAP:getServiceInfos");
ServiceWS[] services = new ServiceWS[10];
for (int i=0;i<10;i++)
services = new ServiceWS.fromService();
ServiceWSArray result = new ServiceWSArray();
result.setValue(services);
return result;
}
}
On the junit client I create the port to this service and just call this
this.getPort().getServiceInfos();
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3981234#3981234
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3981234
19 years, 6 months
[JBossCache] - Re: NPE when using optimistic locking with JbossCache 1.4.0.
by pkorros
I don't have a unit test but I could send you a trace if that helps you.
The problem is happening in a transaction that is starting from a Message driven bean and calls several Session beans (all have transaction required attributes). So all the method calls participate in the same transaction.
When I execute one message at a time everything works correctly but when I fill the queue with many messages (many concurrent transactions) the problem appears.
In the Session beans the hibernate session usage is like...
Session.open()
...
Session.find()
...
Session.close()
When the operation is real-only, or
Session.open()
...
Session.find()
...
Session.flush()
Session.close()
When the operation is read-write.
When I use pessimistic locking everything works ok. The problem appears only when I use the optimistic locking cache.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3981231#3981231
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3981231
19 years, 6 months
[JBossCache] - Re: NPE when using optimistic locking with JbossCache 1.4.0.
by pkorros
I don't have a unit test but I could send you a trace if that helps you.
The problem is happening in a transaction that is starting from a Message driven bean and calls several Session beans (all have transaction required attributes). So all the method calls participate in the same transaction.
When I execute one message at a time everything works correctly but when I fill the queue with many messages (many concurrent transactions) the problem appears.
In the Session beans the hibernate session usage is like...
Session.open()
...
Session.find()
...
Session.close()
When the operation is real-only, or
Session.open()
...
Session.find()
...
Session.flush()
Session.close()
When the operation is read-write.
When I use pessimistic locking everything works ok. The problem appears only when I use the optimistic locking cache.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3981230#3981230
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3981230
19 years, 6 months
[Beginners Corner] - Re: Many-Many CMP Relationship
by hhtquang
Hi,
I have 3 tables
1. PLAYER: field PLAYER_ID
2. TEAM: field TEAM_ID
3. TEAM_PLAYER: fields PLAYER_ID and TEAM_ID
And I also have 2 entities: PlayerBean and TeamBean.
Make sure that you have getter and setter for cmr fields teams and players in ejb-jar.xml are added into PlayerBean and TeamBean respectively.
The relationship btw TEAM AND PLAYER is n:n
Pls refer to ejb-jar.xml and jbosscmp-jdbc.xml, it will help to solve your problem.U can email me at hhtquang(a)yahoo.com for more info.
ejb-jar.xml:
<ejb-relation>
<ejb-relation-name>player-team</ejb-relation-name>
<ejb-relationship-role>
<ejb-relationship-role-name>player-has-teams</ejb-relationship-role-name>
Many
<relationship-role-source>
<ejb-name>PlayerBean</ejb-name>
</relationship-role-source>
<cmr-field>
<cmr-field-name>teams</cmr-field-name>
<cmr-field-type>java.util.Collection</cmr-field-type>
</cmr-field>
</ejb-relationship-role>
<ejb-relationship-role>
<ejb-relationship-role-name>team-has-players</ejb-relationship-role-name>
Many
<relationship-role-source>
<ejb-name>TeamBean</ejb-name>
</relationship-role-source>
<cmr-field>
<cmr-field-name>players</cmr-field-name>
<cmr-field-type>java.util.Collection</cmr-field-type>
</cmr-field>
</ejb-relationship-role>
</ejb-relation>
jbosscmp-jdbc.xml
<ejb-relation>
<ejb-relation-name>player-team</ejb-relation-name>
<relation-table-mapping>
<table-name>TEAM_PLAYER</table-name>
</relation-table-mapping>
<ejb-relationship-role>
<ejb-relationship-role-name>player-has-teams</ejb-relationship-role-name>
<key-fields>
<key-field>
<field-name>playerId</field-name>
<column-name>PLAYER_ID</column-name>
</key-field>
</key-fields>
</ejb-relationship-role>
<ejb-relationship-role>
<ejb-relationship-role-name>team-has-players</ejb-relationship-role-name>
<key-fields>
<key-field>
<field-name>teamId</field-name>
<column-name>TEAM_ID</column-name>
</key-field>
</key-fields>
</ejb-relationship-role>
</ejb-relation>
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3981229#3981229
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3981229
19 years, 6 months