CayenneModeler not generating Cayenne.xml - java

I am learning Apache Cayenne, so I am new to it.
I am following the official guide http://cayenne.apache.org/docs/3.0/tutorial.html.
I am doing exactly the same as the guide says, but when I save the project, it's generating 2 xml files, instead of 3, and when I run the java app (using the classes generated) following error appears:
Exception in thread "main" org.apache.cayenne.ConfigurationException: [v.3.0RC2 Feb 03 2010 13:38:54] Error during Configuration initialization. [v.3.0RC2 Feb 03 2010 13:38:54] [org.apache.cayenne.conf.DefaultConfiguration] : Domain configuration file "cayenne.xml" is not found.
at org.apache.cayenne.conf.Configuration.initializeSharedConfiguration(Configuration.java:168)
at org.apache.cayenne.conf.Configuration.initializeSharedConfiguration(Configuration.java:141)
at org.apache.cayenne.conf.Configuration.initializeSharedConfiguration(Configuration.java:121)
at org.apache.cayenne.conf.Configuration.getSharedConfiguration(Configuration.java:91)
at org.apache.cayenne.access.DataContext.createDataContext(DataContext.java:143)
at org.example.cayenne.Main.main(Main.java:21)
Caused by: org.apache.cayenne.ConfigurationException: [v.3.0RC2 Feb 03 2010 13:38:54] [org.apache.cayenne.conf.DefaultConfiguration] : Domain configuration file "cayenne.xml" is not found.
at org.apache.cayenne.conf.DefaultConfiguration.initialize(DefaultConfiguration.java:141)
at org.apache.cayenne.conf.Configuration.initializeSharedConfiguration(Configuration.java:159)
... 5 more
I don't know what happened

I think I know what's going on. If you look at the exception, your stack trace indicates Cayenne version being v.3.0RC2. This is a version of the runtime. 2 files (one of which is called something like "cayenne-project.xml"), were generated by the Modeler version 3.1. You need to ensure that both the Modeler and the runtime are of the same release.
3.1 Tutorial seems to be correct in respect to the actual files in the project:
http://cayenne.apache.org/docs/3.1/tutorial/ch02.html#create-new-project

Related

gluon app does not find method in jdk, how is that possible?

I made an android gluon app, testing the validity of the model before going "big boy".
I had some struggles, mainly due to how different a gluon app on desktop and mobile (android) react.
I was able to overcome all of them, except one.
When my app starts, i open some websockets connections and get this exception
[Thu Aug 11 08:39:13 CEST 2022][INFO] [SUB] D/GraalCompiled(22536): Caused by: java.lang.NoSuchMethodException: java.lang.Byte.valueOf(java.lang.String)
[Thu Aug 11 08:39:13 CEST 2022][INFO] [SUB] D/GraalCompiled(22536): at java.lang.Class.getMethod(DynamicHub.java:1114)
[Thu Aug 11 08:39:13 CEST 2022][INFO] [SUB] D/GraalCompiled(22536): at org.eclipse.jetty.util.TypeUtil.<clinit>(TypeUtil.java:147)
[Thu Aug 11 08:39:13 CEST 2022][INFO] [SUB] D/GraalCompiled(22536): ... 35 more
I've had lots of reflection problems, but this one i don't know how to tackle.
Here are the various parameters:
app compiled on linux (ubuntu)
netbeans 13
jdk 17.0.4
gluon plugin 2.8.4
graalvm-svm-java17-linux-gluon-22.0.0.3-Final
javaStaticSdkVersion='18-ea+prep18-8
galaxy tab A8, android 11
Don't know what else to say, i don't have a clue as to where to start, there are too many paths i can go and search.
Thanks for any input.
You're seeing this error because Jetty's TypeUtil class uses reflection for some String-to-basic type conversions.
Access via reflection is difficult to resolve upon compilation time, which is probably why your GraalVM native-image build fails: native-image only includes classes that are deemed necessary, and in this case it just missed to include it.
A proper fix would be to change TypeUtil to use method references instead of reflection (I ran into the same problem, and I've just filed Jetty pull request #9115).
However, you will most likely want to run your code now, and can't wait for this to be merged. Additionally, you may probably encounter more of these reflection issues even if this particular one is fixed.
In order for GraalVM native-image to know which classes and methods are accessed via reflection, you can specify them via configuration files in the resource classpath, under META-INF/native-image/com.yourdomain/your-project/reflect-config.json. Upon assembly, native-image will pick up this configuration from the classpath.
You can also use the GraalVM native-image Tracing Agent to create this file automatically.
To do this, invoke your app with the GraalVM JRE (i.e., using Hotspot, not native-image), and specify the following VM argument:
-agentlib:native-image-agent=config-output-dir=/tmp/native-image.{pid}
Interact with your app like you normally would (cover as much as possible), then terminate the VM.
You will see a bunch of JSON files created under /tmp/native-image.(PID). Copy all of them under the META-INF path described above and rebuild your native image.
For details see the GraalVM documentation, e.g., Reflection Use in Native Images
and Native Image Tracing Agent.

Unexpected problem processing bytes for class in Grails with Elasticsearch

I'm trying to get Elasticsearch working in my Grails project. I'm using the Java Rest High-level client in Elasticsearch documented here [https://www.elastic.co/guide/en/elasticsearch/client/java-rest/6.3/java-rest-high-getting-started-maven.html]. I'm using Elasticsearch 6.3.2 version, Java 8, Grails 2.4.4
I have created a service class and added an import statement at the beginning of the file. For eg: import org.elasticsearch.ElasticsearchException
And, when I start Grails I get the error below. But if I remove that import statement the application runs fine. So, what's happening in the import ?
Sep 12, 2018 3:05:29 PM org.springsource.loaded.agent.SpringLoadedPreProcessor preProcess
SEVERE: Unexpected problem transforming call sites
java.lang.IllegalStateException: Unexpected problem processing bytes for class
at org.springsource.loaded.ConstantPoolChecker2.readConstantPool(ConstantPoolChecker2.java:196)
at org.springsource.loaded.ConstantPoolChecker2.<init>(ConstantPoolChecker2.java:128)
at org.springsource.loaded.ConstantPoolChecker2.getReferences(ConstantPoolChecker2.java:102)
at org.springsource.loaded.MethodInvokerRewriter.rewrite(MethodInvokerRewriter.java:300)
at org.springsource.loaded.MethodInvokerRewriter.rewriteUsingCache(MethodInvokerRewriter.java:156)
at org.springsource.loaded.TypeRegistry.methodCallRewriteUseCacheIfAvailable(TypeRegistry.java:828)
Caused by: java.lang.IllegalStateException: Entry: 14 18
at org.springsource.loaded.ConstantPoolChecker2.processConstantPoolEntry(ConstantPoolChecker2.java:335)
at org.springsource.loaded.ConstantPoolChecker2.readConstantPool(ConstantPoolChecker2.java:186)
So, can someone help me understand what's happening here?
Thanks.
I got this error in versions of Java later than Java 7, but was able to get it to work in Java 7

Delta XML- Dita compare getting Caught com.deltaxml.dita.FilterProcessingException

I am using deltaxml for some time and it is working fine. But for a specific dita topics , I am getting these warnings in the logs:
WARNING: Caught com.deltaxml.dita.FilterProcessingException: Exception thrown when attempting to run the ‘input-a/9-dxp-9-cals-table-checker.xsl’ step (source: ‘/dita-xsl/cals-tables/cals-table-checker.xsl’) whilst performing DCE[BEINGPROCESSED: file:/home/nxf36037/crrbcompareissue/trydirecttmp5/a-0-file-/regs/d ipflexcan3syn.dita, file:/home/nxf36037/crrbcompareissue/trydirecttmp5/b-0-file-/regs/d ipflexcan3syn.dita.bak, file:/home/nxf36037/crrbcompareissue/trydirecttmp5/b-0-file-/regs/d ipflexcan3syn.dita]
Feb 09, 2018 2:37:55 PM com.deltaxml.dita.ditabb ditaa
WARNING: Cannot find ids within file:/home/nxf36037/crrbcompareissue/trydirecttmp5/b-0-file-/regs/d ipflexcan3syn.dita Cause: java.io.FileNotFoundException: /home/nxf36037/crrbcompareissue/trydirecttmp5/b-0-file-/regs/dipfl excan3syn.dita (No such file or directory)
Feb 09, 2018 2:37:55 PM com.deltaxml.dita.ditaq ditaa
WARNING: Cannot prepare topics for comparison. Cause: com.deltaxml.util.href.ditab: Cannot construct target (concerning hrefs file:/home/nxf36037/crrbcompareissue/trydirecttmp5/b-0-file-/regs/d ipflexcan3syn.dita, file:/home/nxf36037/crrbcompareissue/trydirecttmp5/b-0-file-/regs/d ipflexcan3syn.dita.dxml-p1)
Feb 09, 2018 2:38:02 PM com.deltaxml.dita.ditaq ditaa
WARNING: Skipping topicref /home/nxf36037/crrbcompareissue/trydirecttmp5/b-0-file-/regs/dipfl excan3syn.dita. Cause: Cannot determine whether file:/home/nxf36037/crrbcompareissue/trydirecttmp5/b-0-file-/regs/d ipflexcan3syn.dita contains change.
I am not able to find the cause of this issue, I have tried almost all the arguments which I felt could be the cause.
The command line I am using is:
java -jar /pkg/deltaxml-dita-/2017.09.21/lib/deltaxml-dita.jar compare mts B1518165232953/dipflexcan3syn/specsource/maps/dipflexcan3synbg .ditamap B1518165232953/dipflexcan3syn/specsource/maps/dipflexcan3syn_bg .ditamap output-format=dita-markup map-result-structure=map-pair map-result-origin=B trydirecttmp5
I have also checked the dita files, they gets validated and there are no errors. Could you please help here?
The schematron code at: https://github.com/nigelwhitaker/cals-table-schematron can be used to detect and report, in a fairly user-friendly manner, table validation issues, either inside an editor or using the schematron skeleton.
As discussed with Mohit over in https://github.com/nigelwhitaker/cals-table-schematron/issues/4 it does however depend on XSLT 2.0 or 3.0 features and therefore is not suitable for all schematron systems.

This application does not exist (app_id) in Java Netbeans Glassfish web application

I am a new programmer trying to deploy my Java web application to a web host for the first time. I started trying to do it with Jelastic but I need file storage, not just a .jar file, and it looks like you have to pay a LOT to upgrade.
If you know of a way I can upload my application and also store a single .png (image) file so my application can overwrite it by accessing the URL please let me know. I don't mind paying X money for a host but $150 or whatever is crazy.
In the meantime I found that Google App Engine lets you upload a Java application. I have been trying to do this for maybe 3 hours.
I am stuck with the error:
WARNING: Error posting to URL: https://appengine.google.com/api/appversion/getresourcelimits?app_id=animelist1&version=1&
404 Not Found
This application does not exist (app_id=u'animelist1').
I have checked that I am logged in under the correct Google account (no others, and rebooted and used CCleaner to clear my browser cache), that I have an empty project in Google App Engine called "animelist1" and have checked that my application is called "animelist1" with the appengine-web.xml with "animelist".
I am using the netbeans plugin to deploy to Google. I have the correct email set there.
There are many people with this issue who fixed it the same way. However as I am a beginner I am unable to figure out how to do this method. The method is
This application does not exist (app_id=xxx)
Google App Engine : this application does not exist
(and many others with similar answers)
The method is "appcfg.py update --no_cookies MyProjectDirectory/" or "appcfg.py update . --no_cookies"
Can you please assist me in doing this?
I have located appcfg.py at
C:\Program Files\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine
there is another one at
C:\Program Files\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\google\appengine\tools
there is also a appcfg_java.py here but we can come to that later if need be.
I have tried using the Google Cloud SDK Shell (which looks like the cmd console) to navigate to the directory and type those commands. This opens the file in a text file and doesn't seem to do anything else.
I believe I may have to find the appcfg relevant to my application/project (but I'm not sure). When I do a computer search for the file I get 8 files with that name returned:
image
All I want to do really is upload my Java Glassfish web application, then upload a .png file so I can point my application to it (it will overwrite the file).
I thought about changing my application to run on Tomcat because I thought I saw there was a free Java host that allows tomcat. That was several hours ago now because I have been headbutting this thing so maybe I should just abort and try that instead. Or if you know of a host that doesn't cost $150+ let me know. I don't know why they said they cost that, I thought you could host really cheaply.
Please help, thankyou!!!!
The full code of my error is below. I don't know why there is an error about System Java Compiler, I just checked my environment after messing it up, saw it hadn't saved, then rebooted, and now it is saved. I have a JAVA_HOME system variable set to C:\Program Files\Java\jdk1.8.0_40 and my Path system variable is
C:\ProgramData\Oracle\Java\javapath;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Skype\Phone\;C:\Program Files\Google\Cloud SDK\google-cloud-sdk\bin;C:\Program Files\Java\jdk1.8.0_40
(maybe I don't need both, not sure). I have nothing else set there, nothing in User Variables though I will double check if that is needed.
Here is my full error log:
********************************************************
There is a new version of the SDK available.
-----------
Latest SDK:
Release: 1.9.19
Timestamp: Thu Feb 19 23:57:40 GMT 2015
API versions: [1.0]
-----------
Your SDK:
Release: 1.9.18
Timestamp: Thu Feb 12 19:30:16 GMT 2015
API versions: [1.0]
-----------
Please visit https://developers.google.com/appengine/downloads for the latest SDK.
********************************************************
Reading application configuration data...
Apr 20, 2015 6:51:40 AM com.google.apphosting.utils.config.AppEngineWebXmlReader readAppEngineWebXml
INFO: Successfully processed C:/Users/J/Documents/NetBeansProjects/g5/target/animelist1-1.0-SNAPSHOT\WEB-INF/appengine-web.xml
Apr 20, 2015 6:51:40 AM com.google.apphosting.utils.config.AbstractConfigXmlReader readConfigXml
INFO: Successfully processed C:/Users/J/Documents/NetBeansProjects/g5/target/animelist1-1.0-SNAPSHOT\WEB-INF/web.xml
Beginning interaction for module default...
Apr 20, 2015 6:51:40 AM com.google.appengine.tools.admin.AbstractServerConnection send1
WARNING: Error posting to URL: https://appengine.google.com/api/appversion/getresourcelimits?app_id=animelist1&version=1&
404 Not Found
This application does not exist (app_id=u'animelist1').
This is try #0
Apr 20, 2015 6:51:40 AM com.google.appengine.tools.admin.AbstractServerConnection send1
WARNING: Error posting to URL: https://appengine.google.com/api/appversion/getresourcelimits?app_id=animelist1&version=1&
404 Not Found
This application does not exist (app_id=u'animelist1').
This is try #1
Apr 20, 2015 6:51:41 AM com.google.appengine.tools.admin.AbstractServerConnection send1
WARNING: Error posting to URL: https://appengine.google.com/api/appversion/getresourcelimits?app_id=animelist1&version=1&
404 Not Found
This application does not exist (app_id=u'animelist1').
This is try #2
Apr 20, 2015 6:51:41 AM com.google.appengine.tools.admin.AbstractServerConnection send1
WARNING: Error posting to URL: https://appengine.google.com/api/appversion/getresourcelimits?app_id=animelist1&version=1&
404 Not Found
This application does not exist (app_id=u'animelist1').
This is try #3
0% Created staging directory at: 'C:\Users\J\AppData\Local\Temp\appcfg8900677438454325367.tmp'
5% Scanning for jsp files.
8% Compiling jsp files.
Error Details:
Apr 20, 2015 6:51:42 AM org.apache.jasper.JspC processFile
INFO: Built File: \index.jsp
java.lang.RuntimeException: Cannot get the System Java Compiler. Please use a JDK, not a JRE.
Unable to update app: Cannot get the System Java Compiler. Please use a JDK, not a JRE.
Please see the logs [C:\Users\J\AppData\Local\Temp\appcfg6599854602413633444.log] for further information.
I have an empty project in Google App Engine called "animelist1"
If you mean that you've used the SDK set up a local project, then you might have missed a step. When you visit http://appengine.google.com/ , does "animelist1" appear in the list of your applications? If not, you'll need to click the Create Application button (and hope that someone else hasn't already used that appid).
No project with ID 'animelist1' currently exists, but this ID is not available (it could exist in the past, but was deleted). If you already created the project your App ID is the same as Project ID, not Project name. If you didn't yet create the project, create one either in the old App Engine console as suggested by Dave or as per manual.
This is an credentials issue in most cases when you download code from already exsit project.
Make sure you have only one google account login your default browser.
Go to your lib/appengine-java-sdk-<version>/bin/ and run:
appcfg --no_cookies update <project-dir>
Note: early appcfg version command may like :appcfg update --no_cookies <project-dir>

tortoise svn fails to import to repository due to Inconsistent line ending style

I was very excited to see that there is a check-style like plugin called CheckStyle-IDEA plugin for IntelliJ that i can enforce code style on the source.
I installed it using the IDE plugin repository, restarted it.
Unfortunately After pressing the check this file or check project I got the an exception (see log below).
I am using windows 7 pro,
IDEA 10.0.3 build #103.255 Build on April 2011
JDK 1.6.0_21
did anyone encountered this problem?
is there any other tool to do this job through the intelliJ IDE?
Thanks
2011-05-05 11:41:56,723 [1300492] INFO - ea.checkstyle.CheckStylePlugin - Scanning current file(s).
2011-05-05 11:41:56,727 [1300496] ERROR - style.checker.CheckFilesThread - An error occurred while scanning a file.
org.infernus.idea.checkstyle.exception.CheckStylePluginException: An error occurred during a file scan.
at org.infernus.idea.checkstyle.CheckStylePlugin.processError(CheckStylePlugin.java:409)
at org.infernus.idea.checkstyle.checker.CheckFilesThread.run(CheckFilesThread.java:72)
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: 1
at java.lang.String.charAt(String.java:686)
at java.util.regex.Matcher.appendReplacement(Matcher.java:703)
at java.util.regex.Matcher.replaceAll(Matcher.java:813)
at java.lang.String.replaceAll(String.java:2189)
at org.infernus.idea.checkstyle.util.ScannableFile.parentDirFor(ScannableFile.java:72)
at org.infernus.idea.checkstyle.util.ScannableFile.createTemporaryFileFor(ScannableFile.java:58)
at org.infernus.idea.checkstyle.util.ScannableFile.(ScannableFile.java:40)
at org.infernus.idea.checkstyle.checker.CreateScannableFileAction.run(CreateScannableFileAction.java:60)at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:757) at org.infernus.idea.checkstyle.checker.FileScanner.createTemporaryFile(FileScanner.java:228)
at org.infernus.idea.checkstyle.checker.FileScanner.checkPsiFile(FileScanner.java:167)
at org.infernus.idea.checkstyle.checker.FileScanner.run(FileScanner.java:80)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:770) at org.infernus.idea.checkstyle.checker.CheckFilesThread.runFileScanner(CheckFilesThread.java:39) at org.infernus.idea.checkstyle.checker.AbstractCheckerThread.processFilesForModuleInfoAndScan(AbstractCheckerThread.java:132)
at org.infernus.idea.checkstyle.checker.CheckFilesThread.run(CheckFilesThread.java:57)
Checkstyle-idea plugin is sadly rather buggy :(
You can post or view issues at http://code.google.com/p/checkstyle-idea/ and get much faster support than here.

Categories