[JBossWS] - type mapping error on String.Array
by siddharthags
I tried to find some topic similar to this but was not successful hence posting this to see if someone can help. I am running JBoss4.05 GA with the JWS1.04 against a 1.5 JVM.
I have a web service that has the following configuration for wstool
<java-wsdl>
<namespaces target-namespace="http://org.foo/wsg" type-namespace="http://org.foo/wsg/types"/>
<webservices servlet-link="Test"/>
</java-wsdl>
interface has a method called getFoo(String input):String[] that returns strings. I generated the artifacts on the server side using wstools and it generated the mapping file. The file does not have anything that relates to the String.Array type
<?xml version="1.0" encoding="UTF-8"?>
<java-wsdl-mapping version="1.1" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://www.ibm.com/webservices/xsd/j2ee_jaxrpc_mapping_1_1.xsd">
<package-mapping>
<package-type>org.foo.wsg</package-type>
http://org.foo/wsg
</package-mapping>
<java-xml-type-mapping>
<java-type>org.foo.wsg.UserException</java-type>
<root-type-qname xmlns:typeNS="http://org.foo/wsg/types">typeNS:UserException</root-type-qname>
<qname-scope>complexType</qname-scope>
<variable-mapping>
<java-variable-name>defaultMessage</java-variable-name>
<xml-element-name>defaultMessage</xml-element-name>
</variable-mapping>
<variable-mapping>
<java-variable-name>errorCode</java-variable-name>
<xml-element-name>errorCode</xml-element-name>
</variable-mapping>
<variable-mapping>
<java-variable-name>message</java-variable-name>
<xml-element-name>message</xml-element-name>
</variable-mapping>
</java-xml-type-mapping>
<exception-mapping>
<exception-type>org.foo.wsg.UserException</exception-type>
<wsdl-message xmlns:exMsgNS="http://org.foo/wsg">exMsgNS:UserException</wsdl-message>
</exception-mapping>
<service-interface-mapping>
<service-interface>org.foo.wsg.TestService</service-interface>
<wsdl-service-name xmlns:serviceNS="http://org.foo/wsg">serviceNS:TestService</wsdl-service-name>
<port-mapping>
<port-name>TestPort</port-name>
<java-port-name>TestPort</java-port-name>
</port-mapping>
</service-interface-mapping>
<service-endpoint-interface-mapping>
<service-endpoint-interface>org.foo.wsg.Test</service-endpoint-interface>
<wsdl-port-type xmlns:portTypeNS="http://org.foo/wsg">portTypeNS:Test</wsdl-port-type>
<wsdl-binding xmlns:bindingNS="http://org.foo/wsg">bindingNS:TestBinding</wsdl-binding>
<service-endpoint-method-mapping>
<java-method-name>getFoo</java-method-name>
<wsdl-operation>getFoo</wsdl-operation>
<method-param-parts-mapping>
<param-position>0</param-position>
<param-type>java.lang.String</param-type>
<wsdl-message-mapping>
<wsdl-message xmlns:wsdlMsgNS="http://org.foo/wsg">wsdlMsgNS:Test_getFoo</wsdl-message>
<wsdl-message-part-name>String_1</wsdl-message-part-name>
<parameter-mode>IN</parameter-mode>
</wsdl-message-mapping>
</method-param-parts-mapping>
<wsdl-return-value-mapping>
<method-return-value>java.lang.String[]</method-return-value>
<wsdl-message xmlns:wsdlMsgNS="http://org.foo/wsg">wsdlMsgNS:Test_getFooResponse</wsdl-message>
<wsdl-message-part-name>result</wsdl-message-part-name>
</wsdl-return-value-mapping>
</service-endpoint-method-mapping>
</service-endpoint-interface-mapping>
</java-wsdl-mapping>
when I try to use a client that I built using the wstools with the client configuration given as
<wsdl-java file="WEB-INF/wsdl/TestService.wsdl">
</wsdl-java>
I get the following error on trying to bring up Jboss when this war is being deployed
03:01:56,295 WARN [JSR109ServerMetaDataBuilder] Cannot obtain SEI mapping for: org.foo.Test
03:01:56,305 ERROR [MainDeployer] Could not create deployment: file:/D:/Program Files/jboss/server/default/deploy/test.war/
org.jboss.ws.WSException: Cannot obtain java type mapping for: {http://org.foo/wsg/types}String.Array
any pointers at why this is happening?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3997192#3997192
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3997192
18 years, 2 months
[Persistence, JBoss/CMP, Hibernate, Database] - Object persistence/rollback misconception
by beligum
Hello everyone.
(Perhaps I should start with a little NY-wish, well, this be it)
I'm trying to wrap my thoughts around the entire ORM concept of JBoss (Hibernate+Seam in particular) and find it a little confusing, since my whole DB-background has been purely relational. I'd truly appreciate it if someone would take the time to explain it to me.
This is my case: I have a stateful session bean that creates a new mapped user-object (user data) and a new mapped loginEntity-object (login data) when someone tries to register on the register-page. I'm using the same bean as the ajax-callback bean to validate the entered data while registering.
When the user submits his/her data, the two entity beans are persisted to the DB, but sometimes, things go wrong with one of them, after the other one has been persisted successfully. I want to do a container-managed rollback on the successfully persisted bean, when the other one fails, using the @Rollback annotation, or any suitable other solution.
Please advise, here is the code:
| @Stateful
| @Scope(CONVERSATION)
| @Name("register")
| public class RegisterAction implements IRegister
| {
| @In(create=true) @Out
| private Person currentUser;
| @In(create=true) @Out
| private LoginEntity loginEntity;
|
| private boolean renderSuccess = false;
|
| ResourceBundle msg = GeneralSettings.getGeneralMessageBundle();
| ResourceBundle regMsg = GeneralSettings.getRegisterMessageBundle();
|
| @In
| private EntityManager em;
|
| //-----CONSTRUCTORS-----
| public RegisterAction()
| {
| }
|
| //-----AJAX CALL ENTRIES-----
| /*
| * Note: if a call is added, removed, also remove it from the register()
| * checklist.
| */
| public String getFirstNameCheck()
| {
| String curVal = currentUser.getFirstName();
| String retVal = null;
|
| if (curVal!=null && curVal.equals("")) {
| retVal = regMsg.getString("missingFirstName");
| }
|
| return retVal;
| }
| ... more ajax-callbacks ...
|
| //-----ACTIONS-----
| public boolean getRenderSuccess()
| {
| return this.renderSuccess;
| }
| @TransactionAttribute(TransactionAttributeType.REQUIRED)
| @Rollback(ifOutcome={"failure"})
| public String register()
| {
| if (this.hasErrors()) {
| return "failure";
| }
|
| //add the loginObject to the entity
| this.loginEntity.setEntity(this.currentUser);
|
| try {
| this.em.persist(this.currentUser);
| this.em.persist(this.loginEntity);
|
| this.renderSuccess = true;
| }
| catch (Exception e) {
| FacesMessages.instance().add("registerForm", regMsg.getString("registerPersistanceFailure"));
|
| return "failure";
| }
|
| return "success";
| }
| @Remove @Destroy
| public void destroy()
| {
| }
|
| //-----PRIVATE METHODS-----
| protected boolean hasErrors()
| {
| return !(
| getFirstNameCheck()==null &&
| getLastNameCheck()==null &&
| getAddressCheck()==null &&
| getPostalCodeCheck()==null &&
| getCityCheck()==null &&
| getTelephoneCheck()==null &&
| getEmailCheck()==null &&
| getEmailCheck()==null &&
| getPasswordCheck()==null
| );
| }
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3997190#3997190
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3997190
18 years, 2 months
[Messaging, JMS & JBossMQ] - Re: MDB and connection to a remote queue with transaction
by mclu
"genman" wrote : BTW, if you close the connection it closes the session and sender as well.
I know :-)
"genman" wrote :
| Anyway, what does getConnection() do? Are you using the pooled connections at java:/JmsXA ?
It gets the connection and start it from the connectionfactory (of the remote server) and because it is remote it looks for XAConnectionfactory.
The code:
private Connection getConnection() throws JMSException {
|
| Connection connection = null;
| try {
| connection = cf.createConnection();
| connection.start();
|
| } catch (JMSException e) {
| if (connection != null)
| try {
| connection.close();
| } catch (Exception ignore) {
| }
| throw e;
| }
| return connection;
| }
And during ejb create the remote jndi lookup for the connectionfactory is done:
public void ejbCreate() {
| try {
| //remote jndi properties like port and url
| Properties prop = IMConstants.getIMServerProperties();
|
| Context ic = new InitialContext(prop);
|
| cf = (ConnectionFactory) ic.lookup("XAConnectionFactory");
| sendQueue = (Queue) ic.lookup(IMConstants.QUEUE_INCOMINGSYNCREQUESTS);
| ic.close();
| } catch (Exception e) {
| throw new EJBException("Failure to get connection factory or queue: "
| + e.getMessage(),e);
| }
| }
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3997183#3997183
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3997183
18 years, 2 months