Skip to content

Commit

Permalink
HSEARCH-3801 Hibernate Search blocks loading of non hibernate batch jobs
Browse files Browse the repository at this point in the history
In reference of `org.jberet.spi.JobXmlResolver` it's defined that a resolver that is not responsible should return `null` instead of throwing a runtime exception
```
    /**
     * Locates the job XML and creates a stream to the contents.
     *
     * @param jobXml      the name of the job XML with a {@code .xml} suffix
     * @param classLoader the class loader for the application
     *
     * @return a stream of the job XML or {@code null} if the job XML content was not found
     *
     * @throws java.io.IOException if an error occurs creating the stream
     */
```

Update HibernateSearchJobXmlResolver.java
  • Loading branch information
zeitiger authored and yrodiere committed Jan 14, 2020
1 parent 69dbb9a commit 467306a
Showing 1 changed file with 1 addition and 2 deletions.
Expand Up @@ -15,7 +15,6 @@
import java.util.function.Function;
import java.util.stream.Collectors;

import org.hibernate.search.exception.SearchException;
import org.hibernate.search.jsr352.massindexing.MassIndexingJob;

import org.jberet.spi.JobXmlResolver;
Expand Down Expand Up @@ -47,7 +46,7 @@ public InputStream resolveJobXml(final String jobXml, final ClassLoader classLoa
return classLoader.getResourceAsStream( path );
}
else {
throw new SearchException( "Not a Hibernate Search JSR-352 job: " + jobXml );
return null;
}
}
}

0 comments on commit 467306a

Please sign in to comment.