JDK-6348193 : AS8.1 UR2 BAT test failure with "javac"
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 6
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: generic,solaris_9,solaris_10
  • CPU: generic,x86,sparc
  • Submitted: 2005-11-09
  • Updated: 2015-12-04
  • Resolved: 2006-03-23
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6
6 b78Fixed
Related Reports
Duplicate :  
Relates :  
Description
JDK          :   build 1.6.0 beta b59 (also fail in b57 and b58) 
switch/Mode  :   default
Platform[s]  :   All platforms (e.g. Solaris, window, linux)
Failing Test :   BAT test for Appserver 8.1 UR2 PE/EE

A DESCRIPTION OF THE PROBLEM:
The BAT test failed at the jsr109-test suites on JDK6.0 b57 and later builds.  The test fails consistently on Solaris, Windows, and Linux. From the test log, we suspected new javac features which were putback in b57 break the internal function of Appserver 8.1. It has the exception in javac compiler as follow: 

[#|2005-10-27T16:07:19.327-0700|WARNING|sun-appserver-ee8.1_01|javax.enterprise.system.tools.deployment|_ThreadID=10;|Compilation failed: Native compiler returned an error: 4
Error messages are: An exception has occurred in the compiler (1.6.0-ea). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport)  after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report.  Thank you.
java.security.AccessControlException: access denied (java.lang.RuntimePermission createClassLoader

java.security.AccessControlException: access denied (java.lang.RuntimePermission createClassLoader)
	at java.security.AccessControlContext.checkPermission(AccessControlContext.java:321)
	at java.security.AccessController.checkPermission(AccessController.java:546)
	at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
	at java.lang.SecurityManager.checkCreateClassLoader(SecurityManager.java:594)
	at java.lang.ClassLoader.<init>(ClassLoader.java:225)
	at java.security.SecureClassLoader.<init>(SecureClassLoader.java:76)
	at java.net.URLClassLoader.<init>(URLClassLoader.java:113)
	at com.sun.tools.javac.processing.JavacProcessingEnvironment.initProcessorIterator(JavacProcessingEnvironment.java:179)
	at com.sun.tools.javac.processing.JavacProcessingEnvironment.<init>(JavacProcessingEnvironment.java:108)
	at com.sun.tools.javac.main.JavaCompiler.initProcessAnnotations(JavaCompiler.java:770)
	at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:625)
	at com.sun.tools.javac.main.Main.compile(Main.java:756)
	at com.sun.tools.javac.main.Main.compile(Main.java:681)
	at com.sun.tools.javac.main.Main.compile(Main.java:670)
	at com.sun.tools.javac.Main.compile(Main.java:88)
	at com.sun.ejb.codegen.JavaCompiler.javacCompile(JavaCompiler.java:135)
	at com.sun.ejb.codegen.JavaCompiler.internal_compile(JavaCompiler.java:60)
	at com.sun.ejb.codegen.Compiler.compile(Compiler.java:57)
	at com.sun.ejb.codegen.IASEJBC.compileClasses(IASEJBC.java:293)
	at com.sun.ejb.codegen.CmpCompiler.compile(CmpCompiler.java:230)
	at com.sun.ejb.codegen.IASEJBC.doCompile(IASEJBC.java:615)
	at com.sun.ejb.codegen.IASEJBC.ejbc(IASEJBC.java:563)
	at com.sun.enterprise.deployment.backend.EJBCompiler.preDeployApp(EJBCompiler.java:340)
	at com.sun.enterprise.deployment.backend.EJBCompiler.compile(EJBCompiler.java:209)
	at com.sun.enterprise.deployment.backend.AppDeployer.runEJBC(AppDeployer.java:284)
	at com.sun.enterprise.deployment.backend.AppDeployer.deploy(AppDeployer.java:176)
	at com.sun.enterprise.deployment.backend.AppDeployer.doRequestFinish(AppDeployer.java:107)
	at com.sun.enterprise.deployment.phasing.J2EECPhase.runPhase(J2EECPhase.java:146)
	at com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(DeploymentPhase.java:71)
	at com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(PEDeploymentService.java:633)
	at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:185)
	at com.sun.enterprise.admin.mbeans.ApplicationsConfigMBean.deploy(ApplicationsConfigMBean.java:519)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:589)
	at com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelper.java:302)
	at com.sun.enterprise.admin.config.BaseConfigMBean.invoke(BaseConfigMBean.java:357)
	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
	at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:758)
	at sun.reflect.GeneratedMethodAccessor25.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:589)
	at com.sun.enterprise.admin.util.proxy.ProxyClass.invoke(ProxyClass.java:54)
	at $Proxy1.invoke(Unknown Source)
	at com.sun.enterprise.admin.server.core.jmx.SunoneInterceptor.invoke(SunoneInterceptor.java:272)
	at com.sun.enterprise.deployment.autodeploy.AutoDeployer.invokeDeploymentService(AutoDeployer.java:504)
	at com.sun.enterprise.deployment.autodeploy.AutoDeployer.deployModule(AutoDeployer.java:485)
	at com.sun.enterprise.deployment.autodeploy.AutoDeployer.deployApplication(AutoDeployer.java:418)
	at com.sun.enterprise.deployment.autodeploy.AutoDeployer.deployApplication(AutoDeployer.java:408)
	at com.sun.enterprise.deployment.autodeploy.AutoDeployer.deployAll(AutoDeployer.java:228)
	at com.sun.enterprise.server.SystemAppLifecycle.deployToTarget(SystemAppLifecycle.java:181)
	at com.sun.enterprise.server.SystemAppLifecycle.deploySystemApps(SystemAppLifecycle.java:156)
	at com.sun.enterprise.server.SystemAppLifecycle.onStartup(SystemAppLifecycle.java:78)
	at com.sun.enterprise.server.ApplicationServer.onStartup(ApplicationServer.java:300)
	at com.sun.enterprise.server.PEMain.run(PEMain.java:294)
	at com.sun.enterprise.server.PEMain.main(PEMain.java:220)
|#]


STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
	1. login to "miragelv.sfbay" with your username
	2. >cd /opt/APPSERVER
	3. run "source setup.csh"   
	4. >cd /opt/APPSERVER/appserver-sqe/pe/jsr109-test/test/p2u-client
	5. >ant all

SERVER LOG:
/opt/APPSERVER/SUNWappserver/domains/domain1/logs/server.log

EXPECTED VERSUS ACTUAL BEHAVIOR :
ant all
Buildfile: build.xml

setOSConditions:

setToolWin:

setToolUnix:

setToolProperty:

setS1ASclassPath:

init:
     [echo] admin.host = localhost
     [echo] admin.port = 4848

setup:

clean:
   [delete] Deleting directory /opt/APPSERVER/appserver-sqe/pe/jsr109-test/build

makedirs:
    [mkdir] Created dir: /opt/APPSERVER/appserver-sqe/pe/jsr109-test/build
    [mkdir] Created dir: /opt/APPSERVER/appserver-sqe/pe/jsr109-test/build/src/client
    [mkdir] Created dir: /opt/APPSERVER/appserver-sqe/pe/jsr109-test/build/classes
    [mkdir] Created dir: /opt/APPSERVER/appserver-sqe/pe/jsr109-test/build/jaxrpc-mapping
    [mkdir] Created dir: /opt/APPSERVER/appserver-sqe/pe/jsr109-test/build/descriptor
    [mkdir] Created dir: /opt/APPSERVER/appserver-sqe/pe/jsr109-test/build/descriptor/META-INF
    [mkdir] Created dir: /opt/APPSERVER/appserver-sqe/pe/jsr109-test/build/descriptor/META-INF/wsdl
    [mkdir] Created dir: /opt/APPSERVER/appserver-sqe/pe/jsr109-test/build/descriptor/client
    [mkdir] Created dir: /opt/APPSERVER/appserver-sqe/pe/jsr109-test/build/jars
    [mkdir] Created dir: /opt/APPSERVER/appserver-sqe/pe/jsr109-test/build/metainf
    [mkdir] Created dir: /opt/APPSERVER/appserver-sqe/pe/jsr109-test/build/metainf/META-INF
    [mkdir] Created dir: /opt/APPSERVER/appserver-sqe/pe/jsr109-test/build/metainf/META-INF/wsdl

copyfiles:
     [copy] Copying 3 files to /opt/APPSERVER/appserver-sqe/pe/jsr109-test/build/descriptor/client
     [copy] Copying 1 file to /opt/APPSERVER/appserver-sqe/pe/jsr109-test/build/metainf/META-INF/wsdl
     [copy] Copying 2 files to /opt/APPSERVER/appserver-sqe/pe/jsr109-test/build/descriptor
     [copy] Copying 1 file to /opt/APPSERVER/appserver-sqe/pe/jsr109-test/build/src/client

wscompile:
     [exec] error: modeler error: failed to parse document at "http://localhost:8080/ejbep/FindInterest?WSDL": java.io.FileNotFoundException: http://localhost:8080/ejbep/FindInterest?WSDL
     [exec] Result: 1

compile:
    [javac] Compiling 1 source file to /opt/APPSERVER/appserver-sqe/pe/jsr109-test/build/classes
    [javac] /opt/APPSERVER/appserver-sqe/pe/jsr109-test/build/src/client/Client.java:25: cannot find symbol
    [javac] symbol  : class Interest
    [javac] location: class mpclient.Client
    [javac]             Interest interestPort1 = (Interest)
    [javac]             ^
    [javac] /opt/APPSERVER/appserver-sqe/pe/jsr109-test/build/src/client/Client.java:25: cannot find symbol
    [javac] symbol  : class Interest
    [javac] location: class mpclient.Client
    [javac]             Interest interestPort1 = (Interest)
    [javac]                                       ^
    [javac] /opt/APPSERVER/appserver-sqe/pe/jsr109-test/build/src/client/Client.java:26: cannot find symbol
    [javac] symbol  : class Interest
    [javac] location: class mpclient.Client
    [javac]                 manyPorts1Service.getPort(Interest.class);
    [javac]                                           ^
    [javac] 3 errors

BUILD FAILED
file:/opt/APPSERVER/appserver-sqe/pe/jsr109-test/test/p2u-client/build.xml:41: Compile failed; see the compiler error output for details.

Total time: 9 seconds

EXPECTED BEHAVIOR :
Buildfile: build.xml

setOSConditions:

setToolWin:

setToolUnix:

setToolProperty:

setS1ASclassPath:

init:
     [echo] admin.host = localhost
     [echo] admin.port = 4848

setup:

clean:
   [delete] Deleting directory /opt/APPSERVER/appserver-sqe/pe/jsr109-test/build

makedirs:
    [mkdir] Created dir: /opt/APPSERVER/appserver-sqe/pe/jsr109-test/build
    [mkdir] Created dir: /opt/APPSERVER/appserver-sqe/pe/jsr109-test/build/src/client
    [mkdir] Created dir: /opt/APPSERVER/appserver-sqe/pe/jsr109-test/build/classes
    [mkdir] Created dir: /opt/APPSERVER/appserver-sqe/pe/jsr109-test/build/jaxrpc-mapping
    [mkdir] Created dir: /opt/APPSERVER/appserver-sqe/pe/jsr109-test/build/descriptor
    [mkdir] Created dir: /opt/APPSERVER/appserver-sqe/pe/jsr109-test/build/descriptor/META-INF
    [mkdir] Created dir: /opt/APPSERVER/appserver-sqe/pe/jsr109-test/build/descriptor/META-INF/wsdl
    [mkdir] Created dir: /opt/APPSERVER/appserver-sqe/pe/jsr109-test/build/descriptor/client
    [mkdir] Created dir: /opt/APPSERVER/appserver-sqe/pe/jsr109-test/build/jars
    [mkdir] Created dir: /opt/APPSERVER/appserver-sqe/pe/jsr109-test/build/metainf
    [mkdir] Created dir: /opt/APPSERVER/appserver-sqe/pe/jsr109-test/build/metainf/META-INF
    [mkdir] Created dir: /opt/APPSERVER/appserver-sqe/pe/jsr109-test/build/metainf/META-INF/wsdl

copyfiles:
     [copy] Copying 3 files to /opt/APPSERVER/appserver-sqe/pe/jsr109-test/build/descriptor/client
     [copy] Copying 1 file to /opt/APPSERVER/appserver-sqe/pe/jsr109-test/build/metainf/META-INF/wsdl
     [copy] Copying 2 files to /opt/APPSERVER/appserver-sqe/pe/jsr109-test/build/descriptor
     [copy] Copying 1 file to /opt/APPSERVER/appserver-sqe/pe/jsr109-test/build/src/client

wscompile:
     [exec] Warning: Could not get charToByteConverterClass!

compile:
    [javac] Compiling 1 source file to /opt/APPSERVER/appserver-sqe/pe/jsr109-test/build/classes

jar:
      [jar] Building jar: /opt/APPSERVER/appserver-sqe/pe/jsr109-test/build/jars/appclient.jar

ear:
      [ear] Building ear: /opt/APPSERVER/appserver-sqe/pe/jsr109-test/buildears/P2UClientApp.ear

deploy:
     [exec] WARNING: The --password option is insecure and should not be used since it can compromise your password.  Please use either the command prompt or the --passwordfile option.
     [exec] Command deploy executed successfully.

runclient:
     [exec] WS HOME appserver-sqe
     [exec] interestPort1.calculateInterest(200.0,3.0) is 60.0
     [exec] Generating report at        /opt/APPSERVER/appserver-sqe/test_results.xml


     [exec] -----------------------------------------
     [exec] -     WSDL publishing to URL, WSDL with imports Test 2: PASS        -
     [exec] -     WSDL publishing to URL, WSDL with imports Test 1: PASS        -
     [exec] -----------------------------------------
     [exec] Total PASS: 2
     [exec] Total FAIL: 0
     [exec] Total DNR: 0
     [exec] -----------------------------------------
     [exec] Result: 1

all:

BUILD SUCCESSFUL
Total time: 37 seconds

REPRODUCIBILITY :
This bug can be reproduced always.

Comments
EVALUATION Annotation processing can be requested explicitly (using various new javac options such as -proc:only, -processor, -s, or -A) or implicitly (configuring an annotation processor using the java.util.Service framework and placing it on the classpath). If annotation processing is requested explicitly or implicitly, javac must be allowed to create a class loader. However, if annotation processing isn't requested, javac shouldn't fail. To accomodate this, javac should not rely on java.util.Service and a class loader to scan for annotation processor services. We will change javac to not fail if annotation processing isn't requested. However, this requires non-trival changes and some functionality must be copied from ClassLoader or java.util.Service. This will not be ready for Mustang beta.
16-11-2005

EVALUATION Annotation processing is an integral part of javac as of Mustang. In order to do annotation processing transparently, javac must be able to load the processors.
16-11-2005

WORK AROUND ###@###.### explains: Grant tools.jar permission to create a classloader by adding the following line into the appserver server.policy file: grant codeBase "file:YOUR_JDK_DIR/....../tools.jar" { permission java.lang.RuntimePermission "createClassLoader"; };
16-11-2005

WORK AROUND As noted in the comments, using "-proc:none" to javac should prevent it from creating a class loader in this case. Another way to workaround this problem should be to grant tools.jar permission to create a classloader; appserver team, please verify granting this permission allows javac to run in your environment.
11-11-2005

EVALUATION This bug report has been accepted as we will investigate if the situation can be improved. However, it is important to remember that no contract exists that governs the behavior of javac in restricted security managers. In particular, the behavior of the compiler is governed by CCC request 5087488 which includes no mention of security managers. Based on that, the appserver is at fault for running javac under a restricted security manager. Restricting the compiler's use of class loaders imposes a completely unreasonable restriction on the implementation of javac.
09-11-2005