diff --git a/jaxws-ri/tools/wscompile/src/main/java/com/sun/tools/ws/Invoker.java b/jaxws-ri/tools/wscompile/src/main/java/com/sun/tools/ws/Invoker.java index e71059e4f..485716525 100644 --- a/jaxws-ri/tools/wscompile/src/main/java/com/sun/tools/ws/Invoker.java +++ b/jaxws-ri/tools/wscompile/src/main/java/com/sun/tools/ws/Invoker.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2021 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Distribution License v. 1.0, which is available at @@ -90,9 +90,10 @@ static int invoke(String mainClass, String[] args) throws Throwable { ClassLoader oldcc = Thread.currentThread().getContextClassLoader(); try { ClassLoader cl = Invoker.class.getClassLoader(); - if(Arrays.asList(args).contains("-Xendorsed")) - cl = createClassLoader(cl); // perform JDK6 workaround hack - else { + //XXX - kept here for the future to resurect ability to run with older apis +// if(Arrays.asList(args).contains("-Xendorsed")) +// cl = createClassLoader(cl); // perform JDK6 workaround hack +// else { int targetArgIndex = Arrays.asList(args).indexOf("-target"); Options.Target targetVersion; if (targetArgIndex != -1) { @@ -112,6 +113,11 @@ static int invoke(String mainClass, String[] args) throws Throwable { return -1; } +// } + //if loaded by bootstrap, cl can be null, let's use the loader + //we have in that case + if (cl == null) { + cl = oldcc; } //if loaded by bootstrap, cl can be null, let's use the loader //we have in that case