Error 'Parsing error. Unexpected end of data' when vFunction Agent added to Jboss or Wildfly Application Server


Overview of the Issue

This issue occurs in the following circumstances:

  1. An organization installs the VF Agent on a Java Application running on a JBoss or Wildfly Application Server
  2. The following logging is printed in the Application’s logging
Parsing error. Unexpected end of data
java.lang.Exception: Parsing error. Unexpected end of data
               at vfrtshadow.org.aspectj.weaver.loadtime.definition.LightXMLParser.getNextChar(LightXMLParser.java:405)
               at vfrtshadow.org.aspectj.weaver.loadtime.definition.LightXMLParser.skipBlanks(LightXMLParser.java:88)
               at vfrtshadow.org.aspectj.weaver.loadtime.definition.LightXMLParser.parseFromReader(LightXMLParser.java:61)
               at vfrtshadow.org.aspectj.weaver.loadtime.definition.SimpleAOPParser.parse(SimpleAOPParser.java:77)
               at vfrtshadow.org.aspectj.weaver.loadtime.definition.DocumentParser.parse(DocumentParser.java:120)
               at vfrtshadow.org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.parseDefinitions(ClassLoaderWeavingAdaptor.java:267)
               at vfrtshadow.org.aspectj.weaver.loadtime.DefaultWeavingContext.getDefinitions(DefaultWeavingContext.java:130)
               at vfrtshadow.org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.initialize(ClassLoaderWeavingAdaptor.java:169)
               at vfrtshadow.org.aspectj.weaver.loadtime.Aj$ExplicitlyInitializedClassLoaderWeavingAdaptor.initialize(Aj.java:340)
               at vfrtshadow.org.aspectj.weaver.loadtime.Aj$ExplicitlyInitializedClassLoaderWeavingAdaptor.getWeavingAdaptor(Aj.java:345)
               at vfrtshadow.org.aspectj.weaver.loadtime.Aj$WeaverContainer.getWeaver(Aj.java:319)
               at vfrtshadow.org.aspectj.weaver.loadtime.Aj.preProcess(Aj.java:113)
               at vfrtshadow.org.aspectj.weaver.loadtime.ClassPreProcessorAgentAdapter.transform(ClassPreProcessorAgentAdapter.java:51)
               at sun.instrument.TransformerManager.transform(TransformerManager.java:188)
               at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:428)
               at java.lang.ClassLoader.defineClass1(Native Method)
               at java.lang.ClassLoader.defineClass(ClassLoader.java:756)
               at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:423)
               at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:555)
               at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:339)
               at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:126)
               at org.jboss.modules.Module.loadModuleClass(Module.java:753)
               at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:247)
               at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:410)
               at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
               at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116)
               at java.lang.Class.forName0(Native Method)
               at java.lang.Class.forName(Class.java:348)
               at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:370)
               at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
               at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
               at org.jboss.marshalling.Marshalling.loadMarshallerFactory(Marshalling.java:112)
               at org.jboss.marshalling.Marshalling.getMarshallerFactory(Marshalling.java:83)
               at org.jboss.as.server.DomainServerMain.main(DomainServerMain.java:107)
               at org.jboss.modules.Module.run(Module.java:353)
               at org.jboss.modules.Module.run(Module.java:321)
               at org.jboss.modules.Main.main(Main.java:617)


Steps to Resolve the Issue

  1. SSH to the JBoss or Wildfly Application Server
  2. Remove the comment for tracking configuration in the vFunction Agent’s native configuration file
  • Find-and-replace $BASE_DIR with the path to where vFunction is installed, such as /tmp
  • Find-and-replace $INSTANCE with the name of the vFunction instance, such as “default-java”
sed -i 's~#tracking_conf~tracking_conf~g' $BASE_DIR/vfunction/etc/sysconfig/vfunction/agent/instances/$INSTANCE/native-conf.json
  1. Turn off file tracking in the vFunction Agent’s native configuration file
  • Find-and-replace $BASE_DIR with the path to where vFunction is installed, such as /tmp
  • Find-and-replace $INSTANCE with the name of the vFunction instance, such as “default-java”
sed -i 's~"files": true~"files": false~g' $BASE_DIR/vfunction/etc/sysconfig/vfunction/agent/instances/$INSTANCE/native-conf.json
  1. Restart the Jboss or Wildfly Application Server
  2. Confirm that the error no longer occurs