-
Notifications
You must be signed in to change notification settings - Fork 23
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
NPE while run with default values #36
Comments
It is turns out there is no problem in 2.4.1 version |
Whenever I'm using binding files I'm now getting a NPE on manager:
I'm getting the exeption "Cannot get property 'treeRoot' on null object" which leads me to think manager is null in this case. I've also tested with version 2.4.1 and I'm also not getting the error there. |
I created a Short, Self Contained, Correct (Compilable), Example / Minimal, Complete, and Verifiable example for #21 here: Can you submit a PR to that project that causes the issue you describe to occur? |
I am upgrading from Caused by: java.lang.NullPointerException: Cannot get property 'treeRoot' on null object
at org.codehaus.groovy.runtime.NullObject.getProperty(NullObject.java:60)
at org.codehaus.groovy.runtime.InvokerHelper.getProperty(InvokerHelper.java:174)
at org.codehaus.groovy.runtime.callsite.NullCallSite.getProperty(NullCallSite.java:47)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGetProperty(AbstractCallSite.java:296)
at org.openrepose.gradle.plugins.jaxb.task.JaxbXjc.start(JaxbXjc.groovy:98) |
@wdschei I've had a busy week, I'll try to get something together in the weekend |
Gradle 4.1-4.5 and jaxb-plugin 2.5.0, also getting Gradle 4.7 and jaxb-plugin 2.5.0 works for me. Deleting files in Trying to reproduce how those got messed up would take a while. The changelog shows many changes from 2.4.1 to 2.5, but the actual code diff of plugin source files is rather small, and nothing seems to justify a new NPE when using 2.4.1 vs. 2.5.0 on the same gradle 4.5.1 version (the change of groovy version may be more relevant). Trying to reproduce the problem, I found I could not, meaning I could not provide a simple example having the same problem. Eventually I copy/pasted my whole project folder with Bottom line: trying to reproduce this issue, make sure to delete those file hashes. |
@tkruse Glad you found us over here already. So, are you saying that by deleting the files in the |
@wdschei yes, after the NPE encountered, I deleted the |
@tkruse Glad to hear it is working for you. To answer your other thought on the Gradle forums, we have looked at replacing this repo with a non-forked version. So far we have gotten the traction by publishing directly to the Gradle Plugin Portal and by folks looking at the issues and PR's on the original repo. We are still investigating how to make the transition without losing our current list of issues and the searchable PR accountability. |
@tkruse That turned out to be much easier than expected. We are now detached from the original repository that we had been forked from. |
Deleting the whole Deleting just the However you get the issue if you start a new project / checkout a new copy of a project. First build works, all builds after a |
We have tracked down what is causing this and there will be a fix forthcoming. It basically boils down to the Inputs for the dependency tree task are not complete and the task is not always running when it needs to. This was introduced in during the updates to make the Up To Date checks work with Gradle 4.x. During our investigation, we decided there was no need for this to have ever been a separate task, so it will just be merged into the xjc task. The short-term workaround is to perform a |
i just ran into this one too. when are you expecting a new release? |
@scphantm This is a side project that we started maintaining since it was previously abandoned and PR's were just sitting. We do dogfood this plugin and have run into this issue occasionally. However, the the pain threshold has not been reached to force it to bubble to the top of our backlog. That said, I can't give you a good date for a bug fix release. Maybe during our 4'th quarter hack day. We are more than happy to accept PR's if this is something you think you might want to tackle. |
What do you think is the fix, merge the two tasks together into one?
… On Sep 5, 2018, at 10:42 AM, William Scheidegger ***@***.***> wrote:
@scphantm This is a side project that we started maintaining since it was previously abandoned and PR's were just sitting. We do dogfood this plugin and have run into this issue occasionally. However, the the pain threshold has not been reached to force it to bubble to the top of our backlog. That said, I can't give you a good date for a bug fix release. Maybe during our 4'th quarter hack day.
We are more than happy to accept PR's if this is something you think you might want to tackle.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
At this point we haven't given it much thought. |
Well, merging them is something I can probably do.
… On Sep 6, 2018, at 9:20 AM, William Scheidegger ***@***.***> wrote:
At this point we haven't given it much thought.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
This triggered even without a change to the schema file, but on a gradle version update. |
The workaround given doesn't work. Is there any other workaround, or is this dead? |
@shevek What have you tried? |
It fails after a |
@shevek Do you continue to get an NPE following the steps in: |
Hi @wdschei Setup
Error example
A problem with this workaround is, that deleting the executionHistory folder slows down the build. Working example I don't know why, but this case is working fine. Seems like the build task from the error example somehow breaks the XJC.
|
A work-around that works for us, and doesn't include cleaning anything, has been to insert the following in the build.gradle file: tasks.named("xsd-dependency-tree").configure {
inputs.dir(xjc.bindings)
} For us, it was caused by the fact that the xsd-dependency-tree task needs to run for the xjc task to work, but the xjc task has an additional up-to-date check on the bindings folder that the former doesn't have. We don't use binding files at all, but it defaults to looking in the src/main/resources/schema folder, so any changes here will cause the xjc task to be rerun - even if you have a different xsdDir property configured. After we got aware of this, we also changed the bindingsDir property to point to a non-existing folder so it wouldn't cause unnecessary reruns as well. |
@bjornvester
Code extract
I am still getting the error:
|
I managed to find a workaround which works for my project, thanks to the input from @bjornvester:
This will disable the incremental build feature completely for the XJC task, but it works without any exception. I am still interested in a real bugfix for this gradle-jaxb-plugin. |
on Gradle 6.5.1
works correctly without any workarounds just by |
${project.projectDir}/build.gradle
`buildscript {
dependencies {
classpath 'gradle.plugin.org.openrepose:gradle-jaxb-plugin:2.5.0'
}
}
plugins {
id 'org.openrepose.gradle.plugins.jaxb' version '2.5.0'
}
group 'com.example'
version '1.0-SNAPSHOT'
apply plugin: 'java'
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
}
jaxb {
xsdDir = "${project.projectDir}/src/main/resources/schema"
xjc {
}
}`
${project.projectDir}/src/main/resources/schema/example.xsd
`
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="aaa.bbb.ccc"
</xs:schema>`
Administrators-MacBook-Pro-3:artifid User$ ./gradlew --version
Gradle 4.6
Build time: 2018-02-28 13:36:36 UTC
Revision: 8fa6ce7945b640e6168488e4417f9bb96e4ab46c
Groovy: 2.4.12
Ant: Apache Ant(TM) version 1.9.9 compiled on February 2 2017
JVM: 1.8.0_141 (Oracle Corporation 25.141-b15)
OS: Mac OS X 10.13.4 x86_64
Administrators-MacBook-Pro-3:artifid User$ java -version
java version "1.8.0_141"
Java(TM) SE Runtime Environment (build 1.8.0_141-b15)
Java HotSpot(TM) 64-Bit Server VM (build 25.141-b15, mixed mode)
Administrators-MacBook-Pro-3:artifid User$ ./gradlew xjc --stacktrace
FAILURE: Build failed with an exception.
Execution failed for task ':xjc'.
Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':xjc'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:103)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:73)
It is looks like
def manager = getManager()
was not created in file org.openrepose.gradle.plugins.jaxb.task.JaxbXjc
The text was updated successfully, but these errors were encountered: