6 Replies Latest reply on Jul 2, 2003 8:15 AM by sayontan

    ERROR: invalid console appender config detected, console str

    mattma Newbie

      Hello,

      When I try to deploy an ejb jar file into jboss, the deployment process ends abruptly with this message:

      ERROR: invalid console appender config detected, console stream is looping

      I am using log4j in my ejb module, however, my log4j.properties file does not configure a console appender.

      My log4j.jar has some extra classes in it - namely a "SmartLog" logger that overrides the debug(), info(), etc. methods. Some of the overridden methods will call System.out.println(). Might the SmartLog class have anything to do with this problem?

      My server.log file isn't saying anything about this. So I'm not sure how to start figuring this out.

      Any help would be appreciated. Thanks.

      -matt


      LOG4J FILE:
      log4j.loggerFactory=com.lightplug.smartlog.log4j.SmartLogFactory
      log4j.rootLogger=DEBUG, fileout
      log4j.appender.fileout=org.apache.log4j.RollingFileAppender
      log4j.appender.fileout.layout=org.apache.log4j.PatternLayout
      log4j.appender.fileout.layout.ConversionPattern=%d{HH:mm:ss} %-5p (%c | %F:%L) %m%n
      log4j.appender.fileout.File=d:/app/eclipse/workspace/memory.betaEJB/memory.beta.ejb.log
      log4j.appender.fileout.MaxFileSize=5MB
      log4j.appender.fileout.MaxBackupIndex=4
      log4j.logger.guerilla=TRACE#com.lightplug.smartlog.log4j.XLevel
      smartlog.category.default=guerilla


      CONSOLE:
      11:30:40,171 INFO [MainDeployer] Starting deployment of package:file:/D:/srv/j
      boss/server/default/deploy/memory.betaEJB.jar
      11:30:40,875 INFO [EJBDeployer] nested deployment: file:/D:/srv/jboss/server/de
      fault/tmp/deploy/server/default/deploy/memory.betaEJB.jar/40.memory.betaEJB.jar-
      contents/META-INF/lib/castor.jar
      11:30:40,890 INFO [EJBDeployer] nested deployment: file:/D:/srv/jboss/server/de
      fault/tmp/deploy/server/default/deploy/memory.betaEJB.jar/40.memory.betaEJB.jar-
      contents/META-INF/lib/commons-pool.jar
      11:30:40,906 INFO [EJBDeployer] nested deployment: file:/D:/srv/jboss/server/de
      fault/tmp/deploy/server/default/deploy/memory.betaEJB.jar/40.memory.betaEJB.jar-
      contents/META-INF/lib/csvjdbc.jar
      11:30:40,906 INFO [EJBDeployer] nested deployment: file:/D:/srv/jboss/server/de
      fault/tmp/deploy/server/default/deploy/memory.betaEJB.jar/40.memory.betaEJB.jar-
      contents/META-INF/lib/jdom.jar
      11:30:40,921 INFO [EJBDeployer] nested deployment: file:/D:/srv/jboss/server/de
      fault/tmp/deploy/server/default/deploy/memory.betaEJB.jar/40.memory.betaEJB.jar-
      contents/META-INF/lib/junit.jar
      11:30:40,953 INFO [EJBDeployer] nested deployment: file:/D:/srv/jboss/server/de
      fault/tmp/deploy/server/default/deploy/memory.betaEJB.jar/40.memory.betaEJB.jar-
      contents/META-INF/lib/log4j.jar
      11:30:40,968 INFO [EJBDeployer] nested deployment: file:/D:/srv/jboss/server/de
      fault/tmp/deploy/server/default/deploy/memory.betaEJB.jar/40.memory.betaEJB.jar-
      contents/META-INF/lib/lucene.jar
      11:30:40,984 INFO [EJBDeployer] nested deployment: file:/D:/srv/jboss/server/de
      fault/tmp/deploy/server/default/deploy/memory.betaEJB.jar/40.memory.betaEJB.jar-
      contents/META-INF/lib/postgresql.jar
      11:30:41,000 INFO [EJBDeployer] nested deployment: file:/D:/srv/jboss/server/de
      fault/tmp/deploy/server/default/deploy/memory.betaEJB.jar/40.memory.betaEJB.jar-
      contents/META-INF/lib/trove.jar
      11:30:41,093 INFO [EJBDeployer] nested deployment: file:/D:/srv/jboss/server/de
      fault/tmp/deploy/server/default/deploy/memory.betaEJB.jar/40.memory.betaEJB.jar-
      contents/META-INF/lib/xerces.jar
      11:30:41,125 INFO [EJBDeployer] nested deployment: file:/D:/srv/jboss/server/de
      fault/tmp/deploy/server/default/deploy/memory.betaEJB.jar/40.memory.betaEJB.jar-
      contents/META-INF/lib/xindice.jar
      11:30:41,140 INFO [EJBDeployer] nested deployment: file:/D:/srv/jboss/server/de
      fault/tmp/deploy/server/default/deploy/memory.betaEJB.jar/40.memory.betaEJB.jar-
      contents/META-INF/lib/xml-apis.jar
      11:30:41,140 INFO [EJBDeployer] nested deployment: file:/D:/srv/jboss/server/de
      fault/tmp/deploy/server/default/deploy/memory.betaEJB.jar/40.memory.betaEJB.jar-
      contents/META-INF/lib/xmldb-sdk.jar
      11:30:41,140 INFO [EJBDeployer] nested deployment: file:/D:/srv/jboss/server/de
      fault/tmp/deploy/server/default/deploy/memory.betaEJB.jar/40.memory.betaEJB.jar-
      contents/META-INF/lib/xmldb-xupdate.jar
      11:30:41,156 INFO [EJBDeployer] nested deployment: file:/D:/srv/jboss/server/de
      fault/tmp/deploy/server/default/deploy/memory.betaEJB.jar/40.memory.betaEJB.jar-
      contents/META-INF/lib/xmldb.jar
      11:30:41,953 WARN [MainDeployer] The manifest entry in file:/D:/srv/jboss/serve
      r/default/tmp/deploy/server/default/deploy/memory.betaEJB.jar/40.memory.betaEJB.
      jar-contents/META-INF/lib/castor.jar references URL file:/D:/srv/jboss/server/de
      fault/tmp/deploy/server/default/deploy/memory.betaEJB.jar/40.memory.betaEJB.jar-
      contents/META-INF/lib/jdbc-se2.0.jar which could not be opened, entry ignored
      11:30:41,953 WARN [MainDeployer] The manifest entry in file:/D:/srv/jboss/serve
      r/default/tmp/deploy/server/default/deploy/memory.betaEJB.jar/40.memory.betaEJB.
      jar-contents/META-INF/lib/castor.jar references URL file:/D:/srv/jboss/server/de
      fault/tmp/deploy/server/default/deploy/memory.betaEJB.jar/40.memory.betaEJB.jar-
      contents/META-INF/lib/jndi.jar which could not be opened, entry ignored
      11:30:41,953 WARN [MainDeployer] The manifest entry in file:/D:/srv/jboss/serve
      r/default/tmp/deploy/server/default/deploy/memory.betaEJB.jar/40.memory.betaEJB.
      jar-contents/META-INF/lib/castor.jar references URL file:/D:/srv/jboss/server/de
      fault/tmp/deploy/server/default/deploy/memory.betaEJB.jar/40.memory.betaEJB.jar-
      contents/META-INF/lib/jta1.0.1.jar which could not be opened, entry ignored
      11:30:42,046 INFO [MainDeployer] deployment waiting for deployer: file:/D:/srv/
      jboss/server/default/tmp/deploy/server/default/deploy/memory.betaEJB.jar/40.memo
      ry.betaEJB.jar-contents/META-INF/lib/jdom.jar
      ERROR: invalid console appender config detected, console stream is looping

        • 1. Re: ERROR: invalid console appender config detected, console
          lbalazs Newbie

          Hi!

          I have had the same problem in tomcat as I have tried to configure the log4j loggers programmatically.

          The solution i have found is to use jdk1.4 loggers in my webapp. I think that using log4j in a webapp in tomcat or jboss is a built-in problem, since log4j uses static global log configuration, and if you make something unusual to the config, it will have side effects.

          But unfortunately, i dont have a specific solution to the problem using log4j, neither can i tell under which circumstances it happens.

          Regards,
          Balazs

          • 2. Re: ERROR: invalid console appender config detected, console
            mattma Newbie

            Thanks for the reply. I too was wondering about the log4j issue. So I put my log4j.jar file into the template app and modified one of the template session beans to instantiate a logger instance and made a method call to it just like I do in my app and everything worked ok.

            Since then, I've started to deploy my app one piece at a time. So far, I've gotten a quarter way through it successfully and that quarter already uses the log4j classes. So now I'm thinking this isn't a log4j issue. Hopefully by deploying my app one bean at a time, I can isolate the problem.

            If anyone else has an idea, please let me know. Thanks!

            • 3. Re: ERROR: invalid console appender config detected, console
              mattma Newbie

              OK, I've isolated the one bean that causes this error message to appear. It's the only BMP Entity bean I have in my app. I can't figure out what is wrong with it. But when I deploy this bean, JBoss crashes with the invalid console appender message and when I tell xdoclet to not include this bean in the ejb-jar.xml, everything deploys fine.

              Originally I thought this was a log4j issue - but all of my other beans use my custom log4j categroy the same way that this entity bean uses it. So I don't think this is a log4j issue.

              Also, this entity bean deploys fine on Websphere and Sun One App server. So I'm at a loss as to what is wrong with my entity bean. If someone has a suggestion, I'm all ears!

              thanks in advance.

              matt


              DEPLOYMENT DESCRIPTOR


              <![CDATA[Bean implementation class for Enterprise Bean: Record The Entity bean represents a Record Entity with BMP]]>
              <display-name>Record Entity</display-name>

              <ejb-name>Record</ejb-name>

              com.lightspoke.memory.database.record.RecordHome
              com.lightspoke.memory.database.record.Record
              <local-home>com.lightspoke.memory.database.record.RecordLocalHome</local-home>
              com.lightspoke.memory.database.record.RecordLocal

              <ejb-class>com.lightspoke.memory.database.record.RecordBean</ejb-class>
              <persistence-type>Bean</persistence-type>
              <prim-key-class>com.lightspoke.memory.database.record.RecordPK</prim-key-class>
              False





              BEAN CLASS

              package com.lightspoke.memory.database.record;

              import java.rmi.RemoteException;
              import javax.ejb.*;
              import javax.naming.*;

              import com.lightspoke.memory.tool.*;
              import com.lightspoke.memory.persistence.dao.factory.postgresql.*;
              import com.lightspoke.memory.persistence.dao.factory.postgresql.record.*;
              import com.lightspoke.memory.database.cache.MetaKeyCache;
              import com.lightplug.smartlog.log4j.*;

              /**
              * Bean implementation class for Enterprise Bean: Record
              * The Entity bean represents a Record Entity with BMP
              *
              * @author Matthew Ma
              * Copyright (C) 2003 Lightspoke, LLC.
              * All rights reserved.
              * http://www.lightspoke.com
              *
              * @ejb.bean name="Record"
              * display-name="Record Entity"
              * type="BMP"
              * jndi-name="ejb/com/lightspoke/memory/database/record/Record"
              * local-jndi-name="local/com/lightspoke/memory/database/record/Record"
              * view-type = "both"
              *
              * @ejb.transaction type="Required"
              * @ejb.pk class="com.lightspoke.memory.database.record.RecordPK" generate="false"
              */
              public class RecordBean implements javax.ejb.EntityBean {
              private SmartLog log;
              private PostgresqlRecordDAO rd;
              private RecordPK rpk;
              private RecordVO recvo=null, oldrecvo=null;
              private MetaKeyCache mkc = null;
              private javax.ejb.EntityContext myEntityCtx;


              /**
              * getEntityContext
              */
              public javax.ejb.EntityContext getEntityContext() {
              return myEntityCtx;
              }
              /**
              * setEntityContext
              */
              public void setEntityContext(javax.ejb.EntityContext ctx) {
              System.err.println("setEntityContext()");
              myEntityCtx = ctx;
              try {
              log = SmartLog.getSmartLog();
              EJBHomeFactory ejbf = EJBHomeFactory.getInstance();
              mkc = MetaKeyCache.getInstance();
              PostgresqlRecordDAOHome prdHome=(PostgresqlRecordDAOHome)
              ejbf.remoteHome("PostgresqlRecordDAO", PostgresqlRecordDAOHome.class);
              rd = prdHome.create();
              } catch (RemoteException e) {
              log.error(e);
              } catch (NamingException e) {
              log.error(e);
              } catch (CreateException e) {
              log.error(e);
              }
              }


              /**
              * unsetEntityContext
              */
              public void unsetEntityContext() {
              myEntityCtx = null;
              }

              /**
              * ejbActivate
              */
              public void ejbActivate() {
              }


              public RecordPK ejbCreate(int docid, RecordVO recordvo) throws CreateException {
              System.err.println("ejbCreate(" + mkc.lookupUser(docid) + "," + docid+","+recordvo+")");
              try {
              this.setRecordVO(recordvo);
              log.debug("Entity Bean - Record.ejbCreate(recordvo=" + recordvo + ")");
              //should validate recordvo with metadata!!!
              log.debug("create(" + mkc.lookupUser(docid) + ", " + docid + ")");
              rpk = rd.create(docid,recordvo);
              return rpk;
              } catch (RemoteException e) {
              log.error(e);
              }
              return null;
              }


              /**
              *
              * @ejb:create-method view-type="remote"
              **/
              public RecordPK ejbCreate(int docid) throws CreateException {
              System.err.println("ejbCreate(" + mkc.lookupUser(docid) + "," + docid+")");
              try {
              log.debug("Entity Bean - Record.ejbCreate(blank)");
              //should validate recordvo with metadata!!!
              log.debug("create(" + mkc.lookupUser(docid) + ", " + docid + ")");
              this.recvo = rd.createBlank(docid);
              rpk = rd.create(docid);
              return rpk;
              } catch (RemoteException e) {
              log.error(e);
              }
              return null;
              }


              /**
              * ejbFindByPrimaryKey
              */
              public RecordPK ejbFindByPrimaryKey(RecordPK primaryKey) throws javax.ejb.FinderException {
              System.err.println("ejbFindByPrimaryKey(" + primaryKey.getDocid() + "," + primaryKey.getRowid() + ")");
              RecordPK retkey=null;
              try {
              if (rd.find(primaryKey)!=null) {
              retkey = primaryKey;
              }
              } catch (RemoteException e) {
              log.error("rd.find() remote exception: ", e);
              }
              return retkey;
              }
              /**
              * ejbLoad
              */
              public void ejbLoad() {
              log.debug("ejbLoad() called....");
              RecordPK primarykey = (RecordPK)myEntityCtx.getPrimaryKey();
              System.err.println("ejbLoad() row=" + primarykey.getRowid());

              if (primarykey.getRowid()>=0) {
              try {
              RecordVO tmprecvo = rd.find(primarykey);
              this.setRecordVO(tmprecvo);
              this.oldrecvo = tmprecvo;
              } catch (RemoteException e) {
              log.error("rd.find() remote exception: ", e);
              }
              }
              return;
              }
              /**
              * ejbPassivate
              */
              public void ejbPassivate() {
              }
              /**
              * ejbPostCreate
              */
              public void ejbPostCreate(int docid, RecordVO recordvo) throws javax.ejb.CreateException {
              }

              public void ejbPostCreate(int docid) throws javax.ejb.CreateException {
              }
              /**
              * ejbRemove
              */
              public void ejbRemove() throws javax.ejb.RemoveException {
              log.debug("ejbRemove() called....");
              RecordPK primarykey = (RecordPK)myEntityCtx.getPrimaryKey();
              try {
              rd.delete(primarykey);
              } catch (RemoteException e) {
              log.error("rd.delete() remote exception: ", e);
              }
              return;
              }
              /**
              * ejbStore
              */
              public void ejbStore() {
              System.err.println("ejbStore()");
              log.debug("ejbStore() called....");
              RecordPK primarykey = (RecordPK)myEntityCtx.getPrimaryKey();
              try {
              log.debug("current recvo=" + getRecordVO());
              log.debug("old recvo=" + this.oldrecvo);
              log.debug("recvo = oldrecvo? " + recvo.like(oldrecvo));
              if (recvo!=null && (oldrecvo!=null && !recvo.like(oldrecvo)) ) {

              rd.update(primarykey, getRecordVO());
              }
              } catch (RemoteException e) {
              log.error("rd.update() remote exception: ", e);
              }
              return;
              }


              /**
              *
              * @ejb:interface-method view-type="both"
              **/
              public RecordVO getRecordVO() {
              log.debug("running getRecordVO()...");
              return this.recvo;
              }

              /**
              *
              * @ejb:interface-method view-type="both"
              **/
              public void setRecordVO(RecordVO recordvo) {
              System.err.println("setRecordVO(" + recordvo + ")");
              log.debug("running setRecordVO()...");
              if (recordvo!=null) {
              this.oldrecvo = this.recvo;
              this.recvo = recordvo;
              }
              return;
              }


              }

              • 4. Re: ERROR: invalid console appender config detected, console
                mattma Newbie

                one more thing... the last line in the server.log file before I get the "console is looping" error is verifying the jar file.

                8 07:39:16,890 DEBUG [org.jboss.ejb.EJBDeployer] Verifying file:/D:/srv/jboss/server/default/deploy/memory.betaEJB.jar

                When this jar file's deployment descriptor does not contain the Record BMP bean mentioned in my previous post everything deploys properly. Other than that, there is no change in the jar file except for the ejb-jar.xml and jboss.xml.


                • 5. Re: ERROR: invalid console appender config detected, console
                  mattma Newbie

                  OK, so just in case anyone else ever wonders about this error message - in my case, it was definitely Log4J. It's a pitty because I was plannning on using Nested Diagnostic Contexts that I can't really find in any other logging framework. Anyone have any ideas?

                  I even had custom Logger built for Log4J. I simply took the code, downloaded LumberJack - the open source project that is actually the java.util.logging in the jdk (per lbalazs' recommendation) and rebuilt the project with my extra logic into it.

                  What had happened was that my setEntityContext method inside my BMP entity actually did something with the logger that I instantiated while the ejbCreate methods only instantiated the logger. Upon using the instantiated logger, you'll get the error message.

                  • 6. Re: ERROR: invalid console appender config detected, console
                    sayontan Newbie

                    Hi,
                    This might be a bit late for your query, but I guess you can have a look at this site: http://www.2k-software.de/ingo/log4j.html. I faced a similar problem trying to deploy my application with log4j into JBoss. The catch apparently is that since JBoss internally uses log4j, you will have to migrate the contents of your log4j.properties to the log4j.xml of JBoss.

                    HTH.
                    Sayontan.