Recent Posts
Archives

Archive for the ‘en-US’ Category

PostHeaderIcon javax.enterprise.deploy.spi.exceptions.DeploymentManagerCreationException

Case

I deploy a WAR on a WebLogic server, thanks to Maven’s Weblogic plugin. For any reason, the pom.xml was modified, to add a dependency to weblogic-maven-plugin:

[xml] <plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>weblogic-maven-plugin</artifactId>
<version>2.9.1</version>
<configuration>(…)</configuration>
<dependencies>
<dependency>
<groupId>weblogic</groupId>
<artifactId>wlfullclient</artifactId>
<version>10.3</version>
<scope>provided</scope>
</dependency>
</dependencies>
</plugin>[/xml]

From then I could not deploy anymore. I get the error:

[java]javax.enterprise.deploy.spi.exceptions.DeploymentManagerCreationException
at weblogic.deploy.api.spi.deploy.WebLogicDeploymentManagerImpl.<init>(WebLogicDeploymentManagerImpl.java:121)[/java]

Complete stacktrace

"[ServerConnectionImpl.close():332] : Closing DM connection
[ServerConnectionImpl.close():352] : Unregistered all listeners
javax.enterprise.deploy.spi.exceptions.DeploymentManagerCreationException
        at weblogic.deploy.api.spi.deploy.WebLogicDeploymentManagerImpl.(WebLogicDeploymentManagerImpl.java:121)
        at weblogic.deploy.api.spi.factories.internal.DeploymentFactoryImpl.getDeploymentManager(DeploymentFactoryImpl.java:86)
        at weblogic.deploy.api.tools.SessionHelper.getRemoteDeploymentManager(SessionHelper.java:496)
        at weblogic.deploy.api.tools.deployer.Jsr88Operation.connect(Jsr88Operation.java:297)
        at weblogic.deploy.api.tools.deployer.Deployer.perform(Deployer.java:137)
        at weblogic.deploy.api.tools.deployer.Deployer.runBody(Deployer.java:88)
        at weblogic.utils.compiler.Tool.run(Tool.java:158)
        at weblogic.utils.compiler.Tool.run(Tool.java:115)
        at weblogic.Deployer.run(Deployer.java:70)
        at org.codehaus.mojo.weblogic.DeployMojoBase.executeDeployer(DeployMojoBase.java:510)
        at org.codehaus.mojo.weblogic.DeployMojo.execute(DeployMojo.java:49)
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:454)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:559)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:513)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:483)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:331)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:292)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:345)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:132)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:290)
        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.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: weblogic.deploy.api.spi.exceptions.ServerConnectionException
        at weblogic.deploy.api.spi.deploy.internal.ServerConnectionImpl.init(ServerConnectionImpl.java:141)
        at weblogic.deploy.api.spi.deploy.WebLogicDeploymentManagerImpl.getNewConnection(WebLogicDeploymentManagerImpl.java:148)
        at weblogic.deploy.api.spi.deploy.WebLogicDeploymentManagerImpl.(WebLogicDeploymentManagerImpl.java:118)
        ... 28 more
Caused by: javax.naming.CommunicationException [Root exception is java.net.ConnectException: t3://localhost:7001: Destination unreachable; nested exception is:
        java.net.ProtocolException: unrecognized response from proxy: 'HTTP/1.1 403 Forbidden'; No available router to destination]
        at weblogic.jndi.internal.ExceptionTranslator.toNamingException(ExceptionTranslator.java:40)
        at weblogic.jndi.WLInitialContextFactoryDelegate.toNamingException(WLInitialContextFactoryDelegate.java:787)
        at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:366)
        at weblogic.jndi.Environment.getContext(Environment.java:315)
        at weblogic.jndi.Environment.getContext(Environment.java:285)
        at weblogic.jndi.Environment.createInitialContext(Environment.java:208)
        at weblogic.jndi.Environment.getInitialContext(Environment.java:192)
        at weblogic.jndi.Environment.getInitialContext(Environment.java:170)
        at weblogic.deploy.api.spi.deploy.internal.ServerConnectionImpl.getContext(ServerConnectionImpl.java:328)
        at weblogic.deploy.api.spi.deploy.internal.ServerConnectionImpl.getEnvironment(ServerConnectionImpl.java:300)
        at weblogic.deploy.api.spi.deploy.internal.ServerConnectionImpl.init(ServerConnectionImpl.java:139)
        ... 30 more
Caused by: java.net.ConnectException: t3://localhost:7001: Destination unreachable; nested exception is:
        java.net.ProtocolException: unrecognized response from proxy: 'HTTP/1.1 403 Forbidden'; No available router to destination
        at weblogic.rjvm.RJVMFinder.findOrCreateInternal(RJVMFinder.java:216)
        at weblogic.rjvm.RJVMFinder.findOrCreate(RJVMFinder.java:170)
        at weblogic.rjvm.ServerURL.findOrCreateRJVM(ServerURL.java:153)
        at weblogic.jndi.WLInitialContextFactoryDelegate$1.run(WLInitialContextFactoryDelegate.java:345)
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
        at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
        at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:340)
        ... 38 more
Caused by: java.rmi.ConnectException: Destination unreachable; nested exception is:
        java.net.ProtocolException: unrecognized response from proxy: 'HTTP/1.1 403 Forbidden'; No available router to destination
        at weblogic.rjvm.ConnectionManager.bootstrap(ConnectionManager.java:464)
        at weblogic.rjvm.ConnectionManager.bootstrap(ConnectionManager.java:315)
        at weblogic.rjvm.RJVMManager.findOrCreateRemoteInternal(RJVMManager.java:254)
        at weblogic.rjvm.RJVMManager.findOrCreate(RJVMManager.java:197)
        at weblogic.rjvm.RJVMFinder.findOrCreateRemoteServer(RJVMFinder.java:238)
        at weblogic.rjvm.RJVMFinder.findOrCreateInternal(RJVMFinder.java:200)
        ... 44 more
weblogic.deploy.api.tools.deployer.DeployerException: Unable to connect to 't3://localhost:7001': Destination unreachable; nested exception is:
        java.net.ProtocolException: unrecognized response from proxy: 'HTTP/1.1 403 Forbidden'; No available router to destination. Ensure the url represents a running admin server and that the credentials are correct. If using http protocol, tunneling must be enabled on the admin server.
        at weblogic.deploy.api.tools.deployer.Jsr88Operation.connect(Jsr88Operation.java:316)
        at weblogic.deploy.api.tools.deployer.Deployer.perform(Deployer.java:137)
        at weblogic.deploy.api.tools.deployer.Deployer.runBody(Deployer.java:88)
        at weblogic.utils.compiler.Tool.run(Tool.java:158)
        at weblogic.utils.compiler.Tool.run(Tool.java:115)
        at weblogic.Deployer.run(Deployer.java:70)
        at org.codehaus.mojo.weblogic.DeployMojoBase.executeDeployer(DeployMojoBase.java:510)
        at org.codehaus.mojo.weblogic.DeployMojo.execute(DeployMojo.java:49)
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:454)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:559)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:513)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:483)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:331)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:292)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:345)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:132)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:290)
        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.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: javax.enterprise.deploy.spi.exceptions.DeploymentManagerCreationException
        at weblogic.deploy.api.spi.deploy.WebLogicDeploymentManagerImpl.(WebLogicDeploymentManagerImpl.java:121)
        at weblogic.deploy.api.spi.factories.internal.DeploymentFactoryImpl.getDeploymentManager(DeploymentFactoryImpl.java:86)
        at weblogic.deploy.api.tools.SessionHelper.getRemoteDeploymentManager(SessionHelper.java:496)
        at weblogic.deploy.api.tools.deployer.Jsr88Operation.connect(Jsr88Operation.java:297)
        ... 25 more
Caused by: weblogic.deploy.api.spi.exceptions.ServerConnectionException
        at weblogic.deploy.api.spi.deploy.internal.ServerConnectionImpl.init(ServerConnectionImpl.java:141)
        at weblogic.deploy.api.spi.deploy.WebLogicDeploymentManagerImpl.getNewConnection(WebLogicDeploymentManagerImpl.java:148)
        at weblogic.deploy.api.spi.deploy.WebLogicDeploymentManagerImpl.(WebLogicDeploymentManagerImpl.java:118)
        ... 28 more
Caused by: javax.naming.CommunicationException [Root exception is java.net.ConnectException: t3://localhost:7001: Destination unreachable; nested exception is:
        java.net.ProtocolException: unrecognized response from proxy: 'HTTP/1.1 403 Forbidden'; No available router to destination]
        at weblogic.jndi.internal.ExceptionTranslator.toNamingException(ExceptionTranslator.java:40)
        at weblogic.jndi.WLInitialContextFactoryDelegate.toNamingException(WLInitialContextFactoryDelegate.java:787)
        at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:366)
        at weblogic.jndi.Environment.getContext(Environment.java:315)
        at weblogic.jndi.Environment.getContext(Environment.java:285)
        at weblogic.jndi.Environment.createInitialContext(Environment.java:208)
        at weblogic.jndi.Environment.getInitialContext(Environment.java:192)
        at weblogic.jndi.Environment.getInitialContext(Environment.java:170)
        at weblogic.deploy.api.spi.deploy.internal.ServerConnectionImpl.getContext(ServerConnectionImpl.java:328)
        at weblogic.deploy.api.spi.deploy.internal.ServerConnectionImpl.getEnvironment(ServerConnectionImpl.java:300)
        at weblogic.deploy.api.spi.deploy.internal.ServerConnectionImpl.init(ServerConnectionImpl.java:139)
        ... 30 more
Caused by: java.net.ConnectException: t3://localhost:7001: Destination unreachable; nested exception is:
        java.net.ProtocolException: unrecognized response from proxy: 'HTTP/1.1 403 Forbidden'; No available router to destination
        at weblogic.rjvm.RJVMFinder.findOrCreateInternal(RJVMFinder.java:216)
        at weblogic.rjvm.RJVMFinder.findOrCreate(RJVMFinder.java:170)
        at weblogic.rjvm.ServerURL.findOrCreateRJVM(ServerURL.java:153)
        at weblogic.jndi.WLInitialContextFactoryDelegate$1.run(WLInitialContextFactoryDelegate.java:345)
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
        at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
        at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:340)
        ... 38 more
Caused by: java.rmi.ConnectException: Destination unreachable; nested exception is:
        java.net.ProtocolException: unrecognized response from proxy: 'HTTP/1.1 403 Forbidden'; No available router to destination
        at weblogic.rjvm.ConnectionManager.bootstrap(ConnectionManager.java:464)
        at weblogic.rjvm.ConnectionManager.bootstrap(ConnectionManager.java:315)
        at weblogic.rjvm.RJVMManager.findOrCreateRemoteInternal(RJVMManager.java:254)
        at weblogic.rjvm.RJVMManager.findOrCreate(RJVMManager.java:197)
        at weblogic.rjvm.RJVMFinder.findOrCreateRemoteServer(RJVMFinder.java:238)
        at weblogic.rjvm.RJVMFinder.findOrCreateInternal(RJVMFinder.java:200)
        ... 44 more
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Exception encountered during artifact start: weblogic.deploy.api.tools.deployer.DeployerException: Unable to connect to 't3://localhost:7001': Destination unreachable; nested exception is:

        java.net.ProtocolException: unrecognized response from proxy: 'HTTP/1.1 403 Forbidden'; No available router to destination. Ensure the url represents a running admin server and that the credentials are correct. If using http protocol, tunneling must be enabled on the admin server."

Explanation

In weblogic-maven-plugin-2.9.1.pom, we can find the following dependencies:

[xml] <dependency>
<groupId>weblogic</groupId>
<artifactId>weblogic</artifactId>
<version>[9.0,11.0)</version>
</dependency>
<dependency>
<groupId>weblogic</groupId>
<artifactId>webservices</artifactId>
<version>[9.0,11.0)</version>
</dependency>[/xml]

Since WebLogic client jars are not compatibles between versions 9 and 10, a conflit of JARs appears between my pom’s dependency to weblogic:wlfullclient-10.3.jar and the plugin pom’s dependencies to weblogic:weblogic-XXX.jar and weblogic:webservices-XXX.jar

Fix

In the project pom.xml, remove the dependency to <strongwlfullclient.jar.

PostHeaderIcon WebLogic: set a System property within a WAR

Case

You would like to set a System property within an application packaged as a WAR.
Of course, you may modify the launching scripts of your servers, to add an option -DmyPropertyName=myPropertyValue. Sometimes, you would like to avoid such a solution, because updating the property would require an update of the setEnv.* files and therefore a action of the exploitation team.

In my case, I had to set the property tangosol.coherence.cacheconfig, which hints at the configuration file used my Oracle Coherence / Coherence*Web

Fix

The first solution is to set the property in a startup class. For more detials, consult this page: WebLogic: use a startup and/or a shutdown class in a WAR.

Another mean to handle this problematic is to create a servlet, with a code similar to:

[java]public class JonathanBootServlet extends HttpServlet {
private static final Logger LOGGER = Logger.getLogger(JonathanBootServlet.class);
private static final String SVN_ID = "$Id$";

public JonathanBootServlet() {
super();
if (LOGGER.isDebugEnabled()){
LOGGER.debug(SVN_ID);
}
}

public void init(ServletConfig config) throws ServletException {
if (LOGGER.isDebugEnabled()){
LOGGER.debug("in init()");
}
System.setProperty("tangosol.coherence.cacheconfig", "jonathan-tangosol-coherence.xml");
super.init(config);
}
}[/java]

Then add the following block in your web.xml:

[xml] <servlet>
<servlet-name>JonathanBootServlet</servlet-name>
<servlet-class>lalou.jonathan.weblogic.technical.JonathanBootServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>[/xml]

Ensure this servlet is run before all others (1).

PostHeaderIcon java.lang.NoClassDefFoundError: com/tangosol/run/component/EventDeathException

Case

You have an application which uses Oracle Coherence / Coherence*Web as cache manager. On redeploying the application, you get a stacktrace of which header is:

[java]Exception in thread ‘DistributedCache|SERVICE_STOPPED’ java.lang.NoClassDefFoundError: com/tangosol/run/component/EventDeathException[/java]

Explanation

Indeed, an undeploy operation stops the services of your application. But Coherence is not launched as a service among the others: it should be considered as an independant one. Therefore, you have to stop it before undeploying your application ; otherwise, your classloader is in a confused state, and loses references to classes it had loaded before, but that should now be unloaded.

Fix

You have to stop Oracle Coherence on your application shutdown.

EAR

If your application is packaged as an EAR, then create a shutdown class with the following main():

[java]public class JonathanLalouEARShutdown extends ApplicationLifecycleListener {
public static void main(String[] args) {
CacheFactory.shutdown();
}
}[/java]

Add the following block in your weblogic-application.xml, hinting the shutdown class:

[xml]<shutdown>
<shutdown-class>lalou.jonathan.weblogic.JonathanLalouEARShutdown </shutdown-class>
</shutdown>[/xml]

WAR

If your application is packaged as a WAR, then create a class implementing ServletContextListener, and add the following block in your web.xml:

[xml]
<listener>
<listener-class>your.class.implementing.ServletContextListener</listener-class>
</listener>
[/xml]

The detailed procedure is described at this link: WebLogic: use a startup and/or a shutdown class in a WAR

PostHeaderIcon WebLogic: use a startup and/or a shutdown class in a WAR

Abstract

WebLogic offers you to specify a startup and/or a shutdown class for an application. Anyway, this feature is restrained to EARs, and is not available for applications deployed as WARs. For EARs, Oracle WebLogic Server’s documentation is complete and gives basic examples: Programming Application Life Cycle Events

Yet, sometimes you need such a class even for a WebApp. You have two ways to handle this case.

Solutions

Full Weblogic!

Base

The first solution is not elegant. Open WebLogic console, go to Startup And Shutdown Classes, then add the classes names of which main() methods will be run on startup and shutdown, let’s say JonathanWeblogicStartup. These classes must be available in WebLogic classpath, which is surely different from your application classpath, eg in a library $DOMAIN_HOME/lib/customized-weblogic.jar.
Advantage of this means: if your startup/shutdown class does not evoluate often, then write it once and forget, it will be OK. Unlike, you will have to manage different versions of the JAR on each release… I assume your exploitation team may get angry at playing with classpaths and lib folders 😀

Suggestion

To improve the basic solution (and avoid your exploitation guy burst in your office), I had the following idea, that I did not experiment, but that should work:

  • Keep JonathanWeblogicStartup
  • Create another class JonathanConcreteStartup, locate as a source in your application code.
  • In JonathanStartup.main(), call JonathanConcreteStartup

This way,

  1. You keep a unique JAR in classpath that you do not need to update and you can forget.
  2. You can add, update or remove features in your very source code.
  3. The exploitation teams does not become hateful at you.

Add a Listener

The second one requires a bit more work.

  • Create a class implementing javax.servlet.ServletContextListener interface, let’s say MyLifecycleListener.
  • Implement methods contextInitialized() and contextDestroyed().
  • Edit your web.xml, add the following block:
    [xml]
    <listener>
    <listener-class>lalou.jonathan.MyLifecycleListener</listener-class>
    </listener>[/xml]
  • Rebuild and deploy. It should be OK

PostHeaderIcon WebLogic: Unresolved Webapp Library references for … coherence-web-spi

Case

I have to integrate Oracle Coherence, or more accurately Coherence*Web, within an application deployed as a WAR in WebLogic 10.3.
Since Oracle bought both BEA and Tangosol, increasing their integration, using Coherence jars implicitely is allowed. Anyway I decided to add the following block in weblogic.xml

[xml] <library-ref>
<library-name>coherence-web-spi</library-name>
<specification-version>1.0.0.0</specification-version>
<implementation-version>1.0.0.0</implementation-version>
<exact-match>false</exact-match>
</library-ref>
[/xml]

Then I get this error:

[java]Caused By: weblogic.management.DeploymentException: Error: Unresolved Webapp Library references for
""ServletContext@25681165[app:risklayer-web module:jonathan-lalou.war path:/jonathan-lalou spec-version:null]"", defined in weblogic.xml [Extension-Name: coherence-web-spi, Specification-Version: 1, Implementation-Version: 1.0.0.0, exact-match: false][/java]

Fix

Indeed, I had to deploy Coherence*Web WAR in WebLogic, in the console:
Deployments > Install > select Coherence WAR, eg: C:\jonathan\bea\coherence_3.5\lib\coherence-web-spi.war > Next> Install this deployment as a library > Next > Target your server > Finish

PostHeaderIcon Jasypt / java.lang.NoClassDefFoundError: com/ibm/icu/text/Normalizer

Context

Ippon, a French company, published a job offer as an challenge / enigma / eliminating heat / project hosted by Git:

https://github.com/ippontech/IpponRecrute

Solving this “enigma”, I get the following error:

[java]org.jasypt.exceptions.EncryptionInitializationException: java.lang.NoClassDefFoundError: com/ibm/icu/text/Normalizer[/java]

Fix

This issue appears only with Java versions prior to 6. To fix it, you can upgrade your JRE ;-), or add the following dependency:

[xml]<dependency>
<groupId>com.ibm.icu</groupId>
<artifactId>icu4j</artifactId>
<version>3.4.4</version>
</dependency>[/xml]

By the way, the project displays the following page:

Venez travailler dans un monde post-J2EE
Marre d’être un matricule qu’on assigne sans ménagement sur de la TMA ou des projets sans grand intérêt? Alors venez vous éclater dans mon équipe Conseil chez Ippon.
Nos technos: Spring, Java EE, Portail, ESB, GWT, BI, Android… Vous participerez aux projets les plus innovants en terme d’environnements technologiques, le tout rythmé en mode agile.
Sans parler des collègues sympas et de l’équipe de Direction à l’écoute de vos envies et de vos ambitions. N’attendez plus, rejoignez mon Pôle Conseil!
Compétences requises:
avoir réussi à lire ce texte
bon niveau de babyfoot
Pour me faire parvenir votre candidature, envoyez votre cv à
recrutement@ippon.fr
(précisez qu’il s’agit d’une candidature pour le Pôle Conseil) ou postulez en ligne.
A très bientôt!
Julien.

PostHeaderIcon Equivalent of ‘ps’ in MS-DOS

What is the equivalent of Unix’ ps in MS-DOS, to be used in a .BAT script?

Let’s use %tasklist%.
eg:
[java]tasklist /fi "IMAGENAME eq java.exe" /FI "MEMUSAGE gt 100000"
Image Name PID Session Name Session# Mem Usage
========================= ====== ================ ======== ============
java.exe 9972 Console 0 212,932 K
java.exe 9640 Console 0 219,328 K
java.exe 11040 Console 0 213,432 K
java.exe 11144 Console 0 214,232 K\[/java]

PostHeaderIcon Start Mule ESB as an NT service under a Windows server

Case

You would like to start a Mule ESB instance as an NT service, under a Windows server. You would also like to give a specific name and description

Fix

  • add an environment variable MULE_HOME, with value the path of Mule install, for instance: C:\jonathan\mule-standalone-3.0.1
  • edit the file %MULE_HOME%\conf\wrapper.conf
  • replace the following properties default values:
    [java]wrapper.ntservice.name=%MULE_APP%
    wrapper.ntservice.displayname=%MULE_APP_LONG%
    wrapper.ntservice.description=%MULE_APP_LONG%[/java]
  • (you can also set other properties related to NT service configuration)
  • launch the command:
  • [java]%MULE_HOME%\bin\mule.bat install -config %MULE_HOME%\bin\mule-conf.xml[/java]

  • then you can see in the administration services that the service has started
  • to remove the service, only launch the following command
  • [java]%MULE_HOME%\bin\mule.bat remove[/java]

Known issue:

On certain installations (among them the servers on which CygWin is installed), a conflict may happen between the files %MULE_HOME%\bin\mule (standard launcher for Unix and Linux) and %MULE_HOME%\bin\mule.bat (standard launcher for Windows). In this case, rename %MULE_HOME%\bin\mule as %MULE_HOME%\bin\mule.OLD

PostHeaderIcon How to access global variables in Mule 3?

Case

In Mule 2.2.1, getting the global variables was allowed. Therefore, such a block worked:

[xml]
<add-message-property key="jonathanProperty"
value="#[groovy:MULE_ORIGINATING_ENDPOINT]" />[/xml]

In Mule 3, this is no more possible. Therefore, how to access -former- global variables within a Mule 3 config file?

Fix

Access the global variables owing to their scope, such as Invocation, Inbound, Outbound, Session, thanks to the methods MuleMessage.get<Scope>Property(), eg:

[xml]<add-message-property key="jonathanProperty"
value="#[groovy:message.getInboundProperty(&quot;MULE_ORIGINATING_ENDPOINT&quot;)]" />[/xml]

PostHeaderIcon BEA / JMSExceptions 045101

Case

I used a RuntimeTest to send a JMS message on a WebLogic application, with native WebLogic hosting of the queues, distributed queues to me more accurate. The test was OK.
I clustered the application. When I execute the same test, I get the following error:

[java][JMSExceptions:045101]The destination name passed to createTopic or createQueue "JONATHAN_LALOU_JMS_DISTRIBUTED_QUEUE" is invalid. If the destination name does not contain a "/" character then it must be the name of a distributed destination that is available in the cluster to which the client is attached. If it does contain a "/" character then the string before the "/" must be the name of a JMSServer or a ".". The string after the "/" is the name of a the desired destination. If the "./" version of the string is used then any destination with the given name on the local WLS server will be returned.[/java]

Fix

Since the message error is rather explicit, I tried to add a slash ('/') or a dot ('.') or both ('./'), but none worked.
To fix the issue, you have to prefix the queue name with the JMS module name and an exclamation mark ('!'), in the RuntimeTest configuration file, eg replace:

[xml]<property name="defaultDestinationName" value="JONATHAN_LALOU_JMS_DISTRIBUTED_QUEUE"/>[/xml]

with:

[xml]<property name="defaultDestinationName" value="JmsWeblogicNatureModule!JONATHAN_LALOU_JMS_DISTRIBUTED_QUEUE"/>[/xml]