4 Replies Latest reply on Dec 23, 2013 3:20 PM by Harish Maridi

    java.lang.InstantiationException - Jboss 6.1 EAP Alpha

    Harish Maridi Newbie

      Hi,

       

      I am trying to deploy a rar file to jboss/standalone/deployments folder. rar has derby, json1.0 jars. When there is no json1.0 jar is available then I saw ClassNotFound error with JSONException. After I included json1.0 jar, I started seeing java.lang.InstantiationException in server.log, There is not much explanation. Forums mentioning that this might be related to wrong jar versions. Please help me fix this issue.

       

      This rar is associated with a jndi name binding. definded in standalone.xml. Please let me know if any more details needed.

       

      16:40:05,430 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-16) MSC00001: Failed to start service jboss.ra.deployment."CommonAuditLogConnector.rar_1": org.jboss.msc.service.StartException in service jboss.ra.deployment."CommonAuditLogConnector.rar_1": org.jboss.msc.service.StartException in anonymous service: JBAS010446: Failed to start RA deployment [CommonAuditLogConnector]

          at org.jboss.as.connector.services.resourceadapters.deployment.ResourceAdapterXmlDeploymentService.start(ResourceAdapterXmlDeploymentService.java:131)

          at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.4.GA.jar:1.0.4.GA]

          at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.4.GA.jar:1.0.4.GA]

          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) [rt.jar:1.6.0_45]

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) [rt.jar:1.6.0_45]

          at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_45]

      Caused by: org.jboss.msc.service.StartException in anonymous service: JBAS010446: Failed to start RA deployment [CommonAuditLogConnector]

          at org.jboss.as.connector.services.resourceadapters.deployment.ResourceAdapterXmlDeploymentService.start(ResourceAdapterXmlDeploymentService.java:115)

          ... 5 more

      Caused by: org.jboss.jca.deployers.common.DeployException: JBAS010472: Deployment com.avnet.mobi.jca.logging.audit.CommonAuditLogConnector failed

          at org.jboss.as.connector.services.resourceadapters.deployment.AbstractResourceAdapterDeploymentService$AbstractAS7RaDeployer.initAndInject(AbstractResourceAdapterDeploymentService.java:450)

          at org.jboss.jca.deployers.common.AbstractResourceAdapterDeployer.createObjectsAndInjectValue(AbstractResourceAdapterDeployer.java:1364)

          at org.jboss.as.connector.services.resourceadapters.deployment.ResourceAdapterXmlDeploymentService$AS7RaXmlDeployer.doDeploy(ResourceAdapterXmlDeploymentService.java:183)

          at org.jboss.as.connector.services.resourceadapters.deployment.ResourceAdapterXmlDeploymentService.start(ResourceAdapterXmlDeploymentService.java:108)

          ... 5 more

      Caused by: java.lang.InstantiationException: com.avnet.mobi.jca.logging.audit.CommonAuditLogConnector

          at java.lang.Class.newInstance0(Class.java:342) [rt.jar:1.6.0_45]

          at java.lang.Class.newInstance(Class.java:310) [rt.jar:1.6.0_45]

          at org.jboss.as.connector.services.resourceadapters.deployment.AbstractResourceAdapterDeploymentService$AbstractAS7RaDeployer.initAndInject(AbstractResourceAdapterDeploymentService.java:416)

          ... 8 more

       

      Thanks,

      Harish Maridi

        • 1. Re: java.lang.InstantiationException - Jboss 6.1 EAP Alpha
          jaikiran pai Master

          Caused by: java.lang.InstantiationException: com.avnet.mobi.jca.logging.audit.CommonAuditLogConnector

              at java.lang.Class.newInstance0(Class.java:342) [rt.jar:1.6.0_45]

              at java.lang.Class.newInstance(Class.java:310) [rt.jar:1.6.0_45]

              at org.jboss.as.connector.services.resourceadapters.deployment.AbstractResourceAdapterDeploymentService$AbstractAS7RaDeployer.initAndInject(AbstractResourceAdapterDeploymentService.java:416)

              ... 8 more

          What does the CommonAudtiLogConnector class look like? Does it have a no-argument constructor?

          • 2. Re: java.lang.InstantiationException - Jboss 6.1 EAP Alpha
            Harish Maridi Newbie

            Hi Jaikiran,

             

            I am attaching the source of the CommonAuditLogConnector, it doesn't have a no argument constuctor.

             

            package com.avnet.mobi.jca.logging.audit;

            import java.io.PrintWriter;

            import java.sql.Connection;

            import java.sql.Date;

            import java.sql.DriverManager;

            import java.sql.PreparedStatement;

            import java.sql.ResultSet;

            import java.sql.ResultSetMetaData;

            import java.sql.SQLException;

            import java.sql.Statement;

            import java.sql.Types;

            import java.util.Calendar;

            import java.util.Hashtable;

            import java.util.Set;

            import java.util.Timer;

            import java.util.TimerTask;

            import java.util.concurrent.ConcurrentLinkedQueue;

            import javax.resource.ResourceException;

            import javax.resource.cci.IndexedRecord;

            import javax.resource.spi.ConnectionManager;

            import javax.resource.spi.ConnectionRequestInfo;

            import javax.resource.spi.ManagedConnection;

            import javax.security.auth.Subject;

            import org.apache.log4j.Logger;

            import org.json.me.JSONArray;

            import org.json.me.JSONException;

            import org.json.me.JSONObject;

            import com.avnet.mobi.jca.SimpleIndexedRecordConnector;

            public class CommonAuditLogConnector extends SimpleIndexedRecordConnector {

               public CommonAuditLogConnector(boolean initialized, Connection conn,

              PreparedStatement stmt, Logger logger, Reaper reaper,

              Hashtable map, String categoryMap, String driverName,

              String databaseUrl, String sqlCountAll, String sqlTableCreate,

              String sqlInsert) {

              super();

              this.initialized = initialized;

              this.conn = conn;

              this.stmt = stmt;

              this.logger = logger;

              this.reaper = reaper;

              this.map = map;

              this.categoryMap = categoryMap;

              this.driverName = driverName;

              this.databaseUrl = databaseUrl;

              this.sqlCountAll = sqlCountAll;

              this.sqlTableCreate = sqlTableCreate;

              this.sqlInsert = sqlInsert;

              }

             

              @Override

              protected void configure() throws Exception {

              // TODO Auto-generated method stub

              super.configure();

              }

             

              @Override

              public Object createConnectionFactory() throws ResourceException {

              // TODO Auto-generated method stub

              return super.createConnectionFactory();

              }

             

              @Override

              public Object createConnectionFactory(ConnectionManager arg0)

              throws ResourceException {

              // TODO Auto-generated method stub

              return super.createConnectionFactory(arg0);

              }

             

              @Override

              public ManagedConnection createManagedConnection(Subject arg0,

              ConnectionRequestInfo arg1) throws ResourceException {

              // TODO Auto-generated method stub

              return super.createManagedConnection(arg0, arg1);

              }

             

              @Override

              public PrintWriter getLogWriter() throws ResourceException {

              // TODO Auto-generated method stub

              return super.getLogWriter();

              }

             

              @Override

              public ManagedConnection matchManagedConnections(Set arg0, Subject arg1,

              ConnectionRequestInfo arg2) throws ResourceException {

              // TODO Auto-generated method stub

              return super.matchManagedConnections(arg0, arg1, arg2);

              }

             

              @Override

              public void setLogWriter(PrintWriter arg0) throws ResourceException {

              // TODO Auto-generated method stub

              super.setLogWriter(arg0);

              }

             

              @Override

              protected Object clone() throws CloneNotSupportedException {

              // TODO Auto-generated method stub

              return super.clone();

              }

             

              @Override

              public boolean equals(Object obj) {

              // TODO Auto-generated method stub

              return super.equals(obj);

              }

             

              @Override

              protected void finalize() throws Throwable {

              // TODO Auto-generated method stub

              super.finalize();

              }

             

              @Override

              public int hashCode() {

              // TODO Auto-generated method stub

              return super.hashCode();

              }

             

              @Override

              public String toString() {

              // TODO Auto-generated method stub

              return super.toString();

              }

             

              //init flag

              private boolean initialized = false;

               //connection

              private Connection conn = null;

               //statement

              private PreparedStatement stmt = null;

               //set logger

              private Logger logger = Logger.getLogger(this.getClass());

               //timer

              private final Timer timer = new Timer();

               //reaper

              private Reaper reaper = null;

               //map

              private Hashtable map = new Hashtable();

               //mapping

              private String categoryMap = null;

               //driver name

              private String driverName = null;

               //database url

              private String databaseUrl = null;

               //count sql

              private String sqlCountAll = null;

               //table create

              private String sqlTableCreate = null;

               //insert

              private String sqlInsert = null;

              //serial id

              private static final long serialVersionUID = -3885209014506162649L;

               public void doLogging(IndexedRecord in, IndexedRecord out)  throws ResourceException {

               try {

               //get data

              Object obj = in.get(1);

               //if string array

              if(obj instanceof String[] ) {

               //queue it

              this.reaper.addToQueue(obj);

               //otherwise tread as a query and return as csv string

              } else {

               //get statement

              PreparedStatement statement = conn.prepareStatement((String) obj);

               //result set

              ResultSet rs = null;

               //string buffer

              StringBuffer sb = new StringBuffer();

               try {

                  //execute

                 rs = statement.executeQuery();

                       //get metadata

                  ResultSetMetaData rsmd = rs.getMetaData();

                       //count cols

                  int count = rsmd.getColumnCount();

                       //loop

                  for(int i = 1; i <= count; i++) {

                       //get name

                  sb.append(rsmd.getColumnLabel(i)).append(i < count ? "," : "\r\n");

                       }

                      //loop

                 while(rs.next()) {

                       //loop

                  for(int i = 1; i <= count; i++) {

                       //get name

                  sb.append((rsmd.getColumnType(i) == Types.VARCHAR) ? removeCommas((String) rs.getObject(i)) : rs.getObject(i)).append(i < count ? "," : "\r\n");

                       }

                      }

                   } finally {

               try {

               //close

              if(rs != null) rs.close();

              if(statement != null) statement.close();

               } catch(Exception ex) {

               //stack trace

              ex.printStackTrace();

               //buffer

              sb.append(ex.getMessage());

               }

               //out

              out.add(0, sb.toString());

               }

               }

               } catch(Exception e) {

               //stack trace

              e.printStackTrace();

               //throw

              throw new ResourceException(e.getMessage());

               }

              }

               private synchronized void init() {

               try {

               //if already initialized return

              if(this.initialized) return;

               //if not all of the required parameters have been set return

              if(this.sqlCountAll == null ||

                this.sqlInsert == null ||

                this.sqlCountAll == null ||

                this.driverName == null ||

                this.databaseUrl == null ||

                this.categoryMap == null) return;

               //log

              this.logger.info("Initializing audit logging service");

               //set task

              reaper = this.new Reaper();

               //set up db

              this.setupDatabase();

               //get json

              JSONObject mapJson = new JSONObject(this.categoryMap);

               //get array

              JSONArray array = mapJson.getJSONArray("map");

               //table

              map = new Hashtable();

               //loop

              for(int i = 0; i < array.length(); i++) {

               //add

              map.put(array.getJSONObject(i).getString("name"), array.getJSONObject(i));

               //--debug

              logger.debug("mapped '" + array.getJSONObject(i).getString("name") + "' to alias: '" + array.getJSONObject(i).getString("alias") + "'");

               }

             

              //start the timer

              timer.scheduleAtFixedRate(reaper, 0L, 1000L);

               //set flag

              this.initialized = true;

               } catch(Exception e) {

               //log

              this.logger.error("Error initializing audit logging service:" + e.getMessage());

               //trace

            e.printStackTrace();

               } finally {

               //notify

              notifyAll();

               }

               }

             

              //setup

              private void setupDatabase() throws SQLException, ClassNotFoundException {

               //if conn is null

              if(conn == null || conn.isClosed()) {

               //--debug

              logger.info("Creating driver.");

               //load driver

              Class.forName(this.driverName);

               //new conn

              conn = DriverManager.getConnection(this.databaseUrl);

               //set auto commit

              conn.setAutoCommit(true);

               }

             

              try {

             

              //get a statement

              Statement s = conn.createStatement();

             

              //execute query

              ResultSet rs = s.executeQuery(this.sqlCountAll);

             

              //set cursor

              rs.next();

             

              //try to select

              logger.info("Starting mobility log with: " + rs.getInt(1) + " rows.");

             

              } catch(Exception e) {

             

              //exception

              e.printStackTrace();

             

              //--debug

              logger.info("Creating table.");

             

              //get statement

              Statement cstmt = conn.createStatement();

             

              //get statement

              String ddl = this.sqlTableCreate;

             

              //create

              cstmt.execute(ddl.trim());

             

              //commit

              conn.commit();

             

              }

             

              //get our statement

              stmt = conn.prepareStatement(this.sqlInsert);

             

              }

             

             

              public String getCategoryMap() {

              return categoryMap;

              }

             

             

              public void setCategoryMap(String categoryMap) {

             

              //assign

              this.categoryMap = categoryMap;

             

              try {

             

              //get json

              JSONObject mapJson = new JSONObject(this.categoryMap);

             

              //get array

              JSONArray array = mapJson.getJSONArray("map");

             

              //loop

              for(int i = 0; i < array.length(); i++) {

             

              //add

              this.map.put(array.getJSONObject(i).getString("name"), array.getJSONObject(i));

             

              //--debug

              this.logger.debug("mapped '" + array.getJSONObject(i).getString("name") + "' to alias: '" + array.getJSONObject(i).getString("alias") + "'");

             

              }

             

              //initialize

              this.init();

             

              } catch (JSONException e) {

             

              //trace

              e.printStackTrace();

             

              }

             

              }

             

             

              public String getDriverName() {

              return driverName;

              }

             

             

              public void setDriverName(String driverName) {

              this.driverName = driverName;

              this.init();

              }

             

             

              public String getDatabaseUrl() {

              return databaseUrl;

              }

             

             

              public void setDatabaseUrl(String databaseUrl) {

              this.databaseUrl = databaseUrl;

              this.init();

              }

             

             

              public String getSqlCountAll() {

              return sqlCountAll;

              }

             

             

              public void setSqlCountAll(String sqlCountAll) {

              this.sqlCountAll = sqlCountAll;

              this.init();

              }

             

             

              public String getSqlTableCreate() {

              return sqlTableCreate;

              }

             

             

              public void setSqlTableCreate(String sqlTableCreate) {

              this.sqlTableCreate = sqlTableCreate;

              this.init();

              }

             

             

              public String getSqlInsert() {

              return sqlInsert;

              }

             

             

              public void setSqlInsert(String sqlInsert) {

              this.sqlInsert = sqlInsert;

              this.init();

              }

             

             

              public static String trunc(String val, int length) {

              return (((val == null) || (val.length() <= length)) ? val : val.substring(0, length).replace(',', ' ').replace('\'', ' '));

              }

             

              public static String removeCommas(String val) {

              return val == null ? null : val.replace(",", " ");

              }

             

              class Reaper extends TimerTask {

             

             

              //logger

              private Logger logger = Logger.getLogger(this.getClass());

             

             

              //reg java timestamp

              Calendar time = Calendar.getInstance();

             

             

              //a queue

              private final ConcurrentLinkedQueue queue = new ConcurrentLinkedQueue();

             

              public void addToQueue(Object obj) {

             

              //add

              this.queue.add(obj);

             

              }

             

              public void run() {

             

             

              //if queue is empty

              if(queue.isEmpty()) return;

             

             

              //the string array we'll use

              String[] msg = null;

             

             

              //transaction strings

              String tname = "";

              String talias = "";

              String tgroup = "";

             

             

              //check queue

              while(!queue.isEmpty()) {

             

             

              try {

             

             

              //poll

              msg = (String[]) queue.poll();

             

             

              //check length

              if(msg.length < 33) throw new Exception("logged messages must be 33 fields in length.");

             

             

              //assign tx strings

              tname = msg[12];

             

             

              //if we have a mapping

              if(map.containsKey(tname)) {

             

             

              //assign

              talias = ((JSONObject) map.get(tname)).getString("alias");

              tgroup = ((JSONObject) map.get(tname)).getString("group");

             

             

              } else {

             

             

              //default

              talias = msg[11];

              tgroup = msg[13];

             

             

              }

             

             

              } catch(Exception e) {

             

             

              //log

              this.logger.error("Invalid logging message: " + e.getMessage());

             

             

              //continue

              continue;

             

             

              }

             

             

              try {

             

             

              //new timestamp

              Date now = new Date(System.currentTimeMillis());

             

             

              //set time

              time.setTimeInMillis(now.getTime());

             

             

              //get day

              int day = time.get(Calendar.DAY_OF_WEEK);

             

             

            // CREATE TABLE TBL_MOBILE_STATS_V3 (

            // idx INT NOT NULL GENERATED ALWAYS AS IDENTITY,

            // region VARCHAR(5),

              stmt.setString(1, trunc(msg[0], 5));

            // division VARCHAR(5),

              stmt.setString(2, trunc(msg[1], 5));

            // group_name VARCHAR(20),

              stmt.setString(3, trunc(msg[2], 20));

            // group_type VARCHAR(10),

              stmt.setString(4, trunc(msg[3], 10));

            // reserved_1 VARCHAR(50),

              stmt.setString(5, trunc(msg[4], 50));

            // reserved_2 VARCHAR(50),

              stmt.setString(6, trunc(msg[5], 50));

            // tstamp DATE,

              stmt.setDate(7, now);

            // day_of_week  VARCHAR(9),

              stmt.setString(8, trunc(day == Calendar.SUNDAY ? "Sunday" : day == Calendar.MONDAY ? "Monday" : day == Calendar.TUESDAY ? "Tuesday" : day == Calendar.WEDNESDAY ? "Wednesday" : day == Calendar.THURSDAY ? "Thursday" : day == Calendar.FRIDAY ? "Friday" : "Saturday", 9));

            // time_hr INT,

              stmt.setInt(9, time.get(Calendar.HOUR_OF_DAY));

            // time_min INT,

              stmt.setInt(10, time.get(Calendar.MINUTE));

            // employee_id VARCHAR(6),

              stmt.setString(11, trunc(msg[6], 6));

            // app_version VARCHAR(50),

              stmt.setString(12, trunc(msg[7], 50));

            // app_name VARCHAR(50),

              stmt.setString(13, trunc(msg[8], 50));

            // profile VARCHAR(50),

              stmt.setString(14, trunc(msg[9], 50));

            // connector VARCHAR(50),

              stmt.setString(15, trunc(msg[10], 50));

            // trans_group VARCHAR(50),

              stmt.setString(16, trunc(tgroup, 50));

            // trans_name VARCHAR(50),

              stmt.setString(17, trunc(tname, 50));

            // trans_name_display VARCHAR(100),

              stmt.setString(18, trunc(talias, 50));

            // job_role VARCHAR(50),

              stmt.setString(19, trunc(msg[14], 50));

            // job_function VARCHAR(50),

              stmt.setString(20, trunc(msg[15], 50));

            // qid VARCHAR(50),

              stmt.setString(21, trunc(msg[16], 50));

            // last_name VARCHAR(50),

              stmt.setString(22, trunc(msg[17], 50));

            // first_name VARCHAR(50),

              stmt.setString(23, trunc(msg[18], 50));

            // country VARCHAR(50),

              stmt.setString(24, trunc(msg[19], 50));

            // state VARCHAR(50),

              stmt.setString(25, trunc(msg[20], 50));

            // city VARCHAR(50),

              stmt.setString(26, trunc(msg[21], 50));

            // area VARCHAR(50),

              stmt.setString(27, trunc(msg[22], 50));

            // region_2 VARCHAR(50),

              stmt.setString(28, trunc(msg[23], 50));

            // party_id VARCHAR(50),

              stmt.setString(29, trunc(msg[24], 50));

            // branch VARCHAR(50),

              stmt.setString(30, trunc(msg[25], 50));

            // branch_name VARCHAR(50),

              stmt.setString(31, trunc(msg[26], 50));

            // manager_lname VARCHAR(50),

              stmt.setString(32, trunc(msg[27], 50));

            // manager_fname VARCHAR(50),

              stmt.setString(33, trunc(msg[28], 50));

            // device_type VARCHAR(50),

              stmt.setString(34, trunc(msg[29], 50));

            // device_model VARCHAR(50),

              stmt.setString(35, trunc(msg[30], 50));

            // os_version VARCHAR(50),

              stmt.setString(36, trunc(msg[31], 50));

            // simulator_flg VARCHAR(50))

              stmt.setString(37, trunc(msg[32], 50));

             

             

              //execute

              stmt.execute();

             

             

              } catch(Exception e) {

             

             

              //stack trace

              e.printStackTrace();

             

             

              }

             

             

              }

             

             

              }

             

             

              }

             

            }

             

            Thanks,

            Harish Maridi.

            • 3. Re: java.lang.InstantiationException - Jboss 6.1 EAP Alpha
              jaikiran pai Master

              Harish Maridi wrote:

               

              Hi Jaikiran,

               

              I am attaching the source of the CommonAuditLogConnector, it doesn't have a no argument constuctor.

               

              I haven't checked what the spec expects but have you tried creating a no-argument constructor and see if that works?

              • 4. Re: java.lang.InstantiationException - Jboss 6.1 EAP Alpha
                Harish Maridi Newbie

                Hi Jaikiran,

                 

                I created a no-argument constructor in CommonAuditLogConnector, and I am seeing the new exception in the logs now. Error is "A ConnectionFactory must have a default constructor "

                 

                Please look at the code blocks below and let me know what I am doing wrong in this case. or please let me know If I am missing any configurations to make it work.

                 

                08:53:44,035 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-10) MSC00001: Failed to start service jboss.ra.deployment."CommonAuditLogConnector.rar_1": org.jboss.msc.service.StartException in service jboss.ra.deployment."CommonAuditLogConnector.rar_1": org.jboss.msc.service.StartException in anonymous service: JBAS010446: Failed to start RA deployment [CommonAuditLogConnector]

                    at org.jboss.as.connector.services.resourceadapters.deployment.ResourceAdapterXmlDeploymentService.start(ResourceAdapterXmlDeploymentService.java:131)

                    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.4.GA.jar:1.0.4.GA]

                    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.4.GA.jar:1.0.4.GA]

                    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) [rt.jar:1.6.0_45]

                    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) [rt.jar:1.6.0_45]

                    at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_45]

                Caused by: org.jboss.msc.service.StartException in anonymous service: JBAS010446: Failed to start RA deployment [CommonAuditLogConnector]

                    at org.jboss.as.connector.services.resourceadapters.deployment.ResourceAdapterXmlDeploymentService.start(ResourceAdapterXmlDeploymentService.java:115)

                    ... 5 more

                Caused by: org.jboss.jca.deployers.common.DeployException: IJ020056: Deployment failed: file:/C:/Users/C10031/workspace_old/Servers/jboss-eap-6.1/standalone/tmp/vfs/temp6b490339293a391b/CommonAuditLogConnector.rar-58a610ee45a01b12/contents/

                    at org.jboss.jca.deployers.common.AbstractResourceAdapterDeployer.createObjectsAndInjectValue(AbstractResourceAdapterDeployer.java:2449)

                    at org.jboss.as.connector.services.resourceadapters.deployment.ResourceAdapterXmlDeploymentService$AS7RaXmlDeployer.doDeploy(ResourceAdapterXmlDeploymentService.java:183)

                    at org.jboss.as.connector.services.resourceadapters.deployment.ResourceAdapterXmlDeploymentService.start(ResourceAdapterXmlDeploymentService.java:108)

                    ... 5 more

                Caused by: org.jboss.jca.validator.ValidatorException: Severity: ERROR

                Section: 17.5.1.1

                Description: A ConnectionFactory must have a default constructor

                 

                    ... 8 more

                 

                Here is the source code: class: CommonAuditLogConnector

                public class CommonAuditLogConnector extends SimpleIndexedRecordConnector {

                    public CommonAuditLogConnector(boolean initialized, Connection conn,

                            PreparedStatement stmt, Logger logger, Reaper reaper,

                            Hashtable map, String categoryMap, String driverName,

                            String databaseUrl, String sqlCountAll, String sqlTableCreate,

                            String sqlInsert) {

                        super();

                        this.initialized = initialized;

                        this.conn = conn;

                        this.stmt = stmt;

                        this.logger = logger;

                        this.reaper = reaper;

                        this.map = map;

                        this.categoryMap = categoryMap;

                        this.driverName = driverName;

                        this.databaseUrl = databaseUrl;

                        this.sqlCountAll = sqlCountAll;

                        this.sqlTableCreate = sqlTableCreate;

                        this.sqlInsert = sqlInsert;

                    }

                    public CommonAuditLogConnector(){}    // Default constructor

                 

                Class SimpleIndexedRecordConnector::

                public abstract class SimpleIndexedRecordConnector extends ManagedConnectionFactoryImpl {

                public SimpleIndexedRecordConnector(){} // Default constructor

                public SimpleIndexedRecordConnector(boolean configured, Logger logger) {

                        super();

                        this.configured = configured;

                        this.logger = logger;

                    }

                 

                Class ManagedConnectionFactoryImpl::

                public class ManagedConnectionFactoryImpl implements ManagedConnectionFactory {

                public ManagedConnectionFactoryImpl(){} // Default constructor

                public ManagedConnectionFactoryImpl(PrintWriter pw) {

                        super();

                        this.pw = pw;

                    }

                 

                Class ManagedConnectionFactory:: - From Connector.jar (This is the only class that doesn't have a default constructor, I can't change this as this is already defined in jar file.)

                public abstract interface ManagedConnectionFactory

                  extends Serializable

                {

                  public abstract Object createConnectionFactory(ConnectionManager paramConnectionManager)

                    throws ResourceException;

                 

                  public abstract Object createConnectionFactory()

                    throws ResourceException;

                 

                  public abstract ManagedConnection createManagedConnection(Subject paramSubject, ConnectionRequestInfo paramConnectionRequestInfo)

                    throws ResourceException;

                 

                  public abstract ManagedConnection matchManagedConnections(Set paramSet, Subject paramSubject, ConnectionRequestInfo paramConnectionRequestInfo)

                    throws ResourceException;

                 

                  public abstract void setLogWriter(PrintWriter paramPrintWriter)

                    throws ResourceException;

                 

                  public abstract PrintWriter getLogWriter()

                    throws ResourceException;

                 

                  public abstract int hashCode();

                 

                  public abstract boolean equals(Object paramObject);

                }

                 

                ra.xml of CommonAuditLogConnector.rar::

                <resourceadapter>

                <managedconnectionfactory-class>com.avnet.mobi.jca.logging.audit.CommonAuditLogConnector</managedconnectionfactory-class>

                <connectionfactory-interface>javax.resource.spi.ManagedConnectionFactory</connectionfactory-interface>

                <connectionfactory-impl-class>com.avnet.mobi.jca.core.ManagedConnectionFactoryImpl</connectionfactory-impl-class>

                <connection-interface>javax.resource.cci.Connection</connection-interface>

                <connection-impl-class>com.avnet.mobi.jca.core.ConnectionImpl</connection-impl-class>

                  <transaction-support>NoTransaction</transaction-support>

                 

                Standalone.xml::    

                <resource-adapter>

                    <archive>CommonAuditLogConnector.rar</archive>

                       <connection-definitions>

                         <connection-definition class-name="com.avnet.mobi.jca.logging.audit.CommonAuditLogConnector" jndi-name="java:/logging/common/AuditLog" enabled="true" pool-name="java:/logging/common/AuditLog"/>

                         </connection-definitions>

                    </resource-adapter>

                 

                Thanks,

                Harish Maridi