Automatic Generation of orm.xml file in netbeans - netbeans

Is there a way i can automatically generate orm.xml file in Netbeans even if i can modify it later. Am using eclipselink JPA 2.1 and it keeps giving me this warning when am building
warning: Supported source version 'RELEASE_6' from annotation processor 'org.eclipse.persistence.internal.jpa.modelgen.CanonicalModelProcessor' less than -source '1.7'
Note: Creating non-static metadata factory ...
Note: Found Option : eclipselink.canonicalmodel.use_static_factory, with value: false
Note: Optional file was not found: META-INF/orm.xml continuing with generation.
Note: Optional file was not found: META-INF/eclipselink-orm.xml continuing with generation.
Note: Found Option : eclipselink.canonicalmodel.use_static_factory, with value: false
Note: Optional file was not found: META-INF/orm.xml continuing with generation.
Note: Optional file was not found: META-INF/eclipselink-orm.xml continuing with generation.
warning: The following options were not recognized by any processor: '[eclipselink.canonicalmodel.use_static_factory]'
Note: C:\Users\USER\Documents\NetBeansProjects\payroll\src\dcl\payroll\GUI\Login.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 warning

The warning is just there to let you know that if you are using an orm.xml to define your mappings, it wasn't found. If you place one there, you will still get messages letting you know one was found. This gives a notice in the log to help point where to start looking if something unexpected in your application occurs - such as the wrong orm.xml version is used or one is unexpectedly packaged and picked up, which seems a common issue in development.

Related

Groovy:General error during semantic analysis: java.lang.NoSuchMethodError:

Imported the gradle project from the "complete" folder and received the following error:
Groovy:General error during semantic analysis:
java.lang.NoSuchMethodError: 'org.codehaus.groovy.ast.expr.Expression org.codehaus.groovy.ast.tools.GeneralUtils.propX(org.codehaus.groovy.ast.expr.Expression, java.lang.String)'
I am using the latest version of Eclipse, 2020-12, with groovy tools installed.
From grails guide
https://guides.grails.org/gorm-without-grails/guide/index.html
Downloaded code sample from github
https://github.com/grails-guides/gorm-without-grails.git
It seems likely to be a version mismatch, but I cannot determine how to correct this problem.
I have tried to delete the offending file, src/main/groovy/demo/domain/Manufacturer.groovy, and the error appears on the file in this package on line 1.
The error does not appear in any other package. I have done the usual internet searches for resolutions that apply, but have thus far been unable to find a suitable solution. I am hopeful for a suggestion?
I think this error comes from an AST transform that references the older signature of GeneralUtils#propX. This method used to return Expression and was changed to return PropertyExpression.
The bridge method for binary compatibility was missing in groovy-eclipse. https://github.com/groovy/groovy-eclipse/commit/f6f448675d95f858b4ec65b6fc8e55f27ccaaa94

How to remedy error caused by guava: Program type already present: com.google.common.util.concurrent.internal.InternalFutures

An AAR library already uses com.google.guava.
If an app includes the following in its build.gradle:
api 'com.google.guava:guava:27.0-android'
Building the app generates the following error:
Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: ...
Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.
Program type already present: com.google.common.util.concurrent.internal.InternalFutures
If I do not include "api 'com.google.guava:guava:27.0-android'", the app can be built, but it has runtime error of java.lang.NoClassDefFoundError when it reaches the point of using the Guava method: Iterables.find
I had to update to version 27.0.1, at the time of writing they still haven't updated the README with this new version.
implementation 'com.google.guava:guava:27.0.1-android'
Since Guava 27.0, ListenableFuture is located in separate artifact, see the announcement. You can try two things (one at a time):
Exclude "listenablefuture" module (group "com.google.guava") and build your project again.
I don't know the AAR specifics, but it could be that 27.0-android doesn't work with AAR, so you should try 26.0-android instead.

Swift build error_if_any_output_files_are_specified_they_all_must_be

When converting to use the new build system on Xcode 10, I get the following error in my output for several of my extension targets.
<unknown>:0: error: if any output files are specified, they all must be
Command CompileSwift failed with a nonzero exit code
I have looked for a solution online, but the only reference I can find to this error is in the Swift compiler source code itself.
https://www.google.com/search?q=error_if_any_output_files_are_specified_they_all_must_be
Does anyone know how this error is actually triggered, or what I can do to fix it?
Ok, I had the same problem with one of our projects. Building or Archiving are always stopped with the error <unknown>:0: error: if any output files are specified, they all must be.
The solution for us was to set Compilation Mode to Incremental instead of Whole Module.
This means, you have to ignore the Validate Project Settings warning:

Failed to resolve class via deferred binding

// ...some imports
public class Menu {
final MenuMaker myClass = GWT.create(MenuMaker.class); // ERROR
My ...gwt.xml:
...
<generate-with class="com.gwt.rebind.MenuGenerator">
<when-type-assignable class="com.gwt.client.MenuMaker" />
</generate-with>
...
All work perfectly when I run compile in DevMode but when I "Build the project with the GWT compiler" I get this error:
[ERROR] Line 15: Failed to resolve 'com.gwt.client.MenuMaker' via deferred binding
Scanning for additional dependencies: jar:file:/C:/eclipse/plugins/com.google.gwt.eclipse.sdkbundle_2.4.0.v201208080121-rel-r42/gwt-2.4.0/gwt-user.jar!/com/google/gwt/dom/client/DOMImpl.java
[WARN] For the following type(s), generated source was never committed (did you forget to call commit()?)
[WARN] com.gwt.client.MenuMakerGen
[ERROR] Cannot proceed due to previous errors
At the end of com.gwt.rebind.MenuGenerator:
sourceWriter.commit(logger);
Check if all your client classes have default, zero-parameter constructor. I had the same "deferred binding" issue, and it turned out that one of my classes hadn't had default constructor. It was strange, because this class wasn't even mentioned in GWT compiler log.
Check for gwt-compile problems. The message
[ERROR] Line 15: Failed to resolve '...' via deferred binding
can result from compile problems in your gwt code. In my case it was a class, which was only available on the server side of the application, but was referenced in a class belonging to 'shared' part of the application.
In Java it compiled well, so I had no error in eclipse. The above error-message only showed up when building it with maven. Still it remained somewhat difficult to find the real problem, as the message text was not very helpful.
It turned out, that running the app on com.google.gwt.dev.DevMode would produce a more detailed logfile of the gwt-compilation (probably one could configure maven to do the same?).
Right at the beginning of this more detailed log, there were entries, which pointed me to the problem described above. After correcting these problems, the "Failed to resolve ... via deferred binding"-error was gone.
Check your model/ Pojo Class should implements Serializable
interface and also
Class have default constructor(No argument constructor).
In my case, some of the model classes were not implementing com.google.gwt.user.client.rpc.IsSerializable, that's why I got the error mentioned in the question.
In my case, a key in Resource Bundle properties file which corresponds the method name was missing and the problem resolved after adding it.

Enabling Migration Warnings

I am porting a 2.7.7 scala code base over to 2.8 and was wondering if there was a compiler option to display migration notices? I was bitten by a change in behavior for mutable sequences that had the following migration notice[1], however it doesn't display anything when I build the project ( I have deprecation and unchecked warnings enabled already)
1: #migration(2, 8,
"As of 2.8, this operation creates a new map. To add an element as a\n"+
"side effect to an existing map and return that map itself, use +=."
)
The option is: -Xmigration
Entering scalac -help will show the standard options of the Scala compiler.
Entering scalac -X will show the advanced options.
Entering scalac -Y will show the private options.
It's a extended option, -Xmigration.
~: scala -X
Usage: scala <options> <source files>
Possible advanced options include:
-Xassem-extdirs <dirs> List of directories containing assemblies, defaults to `lib'
-Xassem-name <file> Name of the output assembly (only relevant with -target:msil)
-Xassem-path <path> List of assemblies referenced by the program (only relevant with -target:msil)
-Xcheck-null Emit warning on selection of nullable reference
-Xcheckinit Add runtime checks on field accessors. Uninitialized accesses result in an exception being thrown.
-Xdisable-assertions Generate no assertions and assumptions
-Xelide-below Generate calls to #elidable-marked methods only if method priority is greater than argument.
-Xexperimental Enable experimental extensions
-Xfatal-warnings Fail the compilation if there are any warnings.
-Xfuture Turn on future language features
-Xgenerate-phase-graph <file> Generate the phase graphs (outputs .dot files) to fileX.dot
-Xlog-implicits Show more info on why some implicits are not applicable
-Xmigration Warn about constructs whose behavior may have changed between 2.7 and 2.8
-Xno-forwarders Do not generate static forwarders in mirror classes
-Xno-uescape Disables handling of \u unicode escapes
-Xnojline Do not use JLine for editing
-Xplugin-disable:<plugin> Disable a plugin
-Xplugin-list Print a synopsis of loaded plugins
-Xplugin-require:<plugin> Abort unless a plugin is available
-Xplugin:<file> Load a plugin from a file
-Xpluginsdir <path> Path to search compiler plugins
-Xprint-icode Log internal icode to *.icode files
-Xprint-pos Print tree positions (as offsets)
-Xprint-types Print tree types (debugging option)
-Xprint:<phase> Print out program after <phase> or "all"
-Xprompt Display a prompt after each error (debugging option)
-Xresident Compiler stays resident, files to compile are read from standard input
-Xscript <object> Compile as a script, wrapping the code into object.main()
-Xshow-class <class> Show class info
-Xshow-object <object> Show object info
-Xshow-phases Print a synopsis of compiler phases
-Xsource-reader <classname> Specify a custom method for reading source files
-Xsourcedir <directory> When -target:msil, the source folder structure is mirrored in output directory.
-Xwarninit Warn about possible changes in initialization semantics
-Y Print a synopsis of private options
% scala -X
Usage: scala <options> <source files>
Possible advanced options include:
...
-Xmigration Warn about constructs whose behavior may have changed between 2.7 and 2.8
...