Subject Re: Moving from Windows to Linux (Ubuntu)
Author Ian A. Newby
Thanks Alexey,

I've turned off the security manager, and now get past that error.
However, I'm now getting a new error:

org.firebirdsql.jdbc.FBSQLException: Resource Exception. Unable to
complete network request to host "127
.0.0.1".
Reason: Unable to complete network request to host "127.0.0.1".
at
org.firebirdsql.pool.FBConnectionPoolDataSource.allocateConnection(FBConnectionPoolDataSource
.java:305)
at
org.firebirdsql.pool.PooledConnectionQueue.addConnection(PooledConnectionQueue.java:427)
at
org.firebirdsql.pool.PooledConnectionQueue.start(PooledConnectionQueue.java:157)
at
org.firebirdsql.pool.AbstractConnectionPool.getQueue(AbstractConnectionPool.java:182)
at
org.firebirdsql.pool.FBConnectionPoolDataSource.getPooledConnection(FBConnectionPoolDataSourc
e.java:371)
at
org.firebirdsql.pool.FBWrappingDataSource.getConnection(FBWrappingDataSource.java:203)
at
uk.co.tpmi.engine.listeners.BootstrapListener.createDatasource(BootstrapListener.java:43)

I can connect to this database using isql with a connection string of
localhost:/mydatabase.fdb but not via Java.

Any ideas, I've tried localhost, 127.0.0.1 and 10.0.0.200?

Regards
Ian

--- In Firebird-Java@yahoogroups.com, Alexey Panchenko <alex+news@...>
wrote:
>
> Ian A. Newby wrote:
>
> > Caused by: java.security.AccessControlException: access denied
> > (java.util.PropertyPermission FBLog4j read)
>
> [...]
>
> > org.firebirdsql.logging.LoggerFactory.getLogger(LoggerFactory.java:36)
>
> = 1st part of the issue =
>
> You are running tomcat with the security manager. It is the java
> permissions, not the unix permissions.
>
> http://tomcat.apache.org/tomcat-5.5-doc/security-manager-howto.html
>
> You can either run tomcat without the security manager, or adjust the
> permissions.
>
> For tomcat they are usually configured in the
> tomcat/conf/catalina.policy, in some linux distributions this file
> could be generated from some others, please look how it works in your
> case.
>
> Your should add the following line
>
> permission java.util.PropertyPermission "FBLog4j", "read";
>
> Also you application may require some other permissions - access to
> other system properties, files & folders, sockets, etc.
>
> = 2nd part of the issue =
>
> Firebird client should ignore SecurityException when reading this
> property.
>
> Index: LoggerFactory.java
> ===================================================================
> RCS file:
/cvsroot/firebird/client-java/src/main/org/firebirdsql/logging/LoggerFactory.java,v
> retrieving revision 1.5
> diff -u -r1.5 LoggerFactory.java
> --- LoggerFactory.java 15 Apr 2005 23:08:18 -0000 1.5
> +++ LoggerFactory.java 10 Jan 2007 03:59:40 -0000
> @@ -33,7 +33,13 @@
>
> public static Logger getLogger(String name,boolean def) {
> if (!checked){
> - String sLog4j = System.getProperty("FBLog4j");
> + String sLog4j;
> + try {
> + sLog4j = System.getProperty("FBLog4j");
> + }
> + catch (SecurityException e) {
> + sLog4j = null;
> + }
> if (!def){
> if (sLog4j != null && sLog4j.equals("true"))
> log4j = true;
>
>
> --
> Best regards,
> Alexey mailto:alex+news@...
>