JPPF, java, parallel computing, distributed computing, grid computing, parallel, distributed, cluster, grid, cloud, open source, android, .net
JPPF

The open source
grid computing
solution

 Home   About   Features   Download   Documentation   Forums 
October 22, 2019, 08:34:12 AM *
Welcome,
Please login or register.

Login with username, password and session length
Advanced search  
News: New users, please read this message. Thank you!
  Home Help Search Login Register  
Pages: [1]   Go Down

Author Topic: 5.1.3 Unable to create a connection factory JBoss EAP 7  (Read 2269 times)

Gregorio

  • JPPF Padawan
  • *
  • Posts: 9
5.1.3 Unable to create a connection factory JBoss EAP 7
« on: March 07, 2017, 01:31:17 AM »

Hello Folks,

I'm trying to get our grid working again after updating our JBoss to EAP 7.0 (standalone) and JPPF to 5.1.3.  My config details are below.  The problem I'm stuck on is that I can't get a connection factory created.  I understand that you don't have direct support for EAP 7, but I'm hoping you can point me in the right direction.

I get an NPE when I try to deploy the jppf_ra_JBoss-7.rar resource adapter:
Code: [Select]
ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 129) MSC000001: Failed to start service jboss.ra.deployer."jppf_ra_JBoss-7.rar": org.jboss.msc.service.StartException in service jboss.ra.deployer."jppf_ra_JBoss-7.rar": WFLYJCA0046: Failed to start RA deployment [jppf_ra_JBoss-7.rar]
at org.jboss.as.connector.services.resourceadapters.deployment.ResourceAdapterDeploymentService$1.run(ResourceAdapterDeploymentService.java:174)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_112]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_112]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_112]
at org.jboss.threads.JBossThread.run(JBossThread.java:320)
Caused by: org.jboss.jca.deployers.common.DeployException: WFLYJCA0072: Deployment org.jppf.jca.spi.JPPFManagedConnectionFactory failed
at org.jboss.as.connector.services.resourceadapters.deployment.AbstractResourceAdapterDeploymentService$AbstractWildFlyRaDeployer.initAndInject(AbstractResourceAdapterDeploymentService.java:582)
at org.jboss.jca.deployers.common.AbstractResourceAdapterDeployer.createObjectsAndInjectValue(AbstractResourceAdapterDeployer.java:1370) [ironjacamar-deployers-common-1.3.3.Final-redhat-1.jar:1.3.3.Final-redhat-1]
at org.jboss.as.connector.services.resourceadapters.deployment.ResourceAdapterDeploymentService$WildFLyRaDeployer.doDeploy(ResourceAdapterDeploymentService.java:226)
at org.jboss.as.connector.services.resourceadapters.deployment.ResourceAdapterDeploymentService.start(ResourceAdapterDeploymentService.java:124)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_112]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_112]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_112]
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.8.0_112]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [rt.jar:1.8.0_112]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0_112]
at java.lang.reflect.Method.invoke(Method.java:498) [rt.jar:1.8.0_112]
at org.jboss.as.connector.util.Injection.inject(Injection.java:131)
at org.jboss.as.connector.util.Injection.inject(Injection.java:87)
at org.jboss.as.connector.services.resourceadapters.deployment.AbstractResourceAdapterDeploymentService$AbstractWildFlyRaDeployer.initAndInject(AbstractResourceAdapterDeploymentService.java:569)
... 8 more
Caused by: java.lang.NullPointerException
at org.jppf.client.AbstractGenericClient.<init>(AbstractGenericClient.java:89) [jppf-client.jar:]
at org.jppf.client.JPPFClient.<init>(JPPFClient.java:125) [jppf-client.jar:]
at org.jppf.jca.spi.JPPFManagedConnectionFactory$1.<init>(JPPFManagedConnectionFactory.java:135) [jppf-jca.jar:]
at org.jppf.jca.spi.JPPFManagedConnectionFactory.setConfigurationSource(JPPFManagedConnectionFactory.java:135) [jppf-jca.jar:]
... 15 more

ERROR [org.jboss.as.controller.management-operation] (DeploymentScanner-threads - 1) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "jppf_ra_JBoss-7.rar")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.ra.deployer.\"jppf_ra_JBoss-7.rar\"" => "org.jboss.msc.service.StartException in service jboss.ra.deployer.\"jppf_ra_JBoss-7.rar\": WFLYJCA0046: Failed to start RA deployment [jppf_ra_JBoss-7.rar]
    Caused by: org.jboss.jca.deployers.common.DeployException: WFLYJCA0072: Deployment org.jppf.jca.spi.JPPFManagedConnectionFactory failed
    Caused by: java.lang.reflect.InvocationTargetException
    Caused by: java.lang.NullPointerException"}}

If I flip over to the JBoss 4.x - 6.x, I can get jppf_ra_JBoss.rar to deploy without errors.  However, creating the connection factory fails when I try to deploy jppf-ra-JBoss-ds.xml:

Code: [Select]
ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC000001: Failed to start service jboss.deployment.unit."jppf-ra-JBoss-ds.xml".PARSE: org.jboss.msc.service.StartException in service jboss.deployment.unit."jppf-ra-JBoss-ds.xml".PARSE: WFLYSRV0153: Failed to process phase PARSE of deployment "jppf-ra-JBoss-ds.xml"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:154) [wildfly-server-2.1.2.Final-redhat-1.jar:2.1.2.Final-redhat-1]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948) [jboss-msc-1.2.6.Final-redhat-1.jar:1.2.6.Final-redhat-1]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881) [jboss-msc-1.2.6.Final-redhat-1.jar:1.2.6.Final-redhat-1]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_112]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_112]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_112]
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: IJ010061: Unexpected element: connection-factories
at org.jboss.as.connector.deployers.ds.processors.DsXmlDeploymentParsingProcessor.deploy(DsXmlDeploymentParsingProcessor.java:105)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:147) [wildfly-server-2.1.2.Final-redhat-1.jar:2.1.2.Final-redhat-1]
... 5 more
Caused by: org.jboss.jca.common.metadata.ParserException: IJ010061: Unexpected element: connection-factories
at org.jboss.jca.common.metadata.ds.DsParser.parse(DsParser.java:124)
at org.jboss.jca.common.metadata.ds.DsParser.parse(DsParser.java:79)
at org.jboss.as.connector.deployers.ds.processors.DsXmlDeploymentParsingProcessor.deploy(DsXmlDeploymentParsingProcessor.java:90)
... 6 more


Ant-Version: Apache Ant 1.9.4
Created-By: 1.8.0_112-b15 (Oracle Corporation)
JPPF-Version: 5.1.3
JPPF-Build: 1777
JPPF-BuildDate: 2017-02-15 12:47 EST


Thanks,

-Gregorio
Logged

lolo

  • Administrator
  • JPPF Council Member
  • *****
  • Posts: 2256
    • JPPF Web site
Re: 5.1.3 Unable to create a connection factory JBoss EAP 7
« Reply #1 on: March 07, 2017, 07:52:53 AM »

Hello Gregorio,

There is definitely an issue with the JPPF 5.1.3 J2EE connector on JBoss AS 7. I was able to reproduce the NPE in this version.
However, I could check that this problem is fixed in JPPF 5.1.5, and I strongly recommend that you upgrade to this version, could you please do that and let us know of the outcome?

Thanks for your time,
-Laurent
Logged

Gregorio

  • JPPF Padawan
  • *
  • Posts: 9
Re: 5.1.3 Unable to create a connection factory JBoss EAP 7
« Reply #2 on: March 07, 2017, 04:40:51 PM »

Thanks for looking into it Laurent.  I'll get to work upgrading everything to 5.1.5 and will report back.

Appreciate your time,

-Gregorio
Logged

Gregorio

  • JPPF Padawan
  • *
  • Posts: 9
Re: 5.1.3 Unable to create a connection factory JBoss EAP 7
« Reply #3 on: March 07, 2017, 11:11:52 PM »

Laurent,

Ok, compiled the 5.1.5 source and brought the new jars into my project.  A slightly different problem now, I'm getting a class cast exception when I try to get the factory:

(EJB default - 3) java.lang.ClassCastException: org.jppf.jca.cci.JPPFConnectionFactory cannot be cast to org.jppf.jca.cci.JPPFConnectionFactory

This method is in a stateless session bean.
Code: [Select]
  @Override
  public JPPFConnection getConnection() throws NamingException, ResourceException
  {
    InitialContext ctx = null;
    try
    {
      ctx = new InitialContext();
      JPPFConnectionFactory factory;

      LOGGER.debug("Attempting to get connection factory from JNDI directory services at: " +
                   classConfig.JNDI_NAME());
      Object objref = ctx.lookup(classConfig.JNDI_NAME()); // Defined as eis/JPPFConnectionFactory

      if (objref instanceof JPPFConnectionFactory)
      {
        factory = (JPPFConnectionFactory) objref;
      }
      else
      {
        factory = (JPPFConnectionFactory) javax.rmi.PortableRemoteObject.narrow(objref, ConnectionFactory.class);  // Class cast exception here
      }
« Last Edit: March 07, 2017, 11:45:52 PM by Gregorio »
Logged

lolo

  • Administrator
  • JPPF Council Member
  • *****
  • Posts: 2256
    • JPPF Web site
Re: 5.1.3 Unable to create a connection factory JBoss EAP 7
« Reply #4 on: March 08, 2017, 06:28:52 AM »

Hi Gregorio,

The ClassCastException is probably a result of the class JPPFConnectionFactory being loaded by 2 different class loaders.
This is possibly due to a packaging issue for your J2EE application. Can you tell us how the JPPF resource adapter (.rar file) is deployed in your environment? To be clear: the resource adapter is designed to work as a standalone module, and there is no guarantee that it will work if embedded within an enterprise application. Also, did you follow our packaging recommendations?

If none of this helps, could you please provide more details on your application structure and its packaging? In particular, are you packaging any of the jppf*.jar in your .ear file (except for jppf-j2ee-client.jar)?

Thanks,
-Laurent
Logged

Gregorio

  • JPPF Padawan
  • *
  • Posts: 9
Re: 5.1.3 Unable to create a connection factory JBoss EAP 7
« Reply #5 on: March 08, 2017, 04:20:42 PM »

Laurent,

I don't think my packaging is up to your recommendations.  Since everything worked before the upgrade, I thought I'd be ok.  So that's one thing I'll fix up.

Right now I'm just deploying the resource adapter by hand.

Let me get the packaging setup correctly and I'll report back.

Thanks,

-Gregorio
Logged

Gregorio

  • JPPF Padawan
  • *
  • Posts: 9
Re: 5.1.3 Unable to create a connection factory JBoss EAP 7
« Reply #6 on: March 08, 2017, 10:45:53 PM »

Laurent,

We moved all of our jppf jars out of our EARs, except for jppf-j2ee-client, but were still seeing the class cast exception.  The jppf jar files had to be moved to our JBoss modules area (under modules/system/layers/base/org/jppf/main).  It was news to us that the resource adapter was bringing in its own copy of the jppf jars, and this was causing the problem.  The solution for us was to go into our EJB-EAR (where our code lives to do the JPPFConnectionFactory lookup via JNDI) and make a new dependency in its MANIFEST.MF file:

Dependencies: [existing stuff], deployment.jppf_ra_JBoss-7.rar

No more class cast exception!

Thanks for your help.

-Gregorio
Logged

Gregorio

  • JPPF Padawan
  • *
  • Posts: 9
Re: 5.1.3 Unable to create a connection factory JBoss EAP 7
« Reply #7 on: March 16, 2017, 10:55:10 PM »

Hello Laurent,

Regarding the version 5.1.5 code that I've migrated to - I think I've run into a bug that exists when I submit a synchronous job through the J2EE connector.  This is similar to the code in your User Guide section 9.4.6:

Code: [Select]
public List<JTask<?>> submitBlockingJob() throws Exception {
  List<Task<?>> results = null;
  JPPFConnection connection = null;
  try {
    connection = JPPFHelper.getConnection();
    // create a new job
    JPPFJob job = new JPPFJob();
    job.setName("test job");
    // add the tasks to the job
    for (int i=0; i<5; i++) job.add(new MyTask(i));
    // submit the job and get the submission id
    connection.submit(job);
    // wait until the job has completed
    results = connection.awaitResults(job.getUuid());
  } finally {
    JPPFHelper.closeConnection(connection);
}
// now return the results
return results;
}

The problem is that when I call connection.submit(job), in turn it calls the two arg submit(JPPFJob, JobStatusListener) with a null for the second argument.  This is in JPPFConnectionImpl.java.  That two arg submit always forces my job to asynchronous which triggers bad processing down the line in JPPFClient.

Code: [Select]
  @Override
  public String submit(final JPPFJob job) throws Exception
  {
    return submit(job, null);
  }

  @Override
  @SuppressWarnings("deprecation")
  public String submit(final JPPFJob job, final JobStatusListener listener) throws Exception
  {
    job.setBlocking(false);
    if (listener != null) job.getResultCollector().addJobStatusListener(listener);
    managedConnection.retrieveJppfClient().submitJob(job);
    return job.getUuid();
  }

Appreciate your time,

-Gregorio
Logged

lolo

  • Administrator
  • JPPF Council Member
  • *****
  • Posts: 2256
    • JPPF Web site
Re: 5.1.3 Unable to create a connection factory JBoss EAP 7
« Reply #8 on: March 17, 2017, 05:57:44 AM »

Hi Gregorio,

I'm not sure I understand what exactly the problem is. In particular, what do you mean by "That two arg submit always forces my job to asynchronous which triggers bad processing down the line in JPPFClient."?

Just for information, historically the resource adapter was designed this way to avoid JCA connections being held for too long by any single thread. Knowing that JPPF jobs can take from sub-millisecond time up to days or longer, we chose an asynchronous design for job submission and retrieval.

Thanks for your time,
-Laurent
Logged

Gregorio

  • JPPF Padawan
  • *
  • Posts: 9
Re: 5.1.3 Unable to create a connection factory JBoss EAP 7
« Reply #9 on: March 20, 2017, 04:45:20 PM »

Hi Laurent,

Please disregard my last post, that was an error on my part.

My current issue is that my jobs are never making it to the JPPF Server.  I see them get queued up in the JppfClient JobManager queue.  It looks like there are no working connections to the JPPF Server, since I see jobManager.workingConnections == 0. 

My jppf.properties file is getting read in properly, because jppfClient.config contains my valid configuration data, including the correct IP for driver1.jppf.server.host.  I'm running with discovery turned off.  And I can ping the JPPF Server machine from my JBoss machine.

I'm going to debug the issue a bit.  Let me know if you have any ideas.

Thanks,

-Gregorio
Logged

Gregorio

  • JPPF Padawan
  • *
  • Posts: 9
Re: 5.1.3 Unable to create a connection factory JBoss EAP 7
« Reply #10 on: March 27, 2017, 06:01:45 PM »

Hello Laurent,

I thought I'd update you on my connection problems with the JPPF Server node.  First, I was using a VM for the server node and had forgotten to open up ports on it.

Next, I was getting a serialization error out of the resource adapter when it was time to send my job to the grid node.  It couldn't find the default class to build the stream.

15:17:54,623 TRACE [org.jboss.modules] (RemoteChannelWrapper-jppf_discovery-1-2-0001) Class org.jppf.jca.serialization.JcaObjectSerializerImpl not found from Module "deployment.jppf_ra_JBoss-7.rar:main" from Service Module Loader

Perhaps this could be logged at a higher level.  Anyway, I poked around in jppf-jca.jar, looking for a serializer.  I found ObjectSerializerImp and updated jppf.properties to use it.

jppf.object.stream.builder = org.jppf.utils.ObjectSerializerImpl

Things are working now, thanks for your support.

Gregorio
Logged

Rayan987

  • Guest
Re: 5.1.3 Unable to create a connection factory JBoss EAP 7
« Reply #11 on: April 04, 2017, 02:26:58 PM »

Hello, (sorry for my inglish) thanks for the information, I hope to make it work
Logged
Pages: [1]   Go Up
 
JPPF Powered by SMF 2.0 RC5 | SMF © 2006–2011, Simple Machines LLC Get JPPF at SourceForge.net. Fast, secure and Free Open Source software downloads