Jenkins JUnit returns null - junit

In my scripted pipeline, I'm calling junit as follows
junit "${log_dir}/${os_version}/*.xml"
However, it's giving result as follows
Recording test results
null
Then a bunch of null exceptions.
at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1788)
at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:356)
at hudson.remoting.Channel.call(Channel.java:998)
at hudson.FilePath.act(FilePath.java:1069)
at hudson.FilePath.act(FilePath.java:1058)
at hudson.tasks.junit.JUnitParser.parseResult(JUnitParser.java:107)
at hudson.tasks.junit.JUnitResultArchiver.parse(JUnitResultArchiver.java:149)
at hudson.tasks.junit.JUnitResultArchiver.parseAndSummarize(JUnitResultArchiver.java:243)
at hudson.tasks.junit.pipeline.JUnitResultsStepExecution.run(JUnitResultsStepExecution.java:63)
at hudson.tasks.junit.pipeline.JUnitResultsStepExecution.run(JUnitResultsStepExecution.java:29)
at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
java.lang.NullPointerException
at hudson.tasks.junit.CaseResult.getPackageName(CaseResult.java:399)
at hudson.tasks.junit.TestResult.tally(TestResult.java:795)
at hudson.tasks.junit.JUnitParser$ParseResultCallable.invoke(JUnitParser.java:145)
at hudson.FilePath$FileCallableWrapper.call(FilePath.java:3073)
at hudson.remoting.UserRequest.perform(UserRequest.java:211)
at hudson.remoting.UserRequest.perform(UserRequest.java:54)
at hudson.remoting.Request$2.run(Request.java:369)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
My xml file looks as follows
<testsuites>
<testsuite errors="1" failures="0" tests="1" time="0">
<testcase name="workspace/inventory/group1">
<failure file="workspace/inventory/group1" line="94" message="[E201] Trailing whitespace" type="Ansible Lint">[E201] Trailing whitespace</failure>
</testcase>
</testsuite>
</testsuites>`

Fixed by adding .yml extension to filename which is being linted. So now the <failure> and <testcase> tag lines looks as follows
<testcase name="workspace/inventory/group1.yml">
<failure file="workspace/inventory/group1.yml" line="94" message="[E201] Trailing whitespace" type="Ansible Lint">[E201] Trailing whitespace</failure>
Now junit is able to parse properly.
PS: Earlier the above entry was as follows
<testcase name="workspace/inventory/group1">
<failure file="workspace/inventory/group1" line="94" message="[E201] Trailing whitespace" type="Ansible Lint">[E201] Trailing whitespace</failure>

Related

"java.lang.IllegalStateException: TableMetadataFactory cannot be used before it is started" running Gunit tests

When running Gunit tests for ClaimCenter using the following command and tomcat running we get an error related to the TableMetaDataFactory.
call ant -f Gunittestingtasks.xml rungunitReport -Dgunit.test.packages=com.lmig.pm.cl.cc.plugins >> d:\tmp\gunit.txt
Below is the full stack trace of a single error out of the Gunit test report XML file.
<testcase classname="com.lmig.claims.assignment.AssignmentFactoryTest" gosu="true" name="testAssignmentRepoInstantiation" time="0.013">
<error message="java.lang.IllegalStateException: TableMetadataFactory Caused by: java.lang.LinkageError type="java.lang.RuntimeException">java.lang.RuntimeException: java.lang.IllegalStateException: TableMetadataFactory cannot be used before it is started
at gw.testharness.v3.PLServerTestEnvironment.beforeTestSuite(PLServerTestEnvironment.java:50)
at com.guidewire.api.test.TestExecutionManager.maybeCallBeforeTestSuite(TestExecutionManager.java:206)
at com.guidewire.api.test.TestExecutionManager.runTestClass(TestExecutionManager.java:115)
at gw.api.test.TestClass.run(TestClass.java:318)
at com.guidewire.api.test.TestClassWrapper.runTest(TestClassWrapper.java:48)
at gw.test.Suite.run(Suite.java:385)
Caused by: java.lang.IllegalStateException: TableMetadataFactory cannot be used before it is started
at com.guidewire.pl.system.database.metadata.TableMetadataFactoryImpl.getTableMetadata(TableMetadataFactoryImpl.java:78)
at com.guidewire.pl.system.database.metadata.TableMetadataFactoryImpl.getColumn(TableMetadataFactoryImpl.java:102)
at com.guidewire.pl.system.database.impl.ForwardJoinCondition.<init>(ForwardJoinCondition.java:40)
at com.guidewire.pl.system.database.impl.TableObjectImpl.join(TableObjectImpl.java:225)
at com.guidewire.pl.domain.community.impl.AbstractUserFinder.getCredentialQuery(AbstractUserFinder.java:193)
at com.guidewire.pl.domain.community.impl.AbstractUserFinder.findByCredentialName(AbstractUserFinder.java:82)
at com.guidewire.pl.domain.community.impl.AbstractUserFinder.findSystemUser(AbstractUserFinder.java:53)
at com.guidewire.pl.system.security.impl.SuperUserIdentifierImpl.initIfNecessary(SuperUserIdentifierImpl.java:61)
at com.guidewire.pl.system.security.impl.SuperUserIdentifierImpl.getSystemServicesUserId(SuperUserIdentifierImpl.java:54)
at gw.testharness.v3.PLServerTestEnvironment.executeBeforeBackUpDatabase(PLServerTestEnvironment.java:73)
at gw.testharness.v3.PLServerTestEnvironment.afterServerStarted(PLServerTestEnvironment.java:55)
at gw.testharness.v3.PLServerTestEnvironment.beforeTestSuite(PLServerTestEnvironment.java:48)
</error>
<error message="java.lang.IllegalStateException: TableMetadataFactory cannot be used before it is started" type="java.lang.RuntimeException">java.lang.RuntimeException: java.lang.IllegalStateException: TableMetadataFactory cannot be used before it is started
at gw.testharness.v3.PLServerTestEnvironment.beforeTestSuite(PLServerTestEnvironment.java:50)
at com.guidewire.api.test.TestExecutionManager.maybeCallBeforeTestSuite(TestExecutionManager.java:206)
at com.guidewire.api.test.TestExecutionManager.runTestClass(TestExecutionManager.java:115)
at gw.api.test.TestClass.run(TestClass.java:318)
at com.guidewire.api.test.TestClassWrapper.runTest(TestClassWrapper.java:48)
at gw.test.Suite.run(Suite.java:385)
Caused by: java.lang.IllegalStateException: TableMetadataFactory cannot be used before it is started
at com.guidewire.pl.system.database.metadata.TableMetadataFactoryImpl.getTableMetadata(TableMetadataFactoryImpl.java:78)
at com.guidewire.pl.system.database.metadata.TableMetadataFactoryImpl.getColumn(TableMetadataFactoryImpl.java:102)
at com.guidewire.pl.system.database.impl.ForwardJoinCondition.<init>(ForwardJoinCondition.java:40)
at com.guidewire.pl.system.database.impl.TableObjectImpl.join(TableObjectImpl.java:225)
at com.guidewire.pl.domain.community.impl.AbstractUserFinder.getCredentialQuery(AbstractUserFinder.java:193)
at com.guidewire.pl.domain.community.impl.AbstractUserFinder.findByCredentialName(AbstractUserFinder.java:82)
at com.guidewire.pl.domain.community.impl.AbstractUserFinder.findSystemUser(AbstractUserFinder.java:53)
at com.guidewire.pl.system.security.impl.SuperUserIdentifierImpl.initIfNecessary(SuperUserIdentifierImpl.java:61)
at com.guidewire.pl.system.security.impl.SuperUserIdentifierImpl.getSystemServicesUserId(SuperUserIdentifierImpl.java:54)
at gw.testharness.v3.PLServerTestEnvironment.executeBeforeBackUpDatabase(PLServerTestEnvironment.java:73)
at gw.testharness.v3.PLServerTestEnvironment.afterServerStarted(PLServerTestEnvironment.java:55)
at gw.testharness.v3.PLServerTestEnvironment.beforeTestSuite(PLServerTestEnvironment.java:48)
</error>
</testcase>
All of the errors are coming from that issue for all of the GUnit tests
Not sure if it's a context.xml issue with configuration or something else at this point.

Closing single quote missing while comparing strings in XML for Logback with Janino

Using Logback's conditional processing to compare two Strings in a Logback XML configuration file as follows ...
<if condition="'test'.equals('test')">
<then>
<include resource="logback.local.xml"/>
</then>
</if>
... results in the following exception.
14:22:08,315 |-ERROR in ch.qos.logback.core.joran.conditional.IfAction - Failed to parse condition ['test'.equals('test')] org.codehaus.commons.compiler.CompileException: Line 1, Column 38: Closing single quote missing
at org.codehaus.commons.compiler.CompileException: Line 1, Column 38: Closing single quote missing
at at org.codehaus.janino.Scanner.scan(Scanner.java:359)
at at org.codehaus.janino.Scanner.produce(Scanner.java:267)
at at org.codehaus.janino.TokenStreamImpl.produceToken(TokenStreamImpl.java:62)
at at org.codehaus.janino.TokenStreamImpl.peek(TokenStreamImpl.java:104)
at at org.codehaus.janino.TokenStreamImpl.peek(TokenStreamImpl.java:134)
at at org.codehaus.janino.Parser.peek(Parser.java:3145)
at at org.codehaus.janino.Parser.parseReturnStatement(Parser.java:2048)
at at org.codehaus.janino.Parser.parseStatement(Parser.java:1659)
at at org.codehaus.janino.Parser.parseBlockStatement(Parser.java:1512)
at at org.codehaus.janino.Parser.parseBlockStatements(Parser.java:1474)
at at org.codehaus.janino.Parser.parseMethodDeclarationRest(Parser.java:1313)
at at org.codehaus.janino.Parser.parseClassBodyDeclaration(Parser.java:894)
at at org.codehaus.janino.ClassBodyEvaluator.cook(ClassBodyEvaluator.java:231)
at at org.codehaus.janino.SimpleCompiler.cook(SimpleCompiler.java:200)
at at org.codehaus.commons.compiler.Cookable.cook(Cookable.java:76)
at at org.codehaus.commons.compiler.Cookable.cook(Cookable.java:71)
at at ch.qos.logback.core.joran.conditional.PropertyEvalScriptBuilder.build(PropertyEvalScriptBuilder.java:47)
at at ch.qos.logback.core.joran.conditional.IfAction.begin(IfAction.java:65)
at at ch.qos.logback.core.joran.spi.Interpreter.callBeginAction(Interpreter.java:269)
at at ch.qos.logback.core.joran.spi.Interpreter.startElement(Interpreter.java:145)
at at ch.qos.logback.core.joran.spi.Interpreter.startElement(Interpreter.java:128)
at at ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:50)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:155)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:142)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:103)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:53)
at at ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:75)
at at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:150)
at at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:84)
at at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:55)
at at org.slf4j.LoggerFactory.bind(LoggerFactory.java:150)
at at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:124)
at at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:412)
at at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:357)
at at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:383)
at at com.labcorp.ncp.provider.abn.service.impl.AbnServiceImpl.<clinit>(AbnServiceImpl.java:34)
at at sun.reflect.GeneratedSerializationConstructorAccessor5.newInstance(Unknown Source)
at at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at at org.objenesis.instantiator.sun.SunReflectionFactoryInstantiator.newInstance(SunReflectionFactoryInstantiator.java:40)
at at org.objenesis.ObjenesisBase.newInstance(ObjenesisBase.java:59)
at at org.mockito.internal.creation.jmock.ClassImposterizer.createProxy(ClassImposterizer.java:128)
at at org.mockito.internal.creation.jmock.ClassImposterizer.imposterise(ClassImposterizer.java:63)
at at org.mockito.internal.creation.jmock.ClassImposterizer.imposterise(ClassImposterizer.java:56)
at at org.mockito.internal.creation.CglibMockMaker.createMock(CglibMockMaker.java:23)
at at org.mockito.internal.util.MockUtil.createMock(MockUtil.java:26)
at at org.mockito.internal.MockitoCore.mock(MockitoCore.java:51)
at at org.mockito.Mockito.mock(Mockito.java:1243)
at at org.mockito.Mockito.mock(Mockito.java:1120)
at at com.labcorp.ncp.provider.abn.service.AbnServiceTest.invalidDxCode(AbnServiceTest.java:61)
at at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at at java.lang.reflect.Method.invoke(Method.java:606)
at at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:367)
at at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:274)
at at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:238)
at at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:161)
at at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:290)
at at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242)
at at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:121)
14:22:08,316 |-ERROR in ch.qos.logback.core.joran.conditional.IfAction - Failed to determine "if then else" result
14:22:08,316 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
14:22:08,318 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT]
14:22:08,324 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
14:22:08,365 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.rolling.RollingFileAppender]
Utlimately the condition you define is executed as a Groovy script by Janino. Something like this:
String script = "public boolean evaluate() { return \"test\".equals(\"test\"); }";
ClassBodyEvaluator classBodyEvaluator = new ClassBodyEvaluator();
classBodyEvaluator.setImplementedInterfaces(new Class[] { Condition.class });
classBodyEvaluator.setExtendedClass(PropertyWrapperForScripts.class);
classBodyEvaluator.setParentClassLoader(ClassBodyEvaluator.class.getClassLoader());
StringReader sr = new StringReader(script);
classBodyEvaluator.cook(null, sr);
Class clazz = classBodyEvaluator.getClazz();
Condition instance = (Condition) clazz.newInstance();
So, you just need to ensure that the value of the condition (which is substituted into the script) has quoted strings i.e. "...". But since you are defining the condition in XML you must escape the quotes, like so:
<if condition=""test".equals("test")">
This will produce a script:
public boolean evaluate() { return "test".equals("test"); }
... for execution by ch.qos.logback.core.joran.conditional.PropertyEvalScriptBuilder.
I have verified this as follows ...
<if condition=""test".equals("test")">
<then>
<property name="conditionalValue" value="Conditional value is true"/>
</then>
<else>
<property name="conditionalValue" value="Conditional value is false"/>
</else>
</if>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>
%d|%-5p|%t|${conditionalValue}%n
</pattern>
</encoder>
</appender>
... and a log event written by this appender looks like:
2017-08-09 09:07:02,699|INFO |main|Conditional value is true

Object org.mule.transport.sftp.SftpInputStream not of correct type error

I have setup a sftp endpoint in a Mule batch flow to pull a test.csv file from CrushFTP server I have setup locally on my laptop.
When I deploy the Mule project it deploys successfully but then I see this error message as it repeatedly attempts to pull the csv file:
*******************************************************************************************************
* - - + APPLICATION + - - * - - + DOMAIN + - - * - - + STATUS + - - *
*******************************************************************************************************
* sftpproj * default * DEPLOYED *
*******************************************************************************************************
INFO 2016-09-29 10:43:34,241 [[sftpproj].SFTP.receiver.01] com.mulesoft.module.batch.engine.DefaultBatchEngine: Created instance 30388390-8629-11e6-a2c5-1e6f20524153 for batch job sftpprojBatch
INFO 2016-09-29 10:43:34,243 [[sftpproj].SFTP.receiver.01] com.mulesoft.module.batch.engine.DefaultBatchEngine: Starting input phase
INFO 2016-09-29 10:43:34,245 [[sftpproj].SFTP.receiver.01] com.mulesoft.module.batch.engine.DefaultBatchEngine: Input phase completed
ERROR 2016-09-29 10:43:34,281 [[sftpproj].SFTP.receiver.01] org.mule.exception.DefaultMessagingExceptionStrategy:
********************************************************************************
Message : Object "org.mule.transport.sftp.SftpInputStream" not of correct type. It must be of type "{interface java.lang.Iterable,interface java.util.Iterator,interface org.mule.routing.MessageSequence,interface java.util.Collection}" (java.lang.IllegalArgumentException)
Type : com.mulesoft.module.batch.exception.BatchException
Code : MULE_ERROR--2
********************************************************************************
Exception stack is:
1. Object "org.mule.transport.sftp.SftpInputStream" not of correct type. It must be of type "{interface java.lang.Iterable,interface java.util.Iterator,interface org.mule.routing.MessageSequence,interface java.util.Collection}" (java.lang.IllegalArgumentException)
org.mule.util.collection.EventToMessageSequenceSplittingStrategy:64 (null)
2. Object "org.mule.transport.sftp.SftpInputStream" not of correct type. It must be of type "{interface java.lang.Iterable,interface java.util.Iterator,interface org.mule.routing.MessageSequence,interface java.util.Collection}" (java.lang.IllegalArgumentException) (com.mulesoft.module.batch.exception.BatchException)
com.mulesoft.module.batch.engine.DefaultBatchEngine:378 (null)
********************************************************************************
Root Exception stack trace:
java.lang.IllegalArgumentException: Object "org.mule.transport.sftp.SftpInputStream" not of correct type. It must be of type "{interface java.lang.Iterable,interface java.util.Iterator,interface org.mule.routing.MessageSequence,interface java.util.Collection}"
at org.mule.util.collection.EventToMessageSequenceSplittingStrategy.split(EventToMessageSequenceSplittingStrategy.java:64)
at org.mule.util.collection.EventToMessageSequenceSplittingStrategy.split(EventToMessageSequenceSplittingStrategy.java:25)
at com.mulesoft.module.batch.engine.queue.BatchQueueLoader.splitAndLoad(BatchQueueLoader.java:63)
at com.mulesoft.module.batch.engine.DefaultBatchEngine.load(DefaultBatchEngine.java:361)
at com.mulesoft.module.batch.DefaultBatchJob.execute(DefaultBatchJob.java:305)
at com.mulesoft.module.batch.DefaultBatchJob$1.process(DefaultBatchJob.java:229)
at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:107)
at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)
at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:107)
at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)
at org.mule.transport.AbstractMessageReceiver.routeEvent(AbstractMessageReceiver.java:511)
at org.mule.transport.AbstractMessageReceiver.routeMessage(AbstractMessageReceiver.java:226)
at org.mule.transport.AbstractMessageReceiver.routeMessage(AbstractMessageReceiver.java:208)
at org.mule.transport.AbstractMessageReceiver.routeMessage(AbstractMessageReceiver.java:200)
at org.mule.transport.AbstractMessageReceiver.routeMessage(AbstractMessageReceiver.java:187)
at org.mule.transport.sftp.SftpMessageReceiver$1.process(SftpMessageReceiver.java:203)
at org.mule.transport.sftp.SftpMessageReceiver$1.process(SftpMessageReceiver.java:179)
at org.mule.execution.ExecuteCallbackInterceptor.execute(ExecuteCallbackInterceptor.java:16)
at org.mule.execution.CommitTransactionInterceptor.execute(CommitTransactionInterceptor.java:35)
at org.mule.execution.CommitTransactionInterceptor.execute(CommitTransactionInterceptor.java:22)
at org.mule.execution.HandleExceptionInterceptor.execute(HandleExceptionInterceptor.java:30)
at org.mule.execution.HandleExceptionInterceptor.execute(HandleExceptionInterceptor.java:14)
at org.mule.execution.BeginAndResolveTransactionInterceptor.execute(BeginAndResolveTransactionInterceptor.java:67)
at org.mule.execution.ResolvePreviousTransactionInterceptor.execute(ResolvePreviousTransactionInterceptor.java:44)
at org.mule.execution.SuspendXaTransactionInterceptor.execute(SuspendXaTransactionInterceptor.java:50)
at org.mule.execution.ValidateTransactionalStateInterceptor.execute(ValidateTransactionalStateInterceptor.java:40)
at org.mule.execution.IsolateCurrentTransactionInterceptor.execute(IsolateCurrentTransactionInterceptor.java:41)
at org.mule.execution.ExternalTransactionInterceptor.execute(ExternalTransactionInterceptor.java:48)
at org.mule.execution.RethrowExceptionInterceptor.execute(RethrowExceptionInterceptor.java:28)
at org.mule.execution.RethrowExceptionInterceptor.execute(RethrowExceptionInterceptor.java:13)
at org.mule.execution.TransactionalErrorHandlingExecutionTemplate.execute(TransactionalErrorHandlingExecutionTemplate.java:110)
at org.mule.execution.TransactionalErrorHandlingExecutionTemplate.execute(TransactionalErrorHandlingExecutionTemplate.java:30)
at org.mule.transport.sftp.SftpMessageReceiver.routeFile(SftpMessageReceiver.java:178)
at org.mule.transport.sftp.SftpMessageReceiver.poll(SftpMessageReceiver.java:121)
at org.mule.transport.AbstractPollingMessageReceiver.performPoll(AbstractPollingMessageReceiver.java:216)
at org.mule.transport.PollingReceiverWorker.poll(PollingReceiverWorker.java:80)
at org.mule.transport.PollingReceiverWorker.run(PollingReceiverWorker.java:49)
at org.mule.transport.TrackingWorkManager$TrackeableWork.run(TrackingWorkManager.java:267)
at org.mule.work.WorkerContext.run(WorkerContext.java:286)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
********************************************************************************
It looks as though the datatype is incorrect but not sure how I can change this as I cannot put a transform connector between the sftp endpoint and the sftp server. I have set the MIME type to application/csv in the Advanced tab of the sftp endpoint but the error message still persists.
Does anyone know how I can resolve this problem?
XML code:
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:ftp="http://www.mulesoft.org/schema/mule/ee/ftp" xmlns:sftp="http://www.mulesoft.org/schema/mule/sftp" xmlns:batch="http://www.mulesoft.org/schema/mule/batch" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/sftp http://www.mulesoft.org/schema/mule/sftp/current/mule-sftp.xsd
http://www.mulesoft.org/schema/mule/batch http://www.mulesoft.org/schema/mule/batch/current/mule-batch.xsd
http://www.mulesoft.org/schema/mule/ee/ftp http://www.mulesoft.org/schema/mule/ee/ftp/current/mule-ftp-ee.xsd">
<sftp:connector name="SFTP" validateConnections="true" doc:name="SFTP"/>
<batch:job name="orderexperienceBatch">
<batch:input>
<sftp:inbound-endpoint connector-ref="SFTP" host="localhost" port="2222" path="//" user="${ftp.user}" password="${ftp.password}" responseTimeout="10000" mimeType="application/csv" doc:name="SFTP"/>
</batch:input>
<batch:process-records>
<batch:step name="Batch_Step">
<logger level="INFO" doc:name="Logger"/>
</batch:step>
</batch:process-records>
<batch:on-complete>
<logger level="INFO" doc:name="Logger"/>
</batch:on-complete>
</batch:job>
</mule>
CSV file:
1,test
This not the issue with your CSV or Configuration. Actually batch:input should generate iterable data. Put following DWL and it will work fine.
%dw 1.0
%output application/java
---
payload
Hope this helps

javax.persistence.PersistenceException: Unable to build entity manager factory

When I'm trying to create a new EntityManager to persist my data, i get the following Error:
javax.persistence.PersistenceException: Unable to build entity manager factory
I using the JPA-Persistence Provider of Hibernate...
unluckily I couldn't find any helpful post in stackoverflow / with googling...
Does anybody have an idea where the cause of the error could lie?
Thank you for your help!
code-snippets:
creation of entitymanager
EntityManager em;
EntityManagerFactory fact = Persistence.createEntityManagerFactory("bachelordebug"); // Here it crashes
em = fact.createEntityManager();
stacktrace
javax.persistence.PersistenceException: Unable to build entity manager factory
at org.hibernate.jpa.HibernatePersistenceProvider.createEntityManagerFactory(HibernatePersistenceProvider.java:81)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:54)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:55)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:39)
at com.uzh.platform.api.util.AssignmentUtil.findAll(AssignmentUtil.java:20)
at com.uzh.platform.api.services.GetAssignments.getAssignments(GetAssignments.java:22)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:151)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:171)
at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:152)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:104)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:402)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:349)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:106)
at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:259)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:318)
at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:236)
at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1010)
at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:373)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:382)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:345)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:220)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1221)
at com.thetransactioncompany.cors.CORSFilter.doFilter(CORSFilter.java:156)
at com.thetransactioncompany.cors.CORSFilter.doFilter(CORSFilter.java:233)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1212)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:399)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:450)
at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:928)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
persistence.xml
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0"
xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
<persistence-unit name="bachelordebug" transaction-type="RESOURCE_LOCAL">
<!-- <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider> -->
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
<class>com.uzh.platform.data.dao.Assignment</class>
<properties>
<property name="javax.persistence.jdbc.driver" value="org.postgresql.Driver"/>
<property name="javax.persistence.jdbc.url" value="jdbc:postgresql://127.0.0.1:5432/bachelor"/>
<property name="javax.persistence.jdbc.user" value="bachelor"/>
<property name="javax.persistence.jdbc.password" value="bachelor14"/>
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/>
<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="hibernate.connection.release_mode" value="after_statement"/>
<property name="connection.pool_size" value="1"/>
<property name="dialect" value="org.postgresql.Driver"/>
<property name="current_session_context_class" value="thread"/>
<property name="cache.provider_class" value="org.hibernate.cache.NoCacheProvider"/>
<property name="show_sql" value="true"/>
</properties>
</persistence-unit>
(Question answered in comments and edits. See Question with no answers, but issue solved in the comments (or extended in chat) )
The OP wrote:
SOLVED
I finally found my error!
In my JPA-Entity class, I misspelled my Named-Query Annotation (even though I don't use it)
#NamedQuery(name="Assignment.findAll", query ="SELECT * FROM assignment")
of course one has to write that in capital Letters, i.e. "Assignment" (i.e. all terms like they appear in the service-class!)
3 days wasted with this stupid error - but now I learned how to do it! :-)
Thanks anyway for your help!
Since the error can indicate a lot of different causes it seems best to get to the cause examining the Hibernate DEBUG log statements (we use logback, but it should work in any other logging framework similarly):
With this you get a lot of output, but can determine the actually interesting classes (it is very likely you will spot the cause here already):
// (logback.groovy)
logger( "org.hibernate", DEBUG )
Which for us showed something like the following (where Mapping collection: foo.Bar.field -> some_tab_x was the info we needed to spot the faulty mapping):
07:32:43.720 D~ [main ~ main] [ : ] CollectionSecondPass:SecondPass: 67|
Second pass for collection: foo.Bar.field
07:32:43.720 D~ [main ~ main] [ : ] c.a.CollectionBinder:SecondPass: 823|
Binding a OneToMany: foo.Bar.field through a foreign key
07:32:43.720 D~ [main ~ main] [ : ] c.a.CollectionBinder:SecondPass: 861|
Mapping collection: foo.Bar.field -> some_tab_x
07:32:43.727 D~ [main ~ main] [ : ] ePersistenceProvider:gerFactory: 82|
Unable to build entity manager factory
07:32:43.743 E~ [main ~ main] [ : ] .l.f.m.m.MgFooTstJu:AndRethrow: 74|
MyException: unit test error loading Foo with id: 4342153208-2:
<java.lang.NullPointerException> =>
<javax.persistence.PersistenceException: Unable to build entity manager factory>
To restrict the logging again (if there are multiple places to fix your JPA mapping), we then used something like the following:
// (logback.groovy)
//logger( "org.hibernate", DEBUG ) // log everything
// infos on annotation mappping, e.g. getting NullPointerExceptions with
// javax.persistence.PersistenceException: Unable to build entity manager factory
logger( "org.hibernate.cfg.annotations.CollectionBinder", DEBUG )
(E.g. in Eclipse just use CTRL+SHIFT+T to search for the type you like to debug, if the log output does not show the complete classname)
I encountered the same error, and unfortunately the above answer didn't help me a lot. So I looked to other errors reported in my case where I found this error:
com.mysql.cj.core.exceptions.InvalidConnectionAttributeException: The server time zone value 'EEST' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.
I solved it as specified the this answer and it's comments, by replacing my connection url with : "jdbc:mysql://localhost:3306/db?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC"
That solved all errors including the one noted in this question:
javax.persistence.PersistenceException: Unable to build entity manager factory
I hope this helps others coming across the same issue I faced.
add the id annotation in your entity class
#Entity
public class yourClass{
#Id
private Long id;
...
}

Implementing XSLT within ServiceMix

I'm trying to write a xslt that takes a html page and transforms it so that it contains only the contents of a div tag with id "content". I'm using Apache ServiceMix to develop a service unit that performs this action but am completely lost!
So far I have created a unit that (well at least I think it does this) takes a file, applies the transformation and saves it to an output folder:
<?xml version="1.0" encoding="UTF-8"?>
<blueprint
xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.osgi.org/xmlns/blueprint/v1.0.0
http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
<camelContext xmlns="http://camel.apache.org/schema/blueprint">
<route>
<from uri="file:camel/input"/>
<log message="Moving ${file:name} to the output directory"/>
<to uri="xslt:file:///transform.xsl"/>
<to uri="file:camel/output"/>
</route>
</camelContext>
</blueprint>
and a transformation .xsl file:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns="http://www.w3.org/1999/xhtml"
exclude-result-prefixes="xhtml">
<xsl:template match="/">
<html>
<head><title>HTML Transformation</title></head>
<body>
<xsl:copy-of select="//xhtml:DIV[#id='content']"/>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
but it keeps throwing this error:
21:23:50,395 | INFO | le://camel/input | route3 | 91 - org.apache.camel.camel-core - 2.8.5 | Moving INPUTFILE.html to the output directory
21:23:50,850 | ERROR | le://camel/input | DefaultErrorHandler | 91 - org.apache.camel.camel-core - 2.8.5 | Failed delivery for exchangeId: ID-servicemix-48257-1358413760241-2-2137. Exhausted after delivery attempt: 1 caught: javax.xml.transform.TransformerException: java.io.IOException: Server returned HTTP response code: 403 for URL: http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd
javax.xml.transform.TransformerException: java.io.IOException: Server returned HTTP response code: 403 for URL: http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd
at org.apache.xalan.transformer.TransformerImpl.fatalError(TransformerImpl.java:782)[:]
at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:756)[:]
at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1273)[:]
at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1251)[:]
at org.apache.camel.builder.xml.XsltBuilder.process(XsltBuilder.java:123)[91:org.apache.camel.camel-core:2.8.5]
at org.apache.camel.impl.ProcessorEndpoint.onExchange(ProcessorEndpoint.java:102)[91:org.apache.camel.camel-core:2.8.5]
at org.apache.camel.impl.ProcessorEndpoint$1.process(ProcessorEndpoint.java:72)[91:org.apache.camel.camel-core:2.8.5]
at org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:48)[91:org.apache.camel.camel-core:2.8.5]
at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)[91:org.apache.camel.camel-core:2.8.5]
at org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:114)[91:org.apache.camel.camel-core:2.8.5]
at org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:284)[91:org.apache.camel.camel-core:2.8.5]
at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:109)[91:org.apache.camel.camel-core:2.8.5]
at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)[91:org.apache.camel.camel-core:2.8.5]
at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)[91:org.apache.camel.camel-core:2.8.5]
at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)[91:org.apache.camel.camel-core:2.8.5]
at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:69)[91:org.apache.camel.camel-core:2.8.5]
at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)[91:org.apache.camel.camel-core:2.8.5]
at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)[91:org.apache.camel.camel-core:2.8.5]
at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)[91:org.apache.camel.camel-core:2.8.5]
at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:90)[91:org.apache.camel.camel-core:2.8.5]
at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)[91:org.apache.camel.camel-core:2.8.5]
at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:318)[91:org.apache.camel.camel-core:2.8.5]
at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:209)[91:org.apache.camel.camel-core:2.8.5]
at org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:306)[91:org.apache.camel.camel-core:2.8.5]
at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)[91:org.apache.camel.camel-core:2.8.5]
at org.apache.camel.processor.Pipeline.process(Pipeline.java:116)[91:org.apache.camel.camel-core:2.8.5]
at org.apache.camel.processor.Pipeline.process(Pipeline.java:79)[91:org.apache.camel.camel-core:2.8.5]
at org.apache.camel.processor.UnitOfWorkProcessor.processAsync(UnitOfWorkProcessor.java:139)[91:org.apache.camel.camel-core:2.8.5]
at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:106)[91:org.apache.camel.camel-core:2.8.5]
at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:78)[91:org.apache.camel.camel-core:2.8.5]
at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)[91:org.apache.camel.camel-core:2.8.5]
at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)[91:org.apache.camel.camel-core:2.8.5]
at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:69)[91:org.apache.camel.camel-core:2.8.5]
at org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:353)[91:org.apache.camel.camel-core:2.8.5]
at org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:176)[91:org.apache.camel.camel-core:2.8.5]
at org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:137)[91:org.apache.camel.camel-core:2.8.5]
at org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:139)[91:org.apache.camel.camel-core:2.8.5]
at org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:91)[91:org.apache.camel.camel-core:2.8.5]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)[:1.6.0_38]
at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)[:1.6.0_38]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)[:1.6.0_38]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)[:1.6.0_38]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:180)[:1.6.0_38]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:204)[:1.6.0_38]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)[:1.6.0_38]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)[:1.6.0_38]
at java.lang.Thread.run(Thread.java:662)[:1.6.0_38]
Caused by: java.io.IOException: Server returned HTTP response code: 403 for URL: http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1459)[:1.6.0_38]
at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)[:]
at org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown Source)[:]
at org.apache.xerces.impl.XMLEntityManager.startDTDEntity(Unknown Source)[:]
at org.apache.xerces.impl.XMLDTDScannerImpl.setInputSource(Unknown Source)[:]
at org.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(Unknown Source)[:]
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)[:]
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)[:]
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)[:]
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)[:]
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)[:]
at org.apache.xml.dtm.ref.DTMManagerDefault.getDTM(DTMManagerDefault.java:439)[:]
at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:699)[:]
... 45 more
and I have no idea what it means :(
Can anyone help?
Thanks heaps
As discussed in the comments, the issue here is that the DTD in the HTML page you are accessing is referencing an inaccessible file and this is causing the parser to fail while trying to access the file.
If the HTML is something you can modify, a possible solution would be to modify the DTD (it looks like the HTML4 loose DTD is accessible at this URL: http://www.w3.org/TR/html4/loose.dtd). The parser you're using may have an option to ignore the DTD, though that may not be the best option because the documents could be using HTML-only entities like .