Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Context(org.mozilla.javascript.ContextFactory) is not public in org.mozilla.javascript.Context; cannot be accessed from outside package #145

Open
steowens opened this issue Feb 21, 2015 · 3 comments
Labels
Triage Issues yet to be triaged

Comments

@steowens
Copy link

So depending on how Rhino is loaded the subject error may or may not occur. If I run the code from eclipse it works but when I run in maven it doesn't work. The complete error is as follows:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project rights-management: Compilation failure
[ERROR] /Users/sowens/Documents/workspace/rights-management/src/main/java/com/disney/tss/ft/rightsManagement/logic/scripted/ScriptExecutionContextFactory.java:[19,25] Context(org.mozilla.javascript.ContextFactory) is not public in org.mozilla.javascript.Context; cannot be accessed from outside package

The code in question is:
I have marked line 19 with 19>>> that is not part of the code listing.

public class ScriptExecutionContextFactory extends ContextFactory {
    public static class ScriptExecutionContext extends Context {
        final long startTime;
        protected ScriptExecutionContext(ScriptExecutionContextFactory contextFactory){
19>>>       super(contextFactory);
            this.startTime = System.currentTimeMillis();
        }
    }

    public ScriptExecutionContextFactory(){
        super();
    }

yada yada yada ...;

@gbrail
Copy link
Collaborator

gbrail commented Feb 23, 2015

I see that the constructor:

On Fri, Feb 20, 2015 at 5:17 PM, Steve Owens [email protected]
wrote:

So depending on how Rhino is loaded the subject error may or may not
occur. If I run the code from eclipse it works but when I run in maven it
doesn't work. The complete error is as follows:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project rights-management: Compilation failure
[ERROR] /Users/sowens/Documents/workspace/rights-management/src/main/java/com/disney/tss/ft/rightsManagement/logic/scripted/ScriptExecutionContextFactory.java:[19,25] Context(org.mozilla.javascript.ContextFactory) is not public in org.mozilla.javascript.Context; cannot be accessed from outside package

The code in question is:
I have marked line 19 with 19>>> that is not part of the code listing.

public class ScriptExecutionContextFactory extends ContextFactory {
public static class ScriptExecutionContext extends Context {
final long startTime;
protected ScriptExecutionContext(ScriptExecutionContextFactory contextFactory){
19>>> super(contextFactory);
this.startTime = System.currentTimeMillis();
}
}

public ScriptExecutionContextFactory(){
    super();
}

yada yada yada ...;


Reply to this email directly or view it on GitHub
#145.

greg brail | apigee https://apigee.com/ | twitter @gbrail
http://twitter.com/gbrail

@gbrail
Copy link
Collaborator

gbrail commented Feb 23, 2015

Argh, sorry.

I see that the constructor:

Context(ContextFactory);

is "protected" so this error doesn't make sense to me. Plus the code in
Context hasn't changed for a long time.

If you have something that we can test to reproduce this, or information
about what version of Rhino you are using, then we might be able to help
more.

On Fri, Feb 20, 2015 at 5:17 PM, Steve Owens [email protected]
wrote:

So depending on how Rhino is loaded the subject error may or may not
occur. If I run the code from eclipse it works but when I run in maven it
doesn't work. The complete error is as follows:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project rights-management: Compilation failure
[ERROR] /Users/sowens/Documents/workspace/rights-management/src/main/java/com/disney/tss/ft/rightsManagement/logic/scripted/ScriptExecutionContextFactory.java:[19,25] Context(org.mozilla.javascript.ContextFactory) is not public in org.mozilla.javascript.Context; cannot be accessed from outside package

The code in question is:
I have marked line 19 with 19>>> that is not part of the code listing.

public class ScriptExecutionContextFactory extends ContextFactory {
public static class ScriptExecutionContext extends Context {
final long startTime;
protected ScriptExecutionContext(ScriptExecutionContextFactory contextFactory){
19>>> super(contextFactory);
this.startTime = System.currentTimeMillis();
}
}

public ScriptExecutionContextFactory(){
    super();
}

yada yada yada ...;


Reply to this email directly or view it on GitHub
#145.

greg brail | apigee https://apigee.com/ | twitter @gbrail
http://twitter.com/gbrail

@steowens
Copy link
Author

The class I posted (partially above) should be adequate to reproduce the issue. It would need to be added to a Maven project and then you would need to use maven to compile. Like I said, when I run the unit tests that instantiate this class in the debugger they execute flawlessly, but when I run them during a maven command such as maven install, the code in the class doesn't even compile. I will try to get you a project that reproduces the issue later.

@p-bakker p-bakker added the Triage Issues yet to be triaged label Jul 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Triage Issues yet to be triaged
Projects
None yet
Development

No branches or pull requests

3 participants