[JBossWS] - Call properties
by alesj
Regarding (basic) authentication from annotated web client (@WebServiceClient) I added the following code:
| JSR181ClientMetaDataBuilder.rebuildEndpointMetaData
|
| // Process @CallProperties
| if (wsClass.isAnnotationPresent(CallProperties.class))
| processCallProperties(epMetaData, wsClass);
|
| JSR181MetaDataBuilder
|
| protected void processCallProperties(EndpointMetaData epMetaData, Class wsClass)
| {
| CallProperties callProperties = (CallProperties) wsClass.getAnnotation(CallProperties.class);
|
| int length = callProperties.keys().length;
| if (length > 0)
| {
| Properties properties = epMetaData.getProperties();
| if (properties == null)
| {
| epMetaData.setProperties(new Properties());
| }
| }
|
| if (length != callProperties.values().length)
| {
| throw new IllegalArgumentException("Different lenght of call properties: keys != values");
| }
|
| for(int i = 0; i < length; i++)
| {
| epMetaData.getProperties().setProperty(callProperties.keys(), callProperties.values());
| }
| }
|
So that when we do SOAPConnectionImpl.getRemotingMetaData we actually get username / password call properties.
Example:
| @WebService
| @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
| @CallProperties(
| keys = {"javax.xml.rpc.security.auth.username", "javax.xml.rpc.security.auth.password"},
| values = {"tomcat", "tomcat"}
| )
| public interface AccountService {
|
| @WebMethod
| @WebResult(name = "createAccountReturn")
| Account createAccount(String username);
|
| @WebMethod
| @Oneway
| void insertAccount(Account account);
|
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3984878#3984878
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3984878
19Â years, 7Â months
[Persistence, JBoss/CMP, Hibernate, Database] - NullPointerException when adding values to one-many relation
by santins
Hi All,
I have two Entity beans (CMP persistence) that have a relation one to many. When I try to populate that relation jboss 4.0.5 GA is giving me this exception:
13:19:43,921 ERROR [LogInterceptor] RuntimeException in method: public abstract void softiam.services.ejbs.experiment.Ex
periment.setConfiguration(java.util.Collection) throws java.rmi.RemoteException:
java.lang.NullPointerException
at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBridge.getRelatedPrimaryKey(JDBCCMRFieldBridge.java:1862)
at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBridge.setInstanceValue(JDBCCMRFieldBridge.java:857)
at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMRFieldBridge.setValue(JDBCCMRFieldBridge.java:723)
at org.jboss.ejb.plugins.cmp.bridge.EntityBridgeInvocationHandler$FieldSetInvoker.invoke(EntityBridgeInvocationH
andler.java:170)
at org.jboss.ejb.plugins.cmp.bridge.EntityBridgeInvocationHandler.invoke(EntityBridgeInvocationHandler.java:105)
at org.jboss.proxy.compiler.Runtime.invoke(Runtime.java:76)
at softiam.services.ejbs.experiment.ExperimentEJB$Proxy.setConfiguration()
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.invocation.Invocation.performCall(Invocation.java:359)
at org.jboss.ejb.EntityContainer$ContainerInterceptor.invoke(EntityContainer.java:1187)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCRelationInterceptor.invoke(JDBCRelationInterceptor.java:87)
at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invoke(EntitySynchronizationInterceptor.java:284)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:158)
at org.jboss.ejb.plugins.EntityReentranceInterceptor.invoke(EntityReentranceInterceptor.java:126)
at org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(EntityInstanceInterceptor.java:276)
at org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockInterceptor.java:104)
at org.jboss.ejb.plugins.EntityCreationInterceptor.invoke(EntityCreationInterceptor.java:68)
at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:168)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:136)
at org.jboss.ejb.EntityContainer.internalInvoke(EntityContainer.java:527)
at org.jboss.ejb.Container.invoke(Container.java:954)
at sun.reflect.GeneratedMethodAccessor79.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.invocation.local.LocalInvoker$MBeanServerAction.invoke(LocalInvoker.java:169)
at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:118)
at org.jboss.invocation.InvokerInterceptor.invokeLocal(InvokerInterceptor.java:209)
at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:195)
at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:61)
at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:70)
at org.jboss.proxy.ejb.EntityInterceptor.invoke(EntityInterceptor.java:112)
at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:100)
at $Proxy57.setConfiguration(Unknown Source)
at softiam.services.ui.gwtui.server.SoftIAMServiceImpl.experimentConfigurationSet(SoftIAMServiceImpl.java:211)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:260)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServlet.java:147)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:524)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java
:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Thread.java:595)
I have checked the definition and implementation of the relation and all seems ok.
Can anybody help with this?
Many thanks,
Santi
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3984876#3984876
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3984876
19Â years, 7Â months
[Messaging, JMS & JBossMQ] - Problems creating a new JMS provider
by ewinston
I am tring to create a new JMS provider using the standard jboss provider. I created a custom myds-ds.xml that contains the following :
| <mbean code="org.jboss.jms.jndi.JMSProviderLoader"
| name="jboss.mq:service=JMSProviderLoader,name=myJMSProvider">
| <attribute name="ProviderName">myJMSProvider</attribute>
| <attribute name="ProviderAdapterClass"> org.jboss.jms.jndi.JNDIProviderAdapter </attribute>
| <!-- The combined connection factory -->
| <attribute name="FactoryRef">java:/myConnectionFactory</attribute>
| <!-- The queue connection factory -->
| <attribute name="QueueFactoryRef">java:/myQueueConnectionFactory</attribute>
| <!-- The topic factory -->
| <attribute name="TopicFactoryRef">java:/myTopicConnectionFactory</attribute>
| </mbean>
|
| <no-tx-connection-factory>
| <jndi-name>hpomsTopicConnectionFactory</jndi-name>
| <rar-name>jms-ra.rar</rar-name>
| <connection-definition>org.jboss.resource.adapter.jms.JmsConnectionFactory</connection-definition>
| <config-property name="SessionDefaultType" type="java.lang.String">javax.jms.Topic</config-property>
| <config-property name="JmsProviderAdapterJNDI" type="java.lang.String"
| >java:/hpomsJMSProvider</config-property>
| <max-pool-size>20</max-pool-size>
| </no-tx-connection-factory>
|
The factories show up in the jndi context, but when i try to use them with the following code :
| Topic jcTopic = lookupJobCancelTopic(context);
| TopicConnectionFactory tcf = lookupTopicConnectionFactory(context);
| TopicConnection tc = tcf.createTopicConnection();
| tc.start();
| ConnectionMetaData md = tc.getMetaData();
| TopicSession ts = tc.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
| TopicSubscriber tr = ts.createSubscriber(jcTopic);
|
it fails when trying to create the topic session. If I change the deployment descriptor to use the default JMSProvider then the code works just fine. I have created a topic to use for this test. Is there something else that I need to do in order to create a custom provder?
I am using JBoss 4.0.5GA, running on Linux with the 64bit JDK 1.5.0_9.
Thanks,
edward
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3984871#3984871
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3984871
19Â years, 7Â months