Recent Posts
Archives

Posts Tagged ‘Jonathan Lalou’

PostHeaderIcon WebLogic Deployment with Maven: Dynamic Property Settings

Case

You have to deploy a WAR archive on a WebLogic server. To simplify the deployment process, you use weblogic-maven-plugin. Then, you only have to launch a mvn clean install weblogic:deploy to compile and deploy the WAR.

Actually, the plugin configuration expects you to hard write the settings in the pom.xml, such as:

[xml]<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>weblogic-maven-plugin</artifactId>
<version>2.9.1</version>
<configuration>
<name>myWebApplication-web</name>
<adminServerHostName>localhost</adminServerHostName>
<adminServerPort>7001</adminServerPort>
<adminServerProtocol>t3</adminServerProtocol>
<targetNames>myTargetServer</targetNames>
<userId>myUserId</userId>
<password>myPassword</password>
<securitymodel>Advanced</securitymodel>
<artifactPath>${project.build.directory}/myWebApplication-web.war</artifactPath>
</configuration>
</plugin>[/xml]

Yet, when you work on a multi-environment / multi-developper platform, hard writing the properties bothers. Production teams are not pleased, and, above all, it’s not safe.

Unworking fix

At first glance, I tried to use Maven filtering mechanisms. Anyway, this features was designed for compilation phase: properties are recopied from a property file to the actual one, and then included in the archive generated (may it be JAR, EAR or WAR); in a deployment phase, properties are not taken in account.
http://maven.apache.org/guides/getting-started/index.html#How_do_I_filter_resource_files

Unelegant fix

Another solution is to set properties by profile. This works, but is not elegant at all: the password for production environment has to reason to be readable in the pom.xml used by a developper!

Fix

WebLogic / Maven plugin

Add the following block:

[xml]<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>weblogic-maven-plugin</artifactId>
<version>2.9.1</version>
<configuration>
<name>myWebApplication-web</name>
<adminServerHostName>${weblogic.server.name}</adminServerHostName>
<adminServerPort>${weblogic.server.port}</adminServerPort>
<adminServerProtocol>${weblogic.server.protocol}
</adminServerProtocol>
<targetNames>${weblogic.target}</targetNames>
<userId>${weblogic.user}</userId>
<password>${weblogic.password}</password>
<securitymodel>${weblogic.security}</securitymodel>
<artifactPath>${project.build.directory}/myWebApplication-web.war
</artifactPath>
</configuration>
</plugin>[/xml]

Properties / Maven plugin

Under the tag, add the block:

[xml]<properties>
<weblogic.server.name>${myTargetServer.server.name}</weblogic.server.name>
<weblogic.server.port>${myTargetServer.server.port}</weblogic.server.port>
<weblogic.server.protocol>${myTargetServer.server.protocol}</weblogic.server.protocol>
<weblogic.user>${myTargetServer.user}</weblogic.user>
<weblogic.password>${myTargetServer.password}</weblogic.password>
<weblogic.target>${myTargetServer.target}</weblogic.target>
<weblogic.security>${myTargetServer.security}</weblogic.security>
</properties>[/xml]

Within the block, add the the following block:

[xml]
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0-alpha-2</version>
<executions>
<execution>
<phase>initialize</phase>
<goals>
<goal>read-project-properties</goal>
</goals>
<configuration>
<files>
<file>conf/${maven.user}.myTargetServer.properties</file>
</files>
</configuration>
</execution>
</executions>
</plugin>[/xml]

Settings.xml

Optionnaly, in your settings.xml, in your default profile, set the following property:

[xml]<profile></pre>
<id>myDefaultProfile</id>
<properties>
<maven.user>jonathan_lalou</maven.user>
</properties>
</profile>[/xml]

You can decide to bypass this step. In this case, you will have to add the following parameter on launching Maven:
-Dmaven.user=jonathan_lalou

Property file

Create a property file, with a name corresponding to the one you specified in maven.user property.

[java]
myTargetServer.server.name=localhost
myTargetServer.server.port=7001
myTargetServer.server.protocol=t3
myTargetServer.user=myUserId
myTargetServer.password=myPassword
myTargetServer.target=myTargetServer
myTargetServer.security=Advanced[/java]

Now, you can launch mvn package weblogic:deploy. The WAR will be deployed on the right server.

PostHeaderIcon Dynamic serviceUrl with Spring’s HttpInvokerProxyFactoryBean

Abstract

How to set dynamically the URL used by a HttpInvokerProxyFactoryBean in a Spring-deployed WAR?

Detailed Case

I have to deploy a GWT/GXT application, calling two distant services:
a remote EJB
a service accessed through Spring Remoting

Here is the Spring configuration file I firstly used:

[xml]
<util:properties id="jndiProperties" location="classpath:jndi.properties"/>
<jee:remote-slsb id="myRemoteEJBService" jndi-name="ejb.remote.myRemoteService"
business-interface="lalou.jonathan.myRemoteEJBService"
environment-ref="jndiProperties" cache-home="false"
lookup-home-on-startup="false" refresh-home-on-connect-failure="true" />

<bean id="mySpringRemoteService"
class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">
<property name="serviceInterface"
value="lalou.jonathan.services.mySpringRemoteService" />
<property name="serviceUrl" value="${spring.remote.service.url}"/>
</bean>
[/xml]

Unhappily, even though the remote EJB is retrieved (which proves that the jndi file is available in the classpath and rightly loaded), the Spring Remote service is not. I had to write the URL in hard in the configuration file… This is not very efficient when you work in a large team, with different production and testings environments!

This is the log when myRemoteEJBService bean is loaded:
[java]2010-08-17 16:05:42,937 DEBUG support.DefaultListableBeanFactory – Creating shared instance of singleton bean ‘myRemoteEJBService’
2010-08-17 16:05:42,937 DEBUG support.DefaultListableBeanFactory – Creating instance of bean ‘myRemoteEJBService’
2010-08-17 16:05:42,937 DEBUG support.DefaultListableBeanFactory – Eagerly caching bean ‘myRemoteEJBService’ to allow for resolving potential circular references
2010-08-17 16:05:42,937 DEBUG support.DefaultListableBeanFactory – Returning cached instance of singleton bean ‘jndiProperties’
2010-08-17 16:05:42,937 DEBUG support.DefaultListableBeanFactory – Invoking afterPropertiesSet() on bean with name ‘myRemoteEJBService’
2010-08-17 16:05:42,937 DEBUG framework.JdkDynamicAopProxy – Creating JDK dynamic proxy: target source is EmptyTargetSource: no target class, static
2010-08-17 16:05:42,953 DEBUG support.DefaultListableBeanFactory – Finished creating instance of bean ‘myRemoteEJBService'[/java]

That is the log when mySpringRemoteService is loaded:
[java]2010-08-17 16:05:42,968 DEBUG support.DefaultListableBeanFactory – Creating shared instance of singleton bean ‘mySpringRemoteService’
2010-08-17 16:05:42,968 DEBUG support.DefaultListableBeanFactory – Creating instance of bean ‘mySpringRemoteService’
2010-08-17 16:05:42,984 DEBUG support.DefaultListableBeanFactory – Eagerly caching bean ‘mySpringRemoteService’ to allow for resolving potential circular references
2010-08-17 16:05:43,234 DEBUG support.DefaultListableBeanFactory – Invoking afterPropertiesSet() on bean with name ‘mySpringRemoteService’
2010-08-17 16:05:43,250 DEBUG framework.JdkDynamicAopProxy – Creating JDK dynamic proxy: target source is EmptyTargetSource: no target class, static
2010-08-17 16:05:43,250 DEBUG support.DefaultListableBeanFactory – Finished creating instance of bean ‘mySpringRemoteService'[/java]

You can notice that no mention to jndiProperties appears. Here is the key of the problem: jndiProperties is considered as a bean among others, which cannot be accessed easyly from the HttpInvokerProxyFactoryBean.

Fix

To fix the issue, you have to add an actual property holder in Spring XML configuration file, ie after:

[xml]<util:properties id="jndiProperties" location="classpath:jndi.properties"/>[/xml]

add an instanciation of PropertyPlaceholderConfigurer:

[xml]<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location" value="classpath:jndi.properties"/>
</bean>[/xml]

PostHeaderIcon No source code is available for type … ; did you forget to inherit a required module?

Context

In a GWT application, you have to use RPC calls, using entities which are package in external jar archives. With Eclipse, no error appears ; yet when you build the project with Maven2, you get this message:

[java][INFO] [ERROR] Errors in ‘file:/C:/eclipse/workspace/myGwtProject/src/java/com/lalou/jonathan/web/gwt/client/component/JonathanPanel.java’
(…)
[INFO] [ERROR] Line 24: No source code is available for type com.lalou.jonathan.domain.MyEntity; did you forget to inherit a required module?
(…)
[INFO] Finding entry point classes[/java]

Fix

In related jar

In the project to which MyEntity belongs to (here: my/depended/project):

  • create a file com/lalou/jonathan/MyDependedProject.gwt.xml, with as content:

    [xml]<module>
    <source path="">
    <include name="**/MyEntity.java"/>
    </source>
    </module>[/xml]

  • In the pom.xml:
    • Add the source MyEntity.java in built jar. This way, the Java file itself will be considered as a resource, like an XML or property file. To perform this, the quickest manner is to add the following block in the pom.xml:
      [xml]<resources>
      <resource>
      <directory>${basedir}/src/java</directory>
      <includes>
      <include>**/MyEntity.java</include>
      </includes>
      </resource>
      </resources>[/xml]
    • Add an <include>**/*.gwt.xml</include> so that to have to MyDependedProject.gwt.xml file in the built jar.

    In GWT project

    In your *.gwt.xml file, add the dependency:

    [xml]<inherits name=’com.lalou.jonathan.MyDependedProject’ />[/xml]

    Caution!

    All these operations need be done on all dependencies -either direct or indirect-. Therefore, possibly you may have a huge amount of code to be got.
    Another issue appears when you use a jar of which you do not have the source code, such as in the case of tiers API for instance.

PostHeaderIcon GWT: call a remote EJB with Spring lookup

Abstract

Let’s assume you have followed the article “Basic RPC call with GWT“. Now you would like to call an actual EJB 2 as remote, via a Spring lookup.
Let’s say: you have an EJB MyEntrepriseComponentEJB, which implements an interface MyEntrepriseComponent. This EJB, generates a remote MyEntrepriseComponentRemote.

Entry Point

In myApplication.gwt.xml entry point file, after the line:

[xml]<inherits name=’com.google.gwt.user.User’/>[/xml]

add the block:

[xml]
<inherits name=’com.google.gwt.user.User’ />
<inherits name="com.google.gwt.i18n.I18N" />
<inherits name="com.google.gwt.http.HTTP" />[/xml]

Add the line:

[xml]<servlet path=’/fooService.do’/>[/xml]

Client

Under the *.gwt.client folder:

Update the service interface. Only the annotation parameter is amended:

[java]@RemoteServiceRelativePath("services/fooService")
public interface FooService extends RemoteService {
public String getHelloFoo(String fooName);
}[/java]

You have nothing to modify in asynchronous call interface (FooServiceAsync).

Server

Under the *.gwt.server folder, update the implementation for service interface:

Change the super-class, replacing RemoteServiceServlet with GWTSpringController:

[java]public class FooServiceImpl extends GWTSpringController implements FooService {
public FooServiceImpl() {
// init
}
}
[/java]

Add new field and its getter/setter:

[java]// retrieved via Spring
private myEntrepriseComponent myEntrepriseComponent;

public myEntrepriseComponent getMyEntrepriseComponent() {
return myEntrepriseComponent;
}

public void setmyEntrepriseComponent(myEntrepriseComponent _myEntrepriseComponent) {
myEntrepriseComponent = _myEntrepriseComponent;
}[/java]

Write the actual call to EJB service:

[java]
public String getHelloFoo(String fooName) {
return myEntrepriseComponent.getMyDataFromDB();
}
}[/java]

web.xml

Fill the web.xml file:

[xml]<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>

<!– Spring –>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

<servlet>
<servlet-name>gwt-controller</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
<servlet-name>gwt-controller</servlet-name>
<url-pattern>/myApplication/services/*</url-pattern>
</servlet-mapping>

<!– Default page to serve –>
<welcome-file-list>
<welcome-file>MyApplicationGwt.html</welcome-file>
</welcome-file-list>

</web-app>
[/xml]

JNDI

Add a jndi.properties file in src/resources folder:

[java]
java.naming.provider.url=t3://localhost:12345
java.naming.factory.initial=weblogic.jndi.WLInitialContextFactory
java.naming.security.principal=yourLogin
java.naming.security.credentials=yourPassword
weblogic.jndi.enableDefaultUser=true[/java]

These properties will be used by Spring to lookup the remote EJB. The last option is very important, otherwise you may happen to face issues with EJB if they were deployed under WebLogic.

WEB-INF

In the WEB-INF folder, add an applicationContext.xml file:

[xml]<?xml version="1.0" encoding="UTF-8"?>
<beans>

<util:properties id="jndiProperties" location="classpath:jndi.properties" />

<jee:remote-slsb id="myEntrepriseComponentService"
jndi-name="ejb.jonathan.my-entreprise-component"
business-interface="lalou.jonathan.myApplication.services.myEntrepriseComponent"
environment-ref="jndiProperties" cache-home="false"
lookup-home-on-startup="false" refresh-home-on-connect-failure="true" />

</beans>[/xml]

Add a gwt-controller-servlet.xml file:

[xml]<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd">

<bean>
<property name="order" value="0" />
<property name="mappings">
<value>
/fooService=fooServiceImpl
</value>
</property>
</bean>

<bean id="fooServiceImpl"
class="lalou.jonathan.myApplication.web.gwt.server.FooServiceImpl">
<property name="myEntrepriseComponent" ref="myEntrepriseComponentService" />
</bean>
</beans>
[/xml]

Of course, if your servlet mapping name in web.xml is comoEstasAmigo, then rename gwt-controller-servlet.xml as comoEstasAmigo-servlet.xml 😉

Build and deploy

Now you can compile, package your war and deploy under Tomcat or WebLogic. WebLogic server may raise an error:
java.rmi.AccessException: [EJB:010160]Security Violation: User: '<anonymous>' has insufficient permission to access EJB
This error is related to the rights required to call a method on the EJB. Indeed, two levels of rights are used by WebLogic: firstly to lookup / instanciate the EJB (cf. the property java.naming.security.principal we set sooner), and another to call the method itself. In this second case, WebLogic requires an authentication (think of what you do when you login an web application deployed: your login and rights are kept for all the session) to grant the rights. I wish to handle this subject in a future post.

NB: thanks to David Chau and Didier Girard from SFEIR, Sachin from Mumbai team and PYC from NYC.

PostHeaderIcon WebLogic 10.x new features

Recent history

BEA WebLogic 9.0, 9.1 and 9.2 were released from 2007: the main features were: a new console, WLST (WebLogic ScriptingTool), deployment plans, WebLogic Diagnostic Framework (WLDF), new security providers (RDBMS, SAML 1.1, etc.), JMS performance improvements, support of Java EE 4, JDK 5, Spring, OpenJPA, Kodo, etc.

Since this date, some events happened:

  • Oracle bought Sun (2009)
  • Oracle released WebLogic 10.3 (2008)
  • Oracle bought BEA (2008)

WebLogic Server 10 General Features

  • Developer productivity ehancements
    • JDK 6, Java EE 5
    • Support of EJB3 and JPA
    • BEA enhancements
  • Web Services: more annotations, less XML
    • JAX-RPC Web Services Enhancements
    • JAX-WS 2.0 Web Services Implementation
  • Misc:
    • Better administration console
    • Auto-Record of Admin Console actions as WLST scripts
    • Automatic JTA Transaction Recovery Service (TRS) migration
    • SNMP 3.0
    • Production Application Redeployment enhancements
    • Clustering – Unicast messaging (in addition to Multicast)

Programmer Perspective

  • New persistence engine: TopLink
  • OEPE (Oracle Entreprise Pack for Eclipse): sequence of tools and plugins for Eclipse: remote deployment, debugging,  editors for weblogic.xml and weblogic-application.xml, wizards, facets, Weblogic ClientGen, WSDLC and JAXB wizards
  • Optimizations for Spring integration and certication
  • Web 2.0:
    • Ajax / Dojo client support
    • Http publish / submit engine for collaborative applications:
      • Bayeux protocol
      • data exchange within applications over persistent connections
      • scalability for Dojo clients
  • Ad-hoc tools for:
    • Oracle Database
    • Spring
    • JAX-WS webservices

Lightweight WebLogic Server

WebLogic 10 offers a light weight server:

  • Install only “core” WebLogic server
  • Optionally, startup other services (JDBC, EJB, JMS, etc.)
  • FastSwap: modify classes without requiring redeployment.

Architect Perspective

Architects have to consider WebLogic as a complete suite, and not only WebLogic Server:

  • Oracle RAC integration: Connectivity to RAC with load balancing, failover, transactions
  • Enterprise Messaging with JMS: High performance and reliable JMS messaging engine “built-in”
  • ActiveCache with Coherence*Web and EJB/JPA: Coherence Data Grid caching included and integrated
  • Operations Automation: Tools for automating management of applications and servers
  • Operations Insight: Tools for diagnosing problems in development and production
  • Other features
    • Development tools: Choice of tools for developer productivity
    • Web Services: Enterprise Web Services for SOA
    • TopLink: Persist application data to stores with performance and productivity. It works in a way similar to Hibernate L2 cache.
    • Spring: Enable flexible choice of dev frameworks with same WebLogic QOS

Production and Support Perspective

WebLogic 10 provides a tool: JRockit Mission Control

  • monitors more than 150 parameters:
  • CPU
    • memory
    • leaks
    • latency spikes
    • threads
    • object references
    • JDBC connections
    • JMS
    • pools
    • clusters
    • configuration files
    • etc.
  • allows to compare WebLogic domains
  • Runtime Analyzer: runtime capture for offline analysis, Garbage Collector analysis, etc.

Coherence – ActiveCache

Coherence is the Data Grid offered by Oracle. It allows to store Java objects in memory, and share them between all instances. From a certain viewpoint, Coherence looks like the GigaSpaces.

Roadmap for Future WebLogic Releases

  • Support of Java EE 6 (ratified by the community in last December)
  • OSGi deployment
  • More native integration for WebLogic Server – Coherence – Oracle Database
  • JRockit Flight Recorder for constant record
  • Virtualization
  • More integration with Maven, Hudson and Cruise Control
  • Shared Library: use the same JAR for many applications, rather than packing the same JAR in different EARs.
  • On long term:
    • IDE
      • NetBeans to be oriented onto J2ME development
      • JDevelopper to remain Oracle strategic IDE
      • Contributions to Eclipse to go on
    • JRockit and Sun HotSpot JVMs to be merged.

PostHeaderIcon TibrvException[error=4,message=Tibrv not initialized]

Case

In a JUnit test, I send a message on a TibcoRV, but I get the following error:

TibrvException[error=4,message=Tibrv not initialized]

Fix

In order, proceed as this:

  1. check an RVD daemon is running 😉
  2. check tibrvj.jar is in your classpath 😉
  3. check the instanciation of transport layer new TibrvRvdTransport(service, network, daemon); is done within your public void testXXX(), and not in the setUp().

PostHeaderIcon Windows Mobile 6.1: which browser?

Here is a short comparative of webbrowsers available on Windows Mobile 6.1. I used them on a Acer X960 on French VirginMobile network.

Browser Pros Cons WebSite
Internet Explorer 5
  • already installed on devices
  • slow
  • no tabs
  • no Flash
  • GMail doesn’t work
  • Micro$oft!
Mozilla Fennec 1.0a1
  • open source
  • tabs
  • very slow
  • very heavy in memory
  • no Flash
  • GMail doesn’t work
http://www.mozilla.org/projects/fennec/1.0a1/releasenotes/
Opera Mobile 10
  • tabs
  • fluidity
  • speed
  • no Flash
  • heavy in memory
  • GMail doesn’t work
  • not open-source
http://www.opera.com/
SkyFire 1.5
  • GMail works
  • Flash supported
  • speed
  • no tabs
  • confidentiality
  • not open-source
http://get.skyfire.com

As a conclusion, what do I do?

  • In most cases, I use Opera, for its speedness and tabs.
  • When I need watch a video
    • my Acer X960 displays YouTube videos in a specific player
    • on other websites, I use SkyFire.
  • For Google applications (GMail, Reader, Docs, etc.), I use SkyFire, too.

PostHeaderIcon org.springframework.beans.factory.xml.XmlBeanDefinitionReader: Ignored XML validation warning org.xml.sax.SAXParseException: SchemaLocation: schemaLocation value = … must have even number of URI’s

Context

Mule 2.2.1 ESB config file with a TibcoRV connector, under Windows XP SP2 and Java 5.
The error happened in this context, yet I assume it would occur in any occurence related to XSD / XML schemas.

Error

org.springframework.beans.factory.xml.XmlBeanDefinitionReader: Ignored XML validation warning
org.xml.sax.SAXParseException: SchemaLocation: schemaLocation value = 'http://www.mulesource.org/schema/mule/management/2.2                http://www.mulesource.org/schema/mule/management/2.2/mule-management.xsd                http://www.mulesource.org/schema/mule/core/2.2                http://www.mulesource.org/schema/mule/core/2.2/mule.xsd                http://www.springframework.org/schema/beans                http://www.springframework.org/schema/beans/spring-beans-2.5.xsd                http://www.mulesource.org/schema/mule/core/2.2/mule.xsd                http://www.mulesource.org/schema/mule/vm/2.2                http://www.mulesource.org/schema/mule/vm/2.2/mule-vm.xsd
http://www.mulesource.org/schema/mule/tibcorv/2.2                http://www.mulesource.org/schema/mule/tibcorv/2.2/mule-tibcorv.xsd' must have even number of URI's.

Headers of XML config file:

[xml]<mule xmlns=&amp;quot;http://www.mulesource.org/schema/mule/core/2.2&amp;quot;
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:management="http://www.mulesource.org/schema/mule/management/2.2"
xmlns:tibcorv="http://www.mulesource.org/schema/mule/tibcorv/2.2
xsi:schemaLocation="http://www.mulesource.org/schema/mule/management/2.2
http://www.mulesource.org/schema/mule/management/2.2/mule-management.xsd
http://www.mulesource.org/schema/mule/core/2.2
http://www.mulesource.org/schema/mule/core/2.2/mule.xsd
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.mulesource.org/schema/mule/core/2.2/mule.xsd
http://www.mulesource.org/schema/mule/vm/2.2
http://www.mulesource.org/schema/mule/vm/2.2/mule-vm.xsd
http://www.mulesource.org/schema/mule/tibcorv/2.2
http://www.mulesource.org/schema/mule/tibcorv/2.2/mule-tibcorv.xsd">[/xml]

Explanation – Fix

Each time, the attribute xsi:schemaLocation must have an even number of lines: a “public” XSD address and a “non-public” one. For non English-fluent speakers, I remind that a number is even if, and only if, it is a multiple of 2 ; otherwise it is odd.

In our case, one line is redundant. To fix this issue, you have to remove the redundant line, and ensure each line belongs to a consistent pair of lines: for instance:

http://www.mulesource.org/schema/mule/tibcorv/2.2
and
http://www.mulesource.org/schema/mule/tibcorv/2.2/mule-tibcorv.xsd

PostHeaderIcon Tibco RendezVous quick-start tutorial

When I was introduced to TIBCO Rendezvous (also spelled “Tibco Rendez-Vous” or, shorterly, “TiboRV”), I faced a embarrassing issue: the lack of documentation and tutorials on the web.

The purpose of this -short- tutorial is to guide you until you can send and read a “HelloWorld” message passing through Tibco RendezVous

Installation

  • Set the variable JAVA_HOME
    Eg, in my case:

    set JAVA_HOME=C:\exe\java\jdk150_10
  • Get the file to be installed:
    TIB_rv_8.1.2_win_x86_vc8.zip
  • Unzip the content in your local drive
  • Launch the installer (.exe)
    • select Custom installation
    • choose the installation folder, eg: C:\exe\tibco
    • keep default options for other requests
  • Set the variable TIBRV_HOME
    Eg, in my case:

    set TIBRV_HOME=C:\exe\tibco\tibrv\8.1

Main Runnables

RVD: Daemon

  • Launching the daemon on local host on port 8181 (default port: 7580):
    rvd -http 8181

    You should see the following trace:

    C:\exe\tibco\tibrv\8.1\bin>rvd -http 8181
    
    TIB/Rendezvous daemon
    Copyright 1994-2008 by TIBCO Software Inc.
    All rights reserved.
    
    Version 8.1.2 V8 9/26/2008
    2010-01-19 16:37:02 rvd: Command line: rvd -http 8181
    2010-01-19 16:37:02 rvd: Hostname: MYLOCALMACHINE
    2010-01-19 16:37:02 rvd: Hostname IP address: 123.123.123.123
    2010-01-19 16:37:02 rvd: Detected IP interface: 123.123.123.123 (IP00)
    2010-01-19 16:37:02 rvd: Detected IP interface: 127.0.0.1 (loopback)
    2010-01-19 16:37:02 rvd: Unable to find ticket file tibrv.tkt in PATH
    2010-01-19 16:37:02 rvd: Http interface - http://myLocalMachine.myDomain:8181/

tibrvsend: send a message

To send a message on myLocalMachine:7580:

.\tibrvsend.exe -service 7580 -network MYLOCALMACHINE mySubject myMessage

Expected output:

C:\exe\tibco\tibrv\8.1\bin>.\tibrvsend.exe -service 7580 -network MYLOCALMACHINE mySubject myMessage
Publishing: subject=mySubject "myMessage"
2010-01-19 16:52:11 RV: TIB/Rendezvous Error Not Handled by Process:
{ADV_CLASS="WARN" ADV_SOURCE="SYSTEM" ADV_NAME="LICENSE.EXPIRE" ADV_DESC="The license will expire" expiretime=2010-01-19 16:02:11Z host="10.30.226.147"}

tibrvlisten: listen to messages

Abstract

To listed to messages published on MYLOCALMACHINE:7580, related to subject mySubject:

tibrvlisten -service 7580 -network MYLOCALMACHINE mySubject

Use case: HelloWorld

For instance, let’s assume that you launch this command from one frame:

C:\exe\tibco\tibrv\8.1\bin>.\tibrvsend.exe -service 7580 -network localhost mySubject HelloWorld
Publishing: subject=mySubject "HelloWorld"

Here is what appears in the “listening” frame:

2010-01-19 17:01:32 (2010-01-19 16:01:32.990000000Z): subject=mySubject, message={DATA="HelloWorld"}

Notice you can have many instances listening to the same messages.

Other runnables

Launch the daemon manager

  • Launch:
    cd %TIBRV_HOME%/RVDM
    ./RVDM.bat -http 8282 .
  • You should see following messages, that you can ignore:
    2010-01-19 13:01:48 rvdm: RVDM has activated.
    2010-01-19 13:02:03 RV: TIB/Rendezvous Error Not Handled by Process:
    {ADV_CLASS="WARN" ADV_SOURCE="SYSTEM" ADV_NAME="LICENSE.EXPIRE" ADV_DESC="The license will expire" e
    xpiretime=2010-01-19 12:11:48Z host="123.123.123.123"}
  • To check the daemon is on, you can open the address http://localhost:8282 on your favorite browser.

Example sources

Example sources are available in folder %TIBRV_HOME%/src/examples/java

Misc

TIBRV_HOME\bin folder fosters a couple of binaries:

  • rvntscfg.exe: Services Configuration Program

PostHeaderIcon Servlet of class org.apache.catalina.servlets.CGIServlet is privileged and cannot be loaded by this web application

Case:

Under Windows / Tomcat 6:

[java]java.lang.SecurityException: Servlet of class org.apache.catalina.servlets.CGIServlet is privileged and cannot be loaded by this web application[/java]

Fix:

In the web.xml file, add the following block:

[xml]
<context-param>
<param-name>privileged</param-name>
<param-value>true</param-value>
</context-param>[/xml]