Subject Re: Moving from Windows to Linux (Ubuntu)
Author Ian A. Newby
Hi Rick,
I've found the problem, and it was nothing to do with firebird or jbird...

The box didn't have its own name in the hosts file!

I found an obscure comment on an internet post that said socket
connections from java don't work unless the machine opening the socket
can be found in the hosts file (or dns).

Maybe one for the FAQ?

Regards
Ian

--- In Firebird-Java@yahoogroups.com, Rick Fincher <rnf@...> wrote:
>
> Hi Ian,
>
> That's odd. I routinely develop on Tomcat on a Windows box and put the
> code in production on a Linux server with no problem.
> The only thing I can think of in that situation is that there was an
> error changing the Windows filenames to Linux format.
>
> If you had any strings with escaped backslashes (\\) that didn't get
> translated to a single forward slash, or if a colon was left in the
> string when removing a "C:\" it can cause problems.
>
> Can you post the lines of connection code that generate the error?
> Include the connection URL and driver string.
>
> The only other thing I can think to try is to use a standard DataSource
> instead of the FBWrapping DataSource, just to see if there is some sort
> of error there.
>
> Rick
>
> Ian A. Newby wrote:
>
> > At the moment it is just test code, hardcoded in the java code.
> >
> > Note that I can connect to the database using isql, remoteley from
> > another machine using ibexpert. The versions of Tomcat are basically
> > the same, 5.5, one is 5.5.10 and the other 5.5.17 I think.
> >
> > Why would the network connection fail? I am also connecting to a
> > remote SQL server database using the jTDS driver and that works OK.
> >
> > I've tried connecting to a remote firebird database and that fails
too.
> >
> > Regards
> > Ian Newby
> >
> > --- In Firebird-Java@yahoogroups.com
> > <mailto:Firebird-Java%40yahoogroups.com>, Rick Fincher <rnf@> wrote:
> > >
> > > Hi Ian,
> > >
> > > It looks like you are opening your own DataSource from inside
your app
> > > rather than using one from Tomcat.
> > >
> > > Did you change versions of Tomcat in the migration from Windows to
> > Linux?
> > >
> > > Tomcat 5.5.x uses different procedures from earlier versions of
Tomcat
> > > to create DataSources. It is preferable to use the Tomcat Admin
> > tool to
> > > create the DataSources and then set up a context to use them in your
> > app.
> > >
> > > Did you modify /CATALINA_HOME/conf/server.xml to put your
context info
> > > in? If so, that is not recommended for Tomcat 5.5.x.
> > >
> > > Tomcat 5.5.x puts a context file in
> > > /CATALINA_HOME/conf/Catalina/localhost with the name of your
app, like:
> > > myApp.xml. This file is auto-generated by Tomcat from the file named
> > > context.xml in /CATALINA_HOME/webapps/yourApp/META-INF.
> > >
> > > You create that file with your app's context info rather than hard
> > > coding it in server.xml.
> > >
> > > Rick
> > >
> > >
> > > Ian A. Newby wrote:
> > >
> > > > 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
> > <mailto:Firebird-Java%40yahoogroups.com>
> > > > <mailto:Firebird-Java%40yahoogroups.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
> > <http://tomcat.apache.org/tomcat-5.5-doc/security-manager-howto.html>
> > > >
> > <http://tomcat.apache.org/tomcat-5.5-doc/security-manager-howto.html
> > <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@
> > > > >
> > > >
> > > > _
> > >
> > >
> > >
> > >
> > > [Non-text portions of this message have been removed]
> > >
> >
> >
> >
> >
>
>
>
>
> [Non-text portions of this message have been removed]
>