Quantcast
Channel: Spring Community Forums - Remoting
Viewing all 18 articles
Browse latest View live

SSLServer allow_none

$
0
0
Would it be possible update the SSLServer to include the allow_none setting to the following code as found in xmlrpc.py line numbers included

51 class SSLServer(object, SimpleXMLRPCServer):
52 def __init__(self, host=None, port=None, keyfile=None, certfile=None,
53 ca_certs=None, cert_reqs=ssl.CERT_NONE, ssl_version=ssl.PROTOCOL_TLSv1,
54 do_handshake_on_connect=True, suppress_ragged_eofs=True, ciphers=None,
55 log_requests=True, **kwargs):
56
57 SimpleXMLRPCServer.__init__(self, (host, port), requestHandler=RequestHandler)

As shown below to allow the 'allow_none' paramater to be set:

51 class SSLServer(object, SimpleXMLRPCServer):
52 def __init__(self, host=None, port=None, keyfile=None, certfile=None,
53 ca_certs=None, cert_reqs=ssl.CERT_NONE, ssl_version=ssl.PROTOCOL_TLSv1,
54 do_handshake_on_connect=True, suppress_ragged_eofs=True, ciphers=None,
55 log_requests=True, allow_none=0, **kwargs):
56
57 SimpleXMLRPCServer.__init__(self, (host, port), requestHandler=RequestHandler, allow_none=allow_none)

So that the SSLServer can then be called at shown below:

my_server = SSLServer(host, port, keyfile, certfile, ca_certs, cert_reqs=cert_reqs, allow_none=True)

RMI newbie-- getting errors in STS for imports in client side app java code

$
0
0
Hi

I am trying to create an RMI service using Spring. The IDE I am using is the latest version of Spring Tool Suite.

I am following instructions as per this URL--> http://www.onlinetechvision.com/?p=510

Now, I have created the server-side code correctly, and the RMI server app context XML file is as below-->

<!-- Beans Declaration -->
<bean id="SampleTask" class="com.test.SampleTask" />



<!-- RMI Server Declaration -->
<bean class="org.springframework.remoting.rmi.RmiService Exporter">

<!-- serviceName represents RMI Service Name -->
<property name="serviceName" value="SampleTask"/>

<!-- service represents RMI Object(RMI Service Impl) -->
<property name="service" ref="SampleTask"/>

<!-- serviceInterface represents RMI Service Interface exposed -->
<property name="serviceInterface" value="com.test.Task"/>

<!-- defaults to 1099 -->
<property name="registryPort" value="1099"/>

</bean>

Now, I have created the client side app also, and in it this is the code-- (I have omitted the imports/package name)--basically a single variable of integer type is passed as command line param to the client JAR file. This parm is then used as param during call to RMI Service. (It is the only param in RMI invocation).



public class TestClient {

private static Logger logger = Logger.getLogger(TestClient .class);

/**
* Main method of the RMI Service Client
*
*/
public static void main(String[] args) {

logger.debug("RMI Service Client is starting...");

//RMI Client Application Context is started...
ApplicationContext context = new ClassPathXmlApplicationContext("rmiClientAppContex t.xml");

//Remote User Service is called via RMI Client Application Context...
SampleTaskrmiClient = (SampleTask) context.getBean("SampleTask");
int userid;
//get the user id for whom RMI is to be used...this was passed as an argument to the client JAR file...
if(args.length!=1)
System.exit(1);
else userid= Integer.parseInt(args[0]);

rmiClient.run(userid);


logger.debug("RMI Service Client is stopped...");
}
}

Also, the RMI Client App context XML file is as below--

<!-- RMI Client Declaration -->
<bean id="SampleTask" class="org.springframework.remoting.rmi.RmiProxyFa ctoryBean">

<!-- serviceUrl represents RMI Service Url called-->
<property name="serviceUrl" value="rmi://api.test.com:1099/SampleTask"/>

<!-- serviceInterface represents RMI Service Interface called -->
<property name="serviceInterface" value="com.test.Task"/>

<!-- refreshStubOnConnectFailure enforces automatic re-lookup of the stub if a
call fails with a connect exception -->
<property name="refreshStubOnConnectFailure" value="true"/>

</bean>


However I am getting errors in Eclipse-- basically for the 2 imports in client side java code-- the imports for "com.test.SampleTask" and "com.test.Task" are showing this error--> The import _ _ _ _ _ cannot be resolved.

What is wrong in my code? Is there some config/setting change that I have to make?

Thanks,
Arvind.

Is it possible to have a REST API as well as RMI based service, in the same java app

$
0
0
Hi

I am very new to Spring-> I am extremely impressed with its ease of use, and I want to use it to create a REST API, as well as an RMI service.

What I want to know is, is it possible to deploy a single java web app that exposes the RMI service as well as the REST API? If this can be done, what (if any) considerations do I have to keep in mind to avoid conflicts/problems b/w the REST and the RMI services?

Thanks,
Arvind.

RMI Newbie-- regarding securing an RMI service

$
0
0
Hello,

Please excuse me if my question seems silly to you-- I am very new to Spring...

I am trying to create an RMI service using Spring... I have been able to create a simple service (with some issues--> that is in another forum post :) ) - now what I would like to do is provide a safe and easily implementable means of authentication for the RMI Service.

Another concern--> will the entire server-side code be accessible by a client? What I mean is , suppose I have access to the server running the RMI service, while another user has access to the RMI client-- that user does not have access to the RMI Server... Can that user obtain the server side code(even though he does not have direct access to the RMI Server)? How (if possible) do I protect the server side code from unauthorised access - both by any user and by a user with RMI Client access?

Thanks,
Arvind.

RmiInvocationWrapper_Stub Issue. Only on Some Servers!

$
0
0
Summary:
Our application is Tomcat deployed, and we are using Spring 3.1.0. RMI communication works great when the server and client are both stand alone programs. When the server is deployed on Tomcat, I face issues.



Hello. We're facing a rather frustrating problem, we've have tried several things and have finally succeeded, but without an understanding of WHY.

We have an interface that has been exposed via the RMIServiceExporter. On our development network, the service can be accessed without any issues, irrespective of where (same host, or different host) the client is located.

On our staging network however, when the client is located on a different host, I first get the following exception-
Code:

java.lang.ClassNotFoundException: org.springframework.remoting.rmi.RmiInvocationWrapper_Stub (no security manager: RMI class loader disabled)
I was able to get around the issue above by specifying a security policy, and the issue was resolved in all but one instance where the server is running. I now got the following error on the client-
Code:

java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
        java.lang.ClassNotFoundException: org.springframework.remoting.rmi.RmiInvocationWrapper_Stub

I was able to resolve this too by including spring-remoting.jar in the classpath of the client program.

What I do not understand is why spring-remoting.jar is required in the client classpath for only one of the server instances.

Also, the client and server work great when the app is not deployed on Tomcat. When I run the server as a standalone program, there is absolutely no issue on any of the servers.

I first doubted that it may have something to do with the network configuration, since the only port open in the staging environment in addition to the standard HTTP, DB, etc. ports is 1099 (which was also used for the servicePort). I verified that 1099 was open by using telnet from the host where the client was running. Anything else I should have done?

For the sake of identifying the issue, we have now opened up all ports, but I am still required to include spring-remoting.jar in the client classpath.

What is different when the application is deployed on Tomcat?
How do i find what is different on the staging network?

Anything I'm missing here? I'd be grateful for some advice from those who may know what is going on. Thank you!

JAX-WS Injection using cxf in WebSphere 7.0.0.19

$
0
0
Hi All,
I am trying to implement JAX-WS using CXF, but unable to load WSDL . In IBM WebSphere 7.0.0.19 JAXWS engine is also disabled. Below are list of jar used:

FastInfoset-1.2.9.jar
aopalliance-1.0.jar
commons-logging-1.1.1.jar
cxf-2.5.2.jar
geronimo-activation_1.1_spec-1.1.jar
geronimo-annotation_1.0_spec-1.1.1.jar
geronimo-javamail_1.4_spec-1.7.1.jar
geronimo-jaxws_2.2_spec-1.1.jar
geronimo-stax-api_1.0_spec-1.0.1.jar
geronimo-ws-metadata_2.0_spec-1.1.3.jar
jars_in_war.txt
jaxb-api-2.2.3.jar
jaxb-impl-2.2.4-1.jar
neethi-3.0.1.jar
org.apache.servicemix.bundles.saaj-impl-1.3.18_1.jar
spring-aop-3.0.6.RELEASE.jar
spring-asm-3.0.6.RELEASE.jar
spring-beans-3.0.6.RELEASE.jar
spring-context-3.0.6.RELEASE.jar
spring-core-3.0.6.RELEASE.jar
spring-expression-3.0.6.RELEASE.jar
spring-web-3.0.6.RELEASE.jar
stax2-api-3.1.1.jar
woodstox-core-asl-4.1.1.jar
wsdl4j-1.6.2.jar
xmlschema-core-2.0.1.jar
XmlSchema-1.4.7.jar



Exception in system.out:

[4/17/13 18:11:45:125 GMT+05:30] 0000001e servlet E com.ibm.ws.webcontainer.servlet.ServletWrapper service SRVE0068E: Uncaught exception created in one of the service methods of the servlet CXFServlet in application TEST_EAR. Exception created : java.lang.NoSuchMethodError: org/apache/ws/commons/schema/XmlSchema.getSchemaDocument()Lorg/w3c/dom/Document;
at org.apache.cxf.service.model.SchemaInfo.getElement (SchemaInfo.java:109)
at org.apache.cxf.wsdl11.ServiceWSDLBuilder.buildType s(ServiceWSDLBuilder.java:267)
at org.apache.cxf.wsdl11.ServiceWSDLBuilder.build(Ser viceWSDLBuilder.java:188)
at org.apache.cxf.wsdl11.ServiceWSDLBuilder.build(Ser viceWSDLBuilder.java:148)
at org.apache.cxf.transport.http.WSDLQueryHandler.wri teResponse(WSDLQueryHandler.java:146)
at org.apache.cxf.transport.servlet.ServletController .invoke(ServletController.java:162)
at org.apache.cxf.transport.servlet.AbstractCXFServle t.invoke(AbstractCXFServlet.java:142)
at org.apache.cxf.transport.servlet.AbstractHTTPServl et.handleRequest(AbstractHTTPServlet.java:179)
at org.apache.cxf.transport.servlet.AbstractHTTPServl et.doGet(AbstractHTTPServlet.java:108)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:718)
at org.apache.cxf.transport.servlet.AbstractHTTPServl et.service(AbstractHTTPServlet.java:159)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.ser vice(ServletWrapper.java:1657)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.ser vice(ServletWrapper.java:1597)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.d oFilter(WebAppFilterChain.java:104)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain._ doFilter(WebAppFilterChain.java:77)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager .doFilter(WebAppFilterManager.java:908)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.han dleRequest(ServletWrapper.java:934)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.han dleRequest(ServletWrapper.java:502)
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl .handleRequest(ServletWrapperImpl.java:179)
at com.ibm.ws.webcontainer.webapp.WebApp.handleReques t(WebApp.java:3935)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequ est(WebGroup.java:276)
at com.ibm.ws.webcontainer.WebContainer.handleRequest (WebContainer.java:931)
at com.ibm.ws.webcontainer.WSWebContainer.handleReque st(WSWebContainer.java:1583)
at com.ibm.ws.webcontainer.channel.WCChannelLink.read y(WCChannelLink.java:186)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLi nk.handleDiscrimination(HttpInboundLink.java:452)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLi nk.handleNewRequest(HttpInboundLink.java:511)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLi nk.processRequest(HttpInboundLink.java:305)
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCa llback.complete(HttpICLReadCallback.java:83)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListe ner.futureCompleted(AioReadCompletionListener.java :165)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallbac k(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletion Actions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture .java:138)
at com.ibm.io.async.ResultHandler.complete(ResultHand ler.java:204)
at com.ibm.io.async.ResultHandler.runEventProcessingL oop(ResultHandler.java:775)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler .java:905)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.j ava:1604)


Please show some light on the above issue. Thanks in advance.

Invoking WS method accepting Array of Objects with JaxRpcPortProxyFactoryBean

$
0
0
I am invoking WS with JaxRpcPortProxyFactoryBean declaring the properties wsdlDocumentUrl, namespaceUri, serviceName, portName, serviceInterface, servicePostProcessors. And inside servicePostProcessors property I am using org.springframework.remoting.jaxrpc.support.AxisBe anMappingServicePostProcessor bean to declare encodingStyleUri, typeNamespaceUri and beanMappings. Encoding style used is soap-encoding.

This code works fine when I invoke the WS method which accepts the primitive type parameters. However, when I try to invoke a WS method which accepts Array of Objects it shows the following exception.

Caused by: Exception during processing: weblogic.xml.schema.binding.DeserializationExcepti on: mapping lookup failure. type=['java:com.abc.bean']:ns2:ArrayOfEmpBean schema context=TypedSchemaContext{javaType=com.abc.bean.E mpBean}

The WS method signature looks like String getDetails(EmpBean[] empBeanList)

I have already mapped EmpBean object within AxisBeanMappingServicePostProcessor in beanMappings property.

Any ideas regarding this would be a great help. Thanks.

teamviewer

$
0
0
can anybody tell me how can use teamviewer?

Spring JMS remoting not work in Spring Web

$
0
0
I have a trouble when integrate Spring JMS remoting in my web service

when i run web app and try make a remoting i have get an exception

Quote:

org.springframework.remoting.RemoteInvocationFailu reException: Invocation of method [public abstract java.lang.Long pageview.contract.CategoryDomainService.getPageVie wByDomainCategory(com.vcc.pageview.request.DomainC ategoryRequest)] failed in JMS invoker remote service at queue [queue://categoryDomainQueue]; nested exception is java.lang.NoSuchMethodException: $Proxy8.getPageViewByDomainCategory(com.vcc.pagevi ew.request.DomainCategoryRequest)
I think Spring have a problem when try to make Proxy for CategoryDomainService

When i use this code in stand alone application ( run as java application ) every thing work well

Can some one give me a solution to work around that ?? :(

Web Services

$
0
0
Dear Spring Community,

Is it possible to use Http Invoker and JAXWS in same application?
Currently i am using jboss 6 application server and I am using jdk1.6.
please tell me is it possible to two types of web services in one application.

Thanks & Regards,
Santosh J

While publishing service using HttpInvoker error is occured

$
0
0
I am developing Client Server application using HttpInvoker.

[JAVA]

web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
<display-name>OTV_SpringHttpInvoker</display-name>
<listener>
<listener-class>org.springframework.web.context.ContextLoade rListener</listener-class>
</listener>
<servlet>
<servlet-name>HttpUserService</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherSe rvlet</servlet-class>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>HttpUserService</servlet-name>
<url-pattern>/HttpUserService</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>/pages/index.xhtml</welcome-file>
</welcome-file-list>
</web-app>

HttpUserService-servlet.xml:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schem...-beans-3.0.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util-3.0.xsd">

<!-- Beans Declaration -->
<bean id="UserMap" class="java.util.concurrent.ConcurrentHashMap" />

<bean id="CacheService" class="com.otv.cache.service.CacheService">
<property name="userMap" ref="UserMap"/>
</bean>

<bean id="HttpUserService" class="com.otv.http.server.HttpUserService" >
<property name="cacheService" ref="CacheService"/>
</bean>

<!-- Http Invoker Service Declaration -->
<bean id="HttpUserServiceExporter" class="org.springframework.remoting.httpinvoker.Ht tpInvokerServiceExporter">

<!-- service represents Service Impl -->
<property name="service" ref="HttpUserService"/>

<!-- serviceInterface represents Http Service Interface exposed -->
<property name="serviceInterface" value="com.otv.http.server.IHttpUserService"/>

</bean>

<!-- Mapping configurations from URLs to request handler beans -->
<bean id="urlMapping" class="org.springframework.web.servlet.handler.Sim pleUrlHandlerMapping">
<property name="mappings">
<props>
<prop key="/HttpUserService">HttpUserServiceExporter</prop>
</props>
</property>
</bean>

</beans>


[/JAVA]

Using above code I published service. But while checking this service the following occurs in console.
[JAVA]
17:13:13,925 INFO [Log4jService$URLWatchTimerTask] Configuring from URL: resource:jboss-log4j.xml
17:13:39,310 ERROR [[HttpUserService]] Servlet.service() for servlet HttpUserService threw exception
java.io.EOFException
at java.io.ObjectInputStream$PeekInputStream.readFull y(Unknown Source)
at java.io.ObjectInputStream$BlockDataInputStream.rea dShort(Unknown Source)
at java.io.ObjectInputStream.readStreamHeader(Unknown Source)
at java.io.ObjectInputStream.<init>(Unknown Source)
at org.springframework.core.ConfigurableObjectInputSt ream.<init>(ConfigurableObjectInputStream.java:47)
at org.springframework.remoting.rmi.CodebaseAwareObje ctInputStream.<init>(CodebaseAwareObjectInputStrea m.java:81)
at org.springframework.remoting.rmi.RemoteInvocationS erializingExporter.createObjectInputStream(RemoteI nvocationSerializingExporter.java:105)
at org.springframework.remoting.httpinvoker.HttpInvok erServiceExporter.readRemoteInvocation(HttpInvoker ServiceExporter.java:114)
at org.springframework.remoting.httpinvoker.HttpInvok erServiceExporter.readRemoteInvocation(HttpInvoker ServiceExporter.java:95)
at org.springframework.remoting.httpinvoker.HttpInvok erServiceExporter.handleRequest(HttpInvokerService Exporter.java:72)
at org.springframework.web.servlet.mvc.HttpRequestHan dlerAdapter.handle(HttpRequestHandlerAdapter.java: 49)
at org.springframework.web.servlet.DispatcherServlet. doDispatch(DispatcherServlet.java:790)
at org.springframework.web.servlet.DispatcherServlet. doService(DispatcherServlet.java:719)
at org.springframework.web.servlet.FrameworkServlet.p rocessRequest(FrameworkServlet.java:644)
at org.springframework.web.servlet.FrameworkServlet.d oGet(FrameworkServlet.java:549)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:690)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:803)
at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doF ilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:175)
at org.jboss.web.tomcat.security.SecurityAssociationV alve.invoke(SecurityAssociationValve.java:179)
at org.jboss.web.tomcat.security.JaccContextValve.inv oke(JaccContextValve.java:84)
at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:102)
at org.jboss.web.tomcat.service.jca.CachedConnectionV alve.invoke(CachedConnectionValve.java:157)
at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:262)
at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run( JIoEndpoint.java:446)
at java.lang.Thread.run(Unknown Source)
17:14:13,925 INFO [Log4jService$URLWatchTimerTask] Configuring from URL: resource:jboss-log4j.xml

[/JAVA]

How to resolve this ?

And anyone help me to give a sample program to implement client server program using httpinvoker for 2 different systems.

Using JMS as exposed Service

$
0
0
Hi,

I'm evaluating how to properly send data to a remote Websphere MQ Queue by using Spring 3.2.1.
Prerequisites:
- I want to access this WMQ Queue by using JMS with JNDI names to not depend directly on IBM WMQ libraries.
- I want to use javaconfig and not XML configuration.
I'm using JBoss EAP 6.0.1. the JNDI names are defined in the standalone.xml "MQConnectionFactory" is a "connection-definition" and "MQQueue" is an "admin-object".

At first I tried to use JMSTemplate:

Code:

@Configuration
public class JmsMonitoringConfiguration {

        @Bean
        public JmsTemplate jmsTemplate() throws NamingException {
                JndiObjectFactoryBean connection = new JndiObjectFactoryBean();
                connection.setJndiName("java:/MQConnectionFactory");
                connection.afterPropertiesSet();

                JndiObjectFactoryBean destination = new JndiObjectFactoryBean();
                destination.setJndiName("java:/MQQueue");
                destination.afterPropertiesSet();

                JmsTemplate jmsTemplate = new JmsTemplate();
                jmsTemplate.setConnectionFactory((ConnectionFactory) connection.getObject());
                jmsTemplate.setDefaultDestination((Destination) destination.getObject());
                jmsTemplate.setReceiveTimeout(20000);
                jmsTemplate.afterPropertiesSet();
                return jmsTemplate;

        }
}

My example-Java-Code to utilize this bean is:

Code:

@Component
public class TestResource {
        @Inject
        JmsTemplate jmsTemplate;

        public test() {

                jmsTemplate.send(new MessageCreator() {
                        @Override
                        public Message createMessage(Session session) throws JMSException {
                                return session.createTextMessage("hello queue world");
                        }
                });

        }
}

This seems to work without any notable problems.


I now discovered JmsInvokerProxyFactoryBean and this sounds even better than JMSTemplate and I decided to use this:

Code:

@Configuration
public class JmsMonitoringServiceConfiguration {

        @Bean
        public ISender sender() throws NamingException {

                JndiObjectFactoryBean connection = new JndiObjectFactoryBean();
                connection.setJndiName("java:/MQConnectionFactory");
                connection.afterPropertiesSet();

                JmsInvokerProxyFactoryBean invokerProxy = new JmsInvokerProxyFactoryBean();
                invokerProxy.setServiceInterface(IMonitoringSender.class);
                invokerProxy.setConnectionFactory((ConnectionFactory) connection.getObject());
                invokerProxy.setDestinationResolver(new JndiDestinationResolver());
                invokerProxy.setQueueName("java:/MQQueue");
                //invokerProxy.setReceiveTimeout(20000);

                invokerProxy.afterPropertiesSet();

                return (ISender) invokerProxy.getObject();
        }
}

The interface definition is:

Code:

public interface ISender {
        public void sendData(String daten);
}

My Test-Code is:

Code:

@Component
public class TestResource {
        @Inject
        ISender sender;

        public test() {

                sender.sendData("23");

        }
}

Now the execution waits in JmsInvokerClientInterceptor Line 366 and does not continue.

Code:

                        return (timeout > 0 ? consumer.receive(timeout) : consumer.receive());
The JNDI Lookups seem to work perfectly fine for both lookups as I inspected the Objects in JmsInvokerClientInterceptor.executeRequest.
When I set a RecieveTimeout and re-execute the test-code the timeout is reached and I'm now getting an exception instead of a not-ending-java process:

Code:

15:21:59,144 ERROR [....MiddlewareExceptionMapper] (http-localhost/127.0.0.1:8080-1) Could not access JMS invoker queue [java:/MQQueue]; nested exception is javax.jms.MessageFormatException: Invalid response message: null: org.springframework.remoting.RemoteAccessException: Could not access JMS invoker queue [java:/MQQueue]; nested exception is javax.jms.MessageFormatException: Invalid response message: null
        at org.springframework.jms.remoting.JmsInvokerClientInterceptor.convertJmsInvokerAccessException(JmsInvokerClientInterceptor.java:431) [org.springframework.jms-3.2.1.RELEASE.jar:3.2.1.RELEASE]
        at org.springframework.jms.remoting.JmsInvokerClientInterceptor.invoke(JmsInvokerClientInterceptor.java:204) [org.springframework.jms-3.2.1.RELEASE.jar:3.2.1.RELEASE]
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) [org.springframework.aop-3.2.1.RELEASE.jar:3.2.1.RELEASE]
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) [org.springframework.aop-3.2.1.RELEASE.jar:3.2.1.RELEASE]

Greetings, OlliL

Transaction Propagation through Weblogic RMI

$
0
0
Hi guys,

I've read that is possible to propagate a current transaction over RMI when the application is running on Weblogic, but I've tried unsuccessfully.

Could anyone give me an example of that? There is some special configuration?

Thanks in advance.

Possibility to export referenced objects

$
0
0
Dear Community,

I have the following setup at a Server:
Code:

interface Loader
{
ReferencedObject getObject()
}

class IsNotSerializable implements ReferencedObject
{
public void doSomethingOnServer()
{

}
}

Is it possible to implement this in Spring's Remoting in a way that the method "doSomethingOnServer" will be executed at the server like in a UnicastRemoteObject in RMI if I call this at the client?

Thanks in advance
Fynn

Http Invoker through a reverse proxy


Spring HTTP invoker remoting, Basic Auth and Retry

$
0
0
Here's my scenario. Using Spring HTTP invoker, HTTP client, basic authentication and storing cookies for subsequent requests (a custom request executor) so I don't have to pass BA for every request. If the cookie expires then I get a 401 (unauthenticated) from the proxy so I want to retry passing the BA in the header again, get the new cookie back, and continue. So I need to configure an HTTP client retry handler. Does anyone know of a good Spring XML file example for configuring this? I'll try to post my current Spring configuration file tomorrow when I'm back at work.

Spring JMS Remoting Limitation

$
0
0
All,

We have an external facing web site that needs to invoke back end services via JMS. The proposed solution is to use Spring remoting via JMS. However, the online document says

The JMS remoting support in the Spring Framework is pretty basic - it sends and receives on the same thread and in the same non-transactional Session, and as such throughput will be very implementation dependent.

can some one please explain what does it mean exactly and can we use JMS rempoting in my scenario?

thanks all!

Intro:

$
0
0
Hi,


I am new to this forum...


Moving Company in K.K Nagar Chennai


Thank you...
Viewing all 18 articles
Browse latest View live