Details

      Description

      If I make a mistake in adding a rule to .windup.xml file and the XML handling logic throws an exception, this exception is swallowed and a meaningless NPE is shown instead.

      Steps to reproduce:

      1. unzip windup-distribution-2.5.0.CR2-offline.zip
      2. put the following into windup-distribution-2.5.0.CR2/rules/migration-core/foobar.windup.xml:
        <?xml version="1.0"?>
        <ruleset id="foobar"
            xmlns="http://windup.jboss.org/schema/jboss-ruleset"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:schemaLocation="http://windup.jboss.org/schema/jboss-ruleset http://windup.jboss.org/schema/jboss-ruleset/windup-jboss-ruleset.xsd">
        
            <rules>
                <rule id="foobar-01000">
                    <when>
                        <javaclass matchesSource="foobar"/>
                    </when>
                    <perform>
                        <hint title="foobar" effort="1" severity="mandatory">
                            <message>foobar</message>
                        </hint>
                    </perform>
                </rule>
            </rules>
        </ruleset>
        
      3. ./windup-distribution-2.5.0.CR2/bin/windup --listSourceTechnologies (this is actually representative of all other possible commands that have to load the rules, including migration itself)
      4. observe:
        Windup execution failed due to: null
        java.lang.NullPointerException
        	at org.jboss.windup.config.metadata.RuleProviderRegistryCache.getAvailableSourceTechnologies(RuleProviderRegistryCache.java:73)
        	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.jboss.forge.furnace.proxy.ClassLoaderInterceptor$1.call(ClassLoaderInterceptor.java:87)
        	at org.jboss.forge.furnace.util.ClassLoaders.executeIn(ClassLoaders.java:42)
        	at org.jboss.forge.furnace.proxy.ClassLoaderInterceptor.invoke(ClassLoaderInterceptor.java:103)
        	at org.jboss.windup.config.metadata.RuleProviderRegistryCache_$$_javassist_afb2bd3e-f8df-4aa7-8e72-3904db0eaed6.getAvailableSourceTechnologies(RuleProviderRegistryCache_$$_javassist_afb2bd3e-f8df-4aa7-8e72-3904db0eaed6.java)
        	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.jboss.forge.furnace.proxy.ClassLoaderAdapterCallback$2.call(ClassLoaderAdapterCallback.java:123)
        	at org.jboss.forge.furnace.util.ClassLoaders.executeIn(ClassLoaders.java:42)
        	at org.jboss.forge.furnace.proxy.ClassLoaderAdapterCallback.invoke(ClassLoaderAdapterCallback.java:96)
        	at org.jboss.windup.config.metadata.RuleProviderRegistryCache_$$_javassist_594e8534-0e32-46c7-a77b-07073146acaf.getAvailableSourceTechnologies(RuleProviderRegistryCache_$$_javassist_594e8534-0e32-46c7-a77b-07073146acaf.java)
        	at org.jboss.windup.bootstrap.commands.windup.ListSourceTechnologiesCommand.execute(ListSourceTechnologiesCommand.java:19)
        	at org.jboss.windup.bootstrap.Bootstrap.executePhase(Bootstrap.java:305)
        	at org.jboss.windup.bootstrap.Bootstrap.run(Bootstrap.java:166)
        	at org.jboss.windup.bootstrap.Bootstrap.main(Bootstrap.java:97)
        

      This is an internal implementation issue. What I'd like to be shown is the exception thrown from https://github.com/windup/windup/blob/94afabe5ee/rules-java/api/src/main/java/org/jboss/windup/rules/apps/java/xml/JavaClassHandler.java#L53 – that points me to the mistake I made.

      And actually, I made this exact mistake when trying to create some rules. The steps above just form a minimal reproducer.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                jsightler Jess Sightler
                Reporter:
                lthon Ladislav Thon
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: