1 Reply Latest reply on Jul 16, 2007 6:19 AM by Carlos Gardel

    Classloaders problem with jca

    Carlos Gardel Newbie


      Hi

      I'm trying to test my application related to a jca resource adapter I did and a webservices that use such ra.

      In my web services I did:

      
      
       InitialContext context = new InitialContext(CicsConfigHelper.getJndiProperties());
      
       CdsConnectionFactoryImpl cxFactory = (CdsConnectionFactoryImpl) context
       .lookup("java:/CicsDS");
      
       CdsRecordFactoryImpl recordFactory = (CdsRecordFactoryImpl) cxFactory.getRecordFactory();
       CdsIndexedRecordImpl input = (CdsIndexedRecordImpl) recordFactory.createIndexedRecord(CdsIndexedRecord.INPUT);
       input.add(data.toString());
      
       CdsIndexedRecordImpl output = (CdsIndexedRecordImpl) recordFactory.createIndexedRecord(CdsIndexedRecord.OUTPUT);
      
       CdsConnection connection = (CdsConnection) cxFactory.getConnection();
      
       CdsInteractionSpecImpl ispec = new CdsInteractionSpecImpl(); ispec.setFunctionName(CdsInteractionSpec.CICS_OPERATION_FUNCTION);
      
       CdsInteractionImpl interaction = (CdsInteractionImpl) connection.createInteraction();
      
       if (interaction.execute((InteractionSpec) ispec, (Record)input, (Record)output)) {
      
       message = (String) output.get(CdsIndexedRecord.MESSAGE_FIELD);
      
       } else {
       logger.error("Execute was false");
       }
      
      



      But when I call this web services I receive a throwable as follows:

      13:57:15,159 INFO [STDOUT] java.lang.LinkageError: loader constraint violation:
      when resolving method "com.bs.cds.jca.CdsInteractionImpl.execute(Ljavax/resourc
      e/cci/InteractionSpec;Ljavax/resource/cci/Record;Ljavax/resource/cci/Record;)Z"
      the class loader (instance of org/jboss/web/tomcat/tc5/WebAppClassLoader) of the
       current class, com/bs/cics/ws/CicsWSImpl, and the class loader (instance of org
      /jboss/mx/loading/UnifiedClassLoader3) for resolved class, com/bs/cds/jca/CdsInt
      eractionImpl, have different Class objects for the type javax/resource/cci/Inter
      actionSpec used in the signature
      


      My web service is inside an ear that comes with an axis1.3.war.

      I've tested placing the jar file with my jca classes inside the rar file and outside, in the server instance lib directory, always with same problem.

      The problem occurs when execute method is invoked.

      Could some body please tell me how could I solve the problem ?

      Thanks in advance

      J