[JBossWS] - Re: error using wsprovide
by Fantagir
HI!
I've solved the error before. I execute the wsprovide in the build directory instead of the build\service directory and change the command like this:
$c:\jboss\wsprovide -t -o generated -w service. IContar service.Contar
But know I've got another error:
java.lang.NoClassDefFoundError: javax/ejb/Stateless
I don't implement EJB. This could be the problem?
I put here the code of my classes:
IContar
package service;
|
| import java.rmi.Remote;
| import java.rmi.RemoteException;
|
| import javax.jws.WebMethod;
| import javax.jws.WebResult;
| import javax.jws.WebService;
| import javax.jws.WebParam;
|
| import org.osid.OsidContext;
|
| import util.DatePalabra;
|
| @WebService(
| name="IContar", // wsdl:portType
| targetNamespace="urn:service" //wsdl:targetNamespace
| )
| public interface IContar extends Remote {
|
| @WebMethod
| @WebResult(name="IContar_darCuentaResponse")
| public DatePalabra darCuenta(@WebParam(name = "ctx", partName ="ctx") OsidContext ctx) throws RemoteException;
| }
|
|
Contar
package service;
import java.rmi.RemoteException;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
import org.osid.OsidContext;
import org.osid.OsidException;
import util.DatePalabra;
@WebService(
serviceName="Contar", // wsdl:service
portName= "IContarPort", //wsdl:port name=... binding=...
endpointInterface = "service.IContar", //nombre de la interficie del WebService
targetNamespace="urn:service", //wsdl:targetNamespace
wsdlLocation = "WEB-INF/wsdl/Contar.wsdl" //nombre y ubicación en el proyecto del fichero .wsdl
)
@SOAPBinding(
style=SOAPBinding.Style.RPC,
use=SOAPBinding.Use.LITERAL
)
public class Contar implements IContar{
public DatePalabra darCuenta(OsidContext ctx) throws RemoteException {
DatePalabra dp = new DatePalabra();
try {
String str = (String) ctx.getContext("iduser");
dp.setPalabra(str);
dp.setLongitud(Integer.toString(str.length()));
return dp;
} catch (OsidException e) {
// TODO Auto-generated catch block
e.printStackTrace();
dp.setLongitud("0");
dp.setPalabra("vacio");
return dp;
}
}
}
Thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4093032#4093032
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4093032
18Â years, 7Â months
[EJB 3.0] - Clustered MDB configuration
by ejb3workshop
I have 3 MDBs configures in a chain
BatchJobProcessor > TransactionProcessor > OutputProcessor
which I have deployed into a cluster. My aim is to maintain as much portability as possible in my code and defer the JNI configuration to the deployment descriptors:
I tried configuring the Qs using a services file but it seems to only deploy the Qs on the first node and fail on all other nodes. The error reported on the other nodes was that the DestinationManager was missing, but was a requirement for the Q. If there is a better way to do this please let me know.
| <?xml version="1.0" encoding="UTF-8"?>
| <server>
| <mbean code="org.jboss.mq.server.jmx.Queue"
| name="jboss.mq.destination:service=Queue,name=BatchJobProcessorMDB">
| <attribute name="JNDIName">queue/BatchJobProcessors</attribute>
| <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
| </mbean>
| <mbean code="org.jboss.mq.server.jmx.Queue"
| name="jboss.mq.destination:service=Queue,name=TransactionProcessorsMDB">
| <attribute name="JNDIName">queue/TransactionProcessors</attribute>
| <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
| </mbean>
| <mbean code="org.jboss.mq.server.jmx.Queue"
| name="jboss.mq.destination:service=Queue,name=OutputProcessorsMDB">
| <attribute name="JNDIName">queue/OutputProcessors</attribute>
| <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
| </mbean>
| </server>
|
So I gave up on the option of using a services file and rely on the container to create teh queues for me.
In BatchJobProcessor :
| @Resource(name="jms/ConnectionFactory")
| private QueueConnectionFactory factory;
|
| @Resource(name="queue/TransactionProcessors")
| private Queue queue;
|
In TransactionProcessor :
| @Resource(name="jms/ConnectionFactory")
| private QueueConnectionFactory factory;
|
| @Resource(name="queue/OutputProcessors")
| private Queue queue;
|
Then I added the following to my ejb-jar.xml
| <message-driven>
| <ejb-name>BatchJobProcessor</ejb-name>
| <ejb-class>com.thunderhead.backend.BatchJobProcessor</ejb-class>
| <transaction-type>Bean</transaction-type>
| <resource-ref>
| <description/>
| <res-ref-name>jms/ConnectionFactory</res-ref-name>
| <res-type>javax.jms.QueueConnectionFactory</res-type>
| <res-auth>Container</res-auth>
| <mapped-name>jnp://localhost:1100/ConnectionFactory</mapped-name>
| </resource-ref>
| <resource-ref>
| <description/>
| <res-ref-name>queue/TransactionProcessors</res-ref-name>
| <res-type>javax.jms.Queue</res-type>
| <res-auth>Container</res-auth>
| <mapped-name>jnp://localhost:1100/queue/TransactionProcessors</mapped-name>
| </resource-ref>
| </message-driven>
|
I was hoping to do the final mapping to the real JNDI name in the jboss.xml file, however during deployment an error require me to add the mapped Name element.
It seems to me that message servers (factories and queue) only exist in the HAJNDI context and need to be looked up via jnp://localhost:1100/... My attempt to look up those services in the local JNDI context failed so far.
I do have the jboss.xml file configured, but it does not seem to have any effect. I wonder what I missed as I would prefer to keep the jboss specific binding to the real jndi name in a jboss specific configuration file.
| <message-driven>
| <ejb-name>BatchJobProcessor</ejb-name>
| <destination-jndi-name>queue/BatchJobProcessors</destination-jndi-name>
| <resource-ref>
| <res-ref-name>jms/ConnectionFactory</res-ref-name>
| <jndi-name>jnp://localhost:1100/ConnectionFactory</jndi-name>
| </resource-ref>
| <resource-ref>
| <res-ref-name>queue/TransactionProcessors</res-ref-name>
| <jndi-name>jnp://localhost:1100/queue/TransactionProcessors</jndi-name>
| </resource-ref>
| </message-driven>
|
Thanks in advance
Alex
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4093031#4093031
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4093031
18Â years, 7Â months
[JBoss Portal] - PortalNode Childrens and HibernateException because of permi
by speleomaniac
Hi everybody,
I have an interesting problem, out from the referance guide I am looking to the example 10.8.3 'Link to other pages' and I try to implement this with JSF Portlet Bridge and JSF RI 1.2 (Jboss version).
I am always hitting a permission error in hibernate level when I want to get the current portal node's parent's child's....
My assumption is that it must be something to do, that I am working with JSF Bridge, I look to the catalog portlet source code to get some clues but it doesn't do anything different then I am doing.
Only, it is based on JBossPortlet class and I have a feeling this class is doing some initialization work for the security. Naturally I can not use the same class with JSF bridge and this is the reason of my problems.
Can somebody confirm this or somebody has a better idea.
Thx in advance
Exception look like something like this.
13:33:29,818 ERROR [PortalPermissionCollection] Permission check against the repository failed
org.hibernate.HibernateException: Unable to locate current JTA transaction
at org.hibernate.context.JTASessionContext.currentSession(JTASessionContext.java:61)
at org.hibernate.impl.SessionFactoryImpl.getCurrentSession(SessionFactoryImpl.java:544)
at org.jboss.portal.core.impl.model.portal.PersistentPortalObjectContainer.getObjectNode(PersistentPortalObjectC
ontainer.java:242)
at org.jboss.portal.core.impl.model.portal.AbstractPortalObjectContainer.getPermission(AbstractPortalObjectConta
iner.java:166)
at org.jboss.portal.core.model.portal.PortalObjectPermission.implies(PortalObjectPermission.java:227)
at org.jboss.portal.security.PortalPermissionCollection.implies(PortalPermissionCollection.java:96)
at java.security.Permissions.implies(Permissions.java:165)
at org.jboss.security.jacc.ContextPolicy.implies(ContextPolicy.java:100)
at org.jboss.security.jacc.DelegatingPolicy.implies(DelegatingPolicy.java:204)
at org.jboss.portal.security.impl.jacc.JACCPortalAuthorizationManager.internalCheckPermission(JACCPortalAuthoriz
ationManager.java:215)
at org.jboss.portal.security.impl.jacc.JACCPortalAuthorizationManager.checkPermission(JACCPortalAuthorizationMan
ager.java:233)
at org.jboss.portal.security.impl.jacc.JACCPortalAuthorizationManager.checkPermission(JACCPortalAuthorizationMan
ager.java:258)
at org.jboss.portal.core.impl.api.node.PortalNodeImpl$NodeList.buildChildMap(PortalNodeImpl.java:372)
at org.jboss.portal.core.impl.api.node.PortalNodeImpl$Siblings.createMap(PortalNodeImpl.java:423)
at org.jboss.portal.core.impl.api.node.PortalNodeImpl$NodeList.getMap(PortalNodeImpl.java:336)
at org.jboss.portal.core.impl.api.node.PortalNodeImpl$NodeList.getList(PortalNodeImpl.java:320)
at org.jboss.portal.core.impl.api.node.PortalNodeImpl.getChildren(PortalNodeImpl.java:209)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4093024#4093024
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4093024
18Â years, 7Â months