[JBossWS] - Re: Necessary artifacts/descriptors for JAX-WS web service
by kyriakost
Hi all,
I am coming back to this topic because it seems that I have the same problem and I cannot overpass it.
I have successfully deployed a POJO. Very easy.
I am now trying to deploy a WebServiceProvider but I am getting :
Cannot obtain wsdl location
This is my web.xml :
| <?xml version="1.0" encoding="UTF-8"?>
| <web-app>
|
| <servlet-name>Test</servlet-name>
| <servlet-class>test.ws.Test</servlet-class>
|
| <servlet-mapping>
| <servlet-name>Test</servlet-name>
| <url-pattern>/Test</url-pattern>
| </servlet-mapping>
| </web-app>
|
|
| my jboss-web.xml :
|
| | <?xml version="1.0" encoding="ISO-8859-1"?>
| | <!DOCTYPE jboss-web
| | PUBLIC "-//JBoss//DTD Web Application 2.3V2//EN"
| | "http://www.jboss.org/j2ee/dtd/jboss-web_3_2.dtd">
| |
| | <jboss-web>
| | <context-root>ws</context-root>
| | </jboss-web>
| |
|
| and this is the code :
|
| | package test.ws;
| |
| |
| | import java.io.ByteArrayInputStream;
| |
| | import javassist.tools.rmi.RemoteException;
| |
| | import javax.jws.WebMethod;
| | import javax.jws.WebParam;
| | import javax.jws.WebResult;
| | import javax.jws.WebService;
| | import javax.jws.soap.SOAPBinding;
| | import javax.xml.transform.Source;
| | import javax.xml.transform.Transformer;
| | import javax.xml.transform.TransformerFactory;
| | import javax.xml.transform.dom.DOMResult;
| | import javax.xml.transform.stream.StreamSource;
| | import javax.xml.ws.Provider;
| | import javax.xml.ws.Service;
| | import javax.xml.ws.ServiceMode;
| | import javax.xml.ws.WebServiceProvider;
| |
| | import org.w3c.dom.Node;
| |
| | @WebServiceProvider
| | @ServiceMode(value = Service.Mode.PAYLOAD)
| | public class Test implements Provider<Source>
| | {
| |
| | public Source invoke(Source source) throws RemoteException {
| | try {
| | DOMResult dom = new DOMResult();
| | Transformer trans = TransformerFactory.newInstance().newTransformer();
| | trans.transform(source, dom);
| | Node node = dom.getNode();
| | Node root = node.getFirstChild();
| | Node first = root.getFirstChild();
| | int number1 = Integer.decode(first.getFirstChild().getNodeValue());
| | Node second = first.getNextSibling();
| | int number2 = Integer.decode(second.getFirstChild().getNodeValue());
| |
| | return sendSource(number1, number2);
| |
| | } catch(Exception e) {
| | e.printStackTrace();
| | throw new RemoteException("Error in provider endpoint");
| | }
| | }
| |
| | private Source sendSource(int number1, int number2) {
| | int sum = number1+number2;
| | String body =
| | "<ns:querySubscriberResponse xmlns:ns=\"http://duke.org\"><return>"
| | +sum
| | +"</return></ns:querySubscriberResponse>";
| | Source source = new StreamSource(
| | new ByteArrayInputStream(body.getBytes()));
| | return source;
| | }
| | }
| |
|
| I even tried putting a wsdl inside at
| WEB-INF/wsdl/TestService.wsdl
|
| Where should I put the wsdl so that the deployer can find it ?
| What other artifacts/deployer-descriptors do I need to make it work ?
|
| Thank you in advance !
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4099673#4099673
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4099673
18Â years, 6Â months
[JBoss Seam] - [newbie] strategy and implementation of nested java.util.Set
by bolke
Hello,
Before I start out with my question I would like to tell you upfront that I am quite new to Seam/EJB3/JSF, I am certain that parts of my question will be a little offtopic with regards to the forum topic. However I did actually search the net and did not really find a solution: most of the information was outdated (old examples for JSF1) or did not describe something along the lines I wanted to do. So far for the disclaimer ;-)
Software used:
| JBoss 4.2.1
| Seam 2.0CR2
| JSF 1.2
|
|
| I am trying to setup an application with generates lists of allowed chemicals for inland vessels. These lists are multilingual, eg a list can be generated in several languages.
|
| The chemical entity looks like this:
|
|
| | @Entity
| | public class Chemical implements Serializable {
| | private static final long serialVersionUID = -81501463360195381L;
| |
| | private int id;
| | private int un;
| |
| | private int maxFillRate;
| | private boolean allowPumpRoom;
| | private TemperatureClass temperatureClass;
| | private boolean explosionProtection;
| | private double density;
| | private String classification;
| | private int relievePressure;
| |
| | private Date updated;
| | private User updatedby;
| |
| | private String classificationCode;
| | private String packageGroup;
| |
| | private int bluelights;
| |
| | transient private boolean removed;
| | transient private Vector<String> removedBy = new Vector<String>();
| |
| | private Set<ChemicalNote> notes;
| | private Set<Compatibility> compatibility;
| | private Set<Danger> dangers;
| | private Set<Equipment> equipment;
| |
| | private SamplingDevice samplingDevice;
| |
| | private Set<Translation> translations;
| |
| | // getters and setters
| | }
| |
|
| I will focus on the translations part, which is the part I am having trouble with.
|
|
| | @Entity
| | public class Translation implements Serializable {
| |
| | private static final long serialVersionUID = 3885895866444687204L;
| |
| | private int id;
| |
| | private Chemical chemical;
| | private String name;
| | private String language;
| |
| | private User updatedby;
| | private Date updated;
| |
| | }
| |
|
|
| On the page showing the list of chemicals I would like to show the translation for the name of the chemical. There is a very basic backingbean:
|
|
| | @Name("chemical")
| | @Scope(CONVERSATION)
| | @Stateful
| | public class ChemicalAction implements Serializable, ChemicalInterface {
| | private static final long serialVersionUID = -5723276978457496053L;
| |
| | @PersistenceContext
| | EntityManager em;
| |
| | @Logger
| | Log log;
| |
| | @In
| | FacesContext facesContext;
| |
| | public java.util.List<Chemical> getChemicals() {
| |
| | java.util.List<Chemical> chemicals =
| | em.createQuery("select c from Chemical c order by c.un").getResultList();
| |
| | return chemicals;
| | }
| |
| | ...
| | }
| |
|
| and a little snippet of the xhtml page:
|
|
| | <ui:repeat value="#{chemical.chemicals}" var="c">
| | #{c.id} - #{c.un} - <ui:repeat value="#{c.translations}" var="t">#{t.name}</ui:repeat> <br />
| | </ui:repeat>
| |
|
| As you can see I try to loop through all the chemicals (which works) and also through all the translations (which does not work - it generates "Property 'name' not found on type org.hibernate.collection.PersistentSet").
|
| Well the question boils down to: How can I select just one item from a java.util.Set based on the current locale?
|
| Additional questions could be:
|
| | Does this need a custom component?
| | If so, can I add java.util.Set to a tld?
| | How to work around this error?
| |
|
| If additional information is needed, I will be happy to provide it. Thanks in advance.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4099669#4099669
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4099669
18Â years, 6Â months
[JBossCache] - Improved performance
by FredrikJ
We have been load testing our system lately and we have been noticing many threads waiting to lock the readOwnerList in the LockMap class.
The readOwnerList_ is a CopyOnWriteArraySet and (as the sourcecode comment above clearly states) is not the most effecient implementation to use here.
So I decided to try and replace the CopyOnWriteArraySet with a ConcurrentHashMap implementation instead and I got a very significant performance boost. Not only was CPU significantly lower on the machines running the cache, but concurrency was also much, much better. I was actually surprised to see how much performance was gained.
Therefore, I would certainly recommend that you swap out the CopyOnWriteArraySet to something more efficient. The actual coding took me about 1 minute to do, so it should certainly be a simple way to improve the cache throughput.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4099664#4099664
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4099664
18Â years, 6Â months