Posts RSS Comments RSS 43 Posts and 31 Comments till now

Archive for the 'java' Category

Bea Weblogic 81 su Ubuntu Linux

Ho scritto una breve guida su come installare Bea Weblogic 81 su Ubuntu Linux.

Devo dire che è stato più semplice del previsto.

Tomcat security issue with jdbc connections

This is a reminder for me, for Tomcat setting about security violation.

In a simple servlet, if you have some issue with db connection, with this output:

    java.security.AccessControlException: access denied (java.net.SocketPermission localhost resolve)

have a look at Tomcat security policy.

To correct this problem, you have to edit /etc/tomcat5/policy.d/

We want to give all contexts not configured by their own grant entry some default permissions in addition to what Tomcat assigns by default:

    grant {
        permission java.net.SocketPermission "localhost:3306","listen,connect,resolve";
        permission java.util.PropertyPermission "*","read";
    };

You may have to replace localhost:3306 with your db host and port.

JAVA_HOME: where do I set?

When you install Java (JRE or SDK) on linux system you have to set some environment variables, like JAVA_HOME, J2EE_HOME, etc.

Usually you have to set this variables for all users: system-wide level. OK, I agree. But where do I set JAVA_HOME?

Three alternatives:

  1. /etc/profile
  2. /etc/bash.bashrc
  3. /etc/environment

The first solution. I tried to set the environment variables in /etc/profile: it’s the right place for system wide variables, but in Ubuntu system seems not working.

The second solution worked for all users who use bash. Nice, but there’s another way.

The third solution is to use /etc/environment: in my opinion this is the best way, if the first solution fails.

References: