Menu

log4j error

Help
2003-10-08
2003-12-31
  • J O M Okomba

    J O M Okomba - 2003-10-08

    I keep getting this error when running a moredata application:

    java.lang.VerifyError: (class: org/apache/log4j/LogManager, method: <clinit> signature: ()V) Incompatible argument to function
            at org.apache.log4j.Logger.getLogger(Logger.java:85)

    Nothing happens after that. I am using the latest version of moredatatemplates.jar.

     
    • Paulo Carmo

      Paulo Carmo - 2003-10-09

      What class are you trying to run ?

      What version of log4j are you using ?

      latest version of moredatatemplate.jar was build with version 1.2.7 of log4j, i test this build with log4j 1.2.8 and had no problems.

       
    • J O M Okomba

      J O M Okomba - 2003-10-13

      I am running the class created from the DataEntry wizard.

      I am using log4j-1.2.8.

      I have included moredata.jar,moredatatemplates.jar and oltp-stable.jar in the CLASSPATH. Could this be the problem?

       
      • Paulo Carmo

        Paulo Carmo - 2003-10-13

        I don't think that's the problem because moredata.jar (1.0.1) , moredatatemplates.jar (0.50) and oltp-stable.jar (1.0.1) was built at the same time so they have the same class version.

        Whoever you should have only one jar in classpath.
        If you have instated moredatatemplates from .nbm you should have a copy of moredatatemplates.jar in

            NETBEANS_DIR/modules/moredatatemplates.jar

        and a copy of log4j 1.2.7 in

            NETBEANS_DIR/lib/ext/log4j-1.2.7.jar

        The error you have report has generated by java.lang.VerifyError, and looks like you are using tow different versions of log4j, maybe the version 1.2.7 installed in NetBeans directory is getting in the way.

        Can you run the following code ? :

        --------------------------------------------------------------------------------------------------------------
        import org.apache.log4j.Level;
        import org.apache.log4j.Logger;

        public class Log4JTest {
            private static Logger _logger = Logger.getLogger(Log4JTest.class.getName());
          
            public static void main(String args[]) {
                if (_logger.isEnabledFor(Level.DEBUG))
                    _logger.debug("Debug message");
            }
        }
        --------------------------------------------------------------------------------------------------------------

         
    • J O M Okomba

      J O M Okomba - 2003-10-14

      After eliminating the other log4j libraries from netbeans mounted filesystems i am able to go past the log4j error shown previously. But i am now getting this error:

      java.lang.RuntimeException: O Ficheiro de configuracao nao foi encontrado [C:\Documents and Settings\mm\.db.informix.unstable.teste.xml]
              at pt.moredata.connection.ConnectionFactory.createDataSourceFromHomeDir(Unknown Source)

      Though i configured the app to use postgres, i am seeing this line:

      _dataSource = ConnectionFactory.instance().createDataSourceFromHomeDir(".db.informix.unstable.teste.xml");

      and ".db.informix.unstable.teste.xml" is not in my home directory.

      What could be the problem?

       
      • Paulo Carmo

        Paulo Carmo - 2003-10-14

        Generated code creates a DataSource (and a jdbc Connection) from a configuration file, you can:

        1- Create the configuration file on your home.

        2- Create the configuration file in other directory and change that line of code to

        _dataSource=ConnectionFactory.instance().createConnectionFromXmlFile("FILE_PATH");

        3- Create a JDBC Connection by hand an use it to create the DataSource :

        Connection c = ... ;
        _dataSource = new DataSource(c);

         
    • J O M Okomba

      J O M Okomba - 2003-10-14

      How does the configuration file look like?

      If I did:
      Connection c = ... ;
      _dataSource = new DataSource(c);

      Will the framework do database pooling for me?

       
      • Paulo Carmo

        Paulo Carmo - 2003-10-14

        What do you mean about "database pooling" ?

        The configuration file look like this:

        1.1 version
        ----------------

        <?xml version="1.0" encoding="UTF-8"?>

        <dataSource id="ninja">
           <jdbc driver="com.informix.jdbc.IfxDriver">
              <subProtocol name="informix-sqi">
                 <hostName>ninja.despodata.pt</hostName>
                 <port>1530</port>
                 <dataBaseName>gai</dataBaseName>
                 <server name="informixserver=unstable">
                    <property name="TRACE" value="3"/>
                    <property name="TRACEFILE" value="/tmp/trace.out"/>
                    <property name="PROTOCOLTRACE" value="2"/>
                    <property name="PROTOCOLTRACEFILE" value="/tmp/ptrace.out"/>
                 </server>
              </subProtocol> 
           </jdbc>
           <userName>nome</userName>
           <password>chave</password>
           <debug>true</debug>
        </dataSource>

        1.2 Version
        -----------------

        <?xml version="1.0" encoding="UTF-8"?>

        <dataSource id="ninja">
           <url value="jdbc:informix-sqli://HOST:PORT/DB:INFORMIXSERVER=SERVER_NAME"/>
           <driver value="com.informix.jdbc.IfxDriver"/>
           <userName value="username"/>
           <password value="password"/>
           <debug value="true"/>
        </dataSource>

        Methods from ConnectionFactory with no suffix use version 1.1, methods with '12' suffix version 1.2.

        I think last moredatatemplates version (0.5) creates a default config file (dataEntry.xml) in the user home dir.

         
    • J O M Okomba

      J O M Okomba - 2003-10-15

      Thanks. It works, though messages appear to be in French (which i don't understand at the moment)

       
      • Paulo Carmo

        Paulo Carmo - 2003-10-15

        I don't know why the messages are in French,  i take a look at the code and i realize that the locale has hard coded to 'pt' (Portuguese) locale. i already correct this problem.

        In mean wile you can correct this by adding the following code to the generated class :

        pt.moredata.dataentry.Constants.locale = java.util.Locale.getDefault();

         
    • Ricardo Lopes

      Ricardo Lopes - 2003-12-31

      i think that what okomba means with "database pooling" is rather "connection pool", as you can see in:

      http://www-106.ibm.com/developerworks/java/library/j-pool/

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.