Translate

jueves, 15 de diciembre de 2016

Weblogic Jboss Migration issue 1: javax.naming.NameNotFoundException: env/jmx/runtime



Migración Weblogic - Jboss problema 1: obtener el Servidor MBeans


I my new job, we have to migrate original web applications deployed in a Weblogic 10.6.3 Application Server to Jboss EAP6 (Jboss AS7).

This post is about the first problem that i have found. The problem is how to instantate the MBeanServer object that containts all my beans.


The slice of code that instantate a the MBeanServer in weblogic is like that:

//Weblogic way
InitialContext ctx = new InitialContext();
this.mbs = ((MBeanServer)ctx.lookup("java:comp/env/jmx/runtime"));

If you deploy this code in a JBoss, the common error that appears in log is the next one:
javax.naming.NameNotFoundException: env/jmx/runtime

The way to solve this issue is change the context lookup for a FactoryManager 
to get the right MBeanServer.

//JBoss way
import java.lang.management.ManagementFactory;
//another code
//another code
//.....
this.mbs=ManagementFactory.getPlatformMBeanServer();

The good news is that this way works both in Jboss and Weblogic.


viernes, 4 de noviembre de 2016

VirtualBox Centos 6 problems installing VboxGuetsAditions

Today I have installed a Centos 6 in my VirtualBox machine and i tried to create a shared folder to interchange file between de host and guest machine.







I have tried to add the GuetsAditions "inserting" the CD and installing



When i tried to install the software executing the autorun.sh




I recived in the same window the next error:

Look at /var/log/vboxadd-install.log to find out what went wrong

When I opened the file the error is the next one:

Makefile:181: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR= and run Make again. Stop


The problem is that you not have installed all the linux headers properly in your machine.

I recommend two steps:

1 - yum update 

In order to update all your virual machine specially if have been recently installed.

2 - yum install kernel-devel 

This package provides kernel headers and makefiles sufficient to build modules against the kernel package.

Restart your Centos virtual machine and try to execute again the autorun.sh

Evething works!!!





viernes, 24 de julio de 2015

X11 connection rejected because of wrong authentication

Esta vez me está tocando trabajar con sistemas un poco antiguos, aquí estamos utilizando un aplicación que WEB que está compilada con JDK1.5, y realizada con Spring y iBatis.

El servidor de aplicaciones es un JBOSS (jboss-4.2.3.GA) donde se carga el war de la aplicación, todo el frontal está hecho con jsf y richfaces. La aplicación está corriendo sobre Linux.¡

El problema que me ha pasado es que una vez delplegada la aplicación en el servidor JBOSS, todo ha ido perfectamente pero al poner en el navegador la URL de acceso a la aplicación esta no cargaba porque de repente el proceso java asociado al servidor de aplicaciones desaparecía.

El proceso de repente no estaba en el listado de procesos activos, y he intentado arreglarlo en principio comprobado que la memoria del proceso no era excesiva, y después ampliándola pero el proceso seguía igual.

Revisando los LOGS la única traza visible era:


18:51:15,521 INFO  [STDOUT] 16/07/2015 18:51:15 DEBUG (es.mi.sd.xxxxx.aspect.ServiceLoggerAspect)  - <<<<<<<<<<<<<<<<<
X11 connection rejected because of wrong authentication.

X connection to localhost:11.0 broken (explicit kill or server shutdown).


La manera de solucionarlo ha sido poner esta línea en los parámetros de arranque de JBOSS,

-Djava.awt.headless=true

Nuestro arranque ha quedado así:

JAVA_OPTS="-Xms512m -Xmx512m -XX:MaxPermSize=1024m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djava.awt.headless=true"


Ahora el procedimiento sigue vivo y no muere al cargar la primera página de la aplicación.

Referencias:

- Referencia 1