Re: What do these error messages mean?

2023-02-11 Thread lofid...@gmail.com
Thanks Thomas for the info!

Thomas Broyer schrieb am Samstag, 11. Februar 2023 um 19:27:25 UTC+1:

> On Friday, February 10, 2023 at 6:38:04 PM UTC+1 lofid...@gmail.com wrote:
> You can still emulate System.xxx if you want to:
>
> It *is* emulated since GWT 2.8.0, where it returns GWT properties' 
> values: 
> https://github.com/gwtproject/gwt/commit/999d9a68abfa2583692826e49095dd26cb07f715
>
> But as the error message said, the property name needs to be a constant 
> for the compiler to replace it with the property value.
>

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/2cc67ea4-c842-48ef-a43f-38afa977600en%40googlegroups.com.


Re: What do these error messages mean?

2023-02-11 Thread Thomas Broyer


On Friday, February 10, 2023 at 6:38:04 PM UTC+1 lofid...@gmail.com wrote:
You can still emulate System.xxx if you want to:

It *is* emulated since GWT 2.8.0, where it returns GWT properties' 
values: 
https://github.com/gwtproject/gwt/commit/999d9a68abfa2583692826e49095dd26cb07f715

But as the error message said, the property name needs to be a constant for 
the compiler to replace it with the property value.

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/ce52b54f-4e6f-403c-802e-5d590aa184den%40googlegroups.com.


Re: What do these error messages mean?

2023-02-10 Thread lofid...@gmail.com
You can still emulate System.xxx if you want to:

https://stackoverflow.com/questions/6457047/gwt-java-emulation
Michael Moser schrieb am Freitag, 10. Februar 2023 um 17:15:25 UTC+1:

> I boiled the cases where the compilation triggered in the code server 
> stalls (see my previous email) down to three errors (the other dozen or so 
> I was able to fix), but what do these last error messages try to convey 
> to me?
>
>  
>
> [INFO] [ERROR] Line 193: Rebind result 
> 'ch.zh.ksta.zhstregisterjp.client.ui.components.ZHStRegisterJPThreeListField.ZHStRegisterJPThreeListFieldAppearance'
>  
> must be a class
>
> [INFO] [ERROR] Line 141: Rebind result 
> 'com.sencha.gxt.data.shared.LabelProvider' must be a class
>
>  
>
> What is this «rebinding» about? Is there some explanation somewhere? And 
> why does it fail here? Esp. the latter error bothers me since that is in 
> some library we use and I can’t change that.
>
>  
>
> And the third one:
>
>  
>
> [INFO] [ERROR] Line 85: Only string constants may be used as 
> property name in System.getProperty()
>
>  
>
> The code causing the above is from a spring library:
>
>  
>
> public static boolean getBoolean(final String name) {
>
> boolean result = false;
>
> try {
>
> result = Boolean.parseBoolean(System.getProperty(name));
>
> } catch (IllegalArgumentException | NullPointerException e) {
>
> }
>
> return result;
>
> }
>
>  
>
> Does that REALLY mean that GWT can’t handle a System.getProperty(…)-calls 
> with an argument that’s passed into the method? That seems completely 
> brain-damaged to me. Why is that so???
>
>  
>
>  
>
>  
>
> *From:* google-we...@googlegroups.com  *On 
> Behalf Of *Michael Moser
> *Sent:* Friday, February 10, 2023 2:08 PM
> *To:* google-we...@googlegroups.com
> *Subject:* Can one convince code server to continue with compilation even 
> if certain source files are missing?
>
>  
>
> Hi all
>
> I am trying to set my GWT development environment up such that I deploy to 
> a local Tomcat (v8.5 in my case) from my IDE (Eclipse and IntelliJ – I am 
> setting this up for an entire team) and then start CodeServer to supply the 
> JS code, the code maps and what not.
>
>  
>
> I managed to get things starting up, the application gets deployed to 
> Tomcat from the IDE and then I manually start the code server via mvn 
> gtw:codeServer in a command window. Note: I am NOT using any GWT plugin, 
> neither Eclipse’s nor IntelliJ’s. Maybe I will give them another  try 
> later, but in my last installation neither worked.
>
>  
>
> I can then connect to the WebPage, I get the login-form and the initial 
> webpage and the code-server starts compiling the JS-code. So far so good.
>
>  
>
> However, then the compilation in the code server always fails due to some 
> missing source files. I analyzed the errors and there indeed bugs in our 
> code. Earlier developers added code that should be server-side only into 
> shared DTO classes ☹. I will need to re-arrange and fix that but I don’t 
> have the time right now.
>
>  
>
> The offending methods are never used on the client side and thus 
> apparently they are ignored and do no harm. Amazingly the GWT compiler – 
> when compiling the application for the version that gets packed up as war 
> file – ignores those issues and continues with the compilation and the 
> deployed application then runs just fine.
>
>  
>
> But when the very same application is compiled in code-server the 
> compilation fails:
>
> …
>
> [INFO]   Compiling module ch.zh.ksta.zhstregisterjp.ZHStRegisterJPWeb
>
> [INFO]  Ignored 8 units with compilation errors in first pass.
>
> [INFO] Compile with -strict or with -logLevel set to TRACE or DEBUG to see 
> all errors.
>
> [INFO]  [ERROR] Errors in 
> 'file:/D:/Projects/KStA_ZH_RegisterJP/code/application/zhstregisterjp-common/src/main/java/ch/zh/ksta/zhstregisterjp/shared/security/SecurityUtils.java'
>
> [INFO] [ERROR] Line 36: No source code is available for type 
> org.springframework.security.core.context.SecurityContextHolder; did you 
> forget to inherit a required module?
>
> …
>
> [INFO]   [ERROR] Compiler returned false
>
> [INFO]   [WARN] recompile failed
>
> [INFO]   [WARN] continuing to serve previous version
>
> Since there **is no** previous version that’s it and the application then 
> hangs/crashes.
>
> It almost seems as if code server compiles in strict mode here, even 
> though I explicitly have specified false in the 
> plugin config.
>
> Can one somehow “fix” (or rather circumvent) this behavior?
>
>  
>
> I need to be able to run and debug this application soon and have to 
> postpone the cleanup to later. Is there a way to get the code server 
> ignoring those errors and continue compiling that code – as the 
> GWT-compiler apparently does when generating the code for the .war file?
>
>  
>
> Regards,
>
> Michael
>
>  
>
>  

Re: What do these error messages mean?

2023-02-10 Thread lofid...@gmail.com
You need to think that the result app will be running in browser as 
JavaScript.

Can you do System.getProperty(...) in web browser? 

In my last article I emphasize this:

*(4) Treat the client as a JavaScript app*

It is helpful for Java developers to think of the client as a JavaScript 
web application, since the result of the transpilation process is 
JavaScript that runs on a web browser. This makes it easier to understand 
how to include the JavaScript files in the static directory of your Spring 
Boot web application. 
https://bit.ly/DynamiteDuo

And also don't mix the server and client module. It seems you add 
SpringFramework together with your client module... 

In my article above I write about the separation...

Hope this helps.
Michael Moser schrieb am Freitag, 10. Februar 2023 um 17:15:25 UTC+1:

> I boiled the cases where the compilation triggered in the code server 
> stalls (see my previous email) down to three errors (the other dozen or so 
> I was able to fix), but what do these last error messages try to convey 
> to me?
>
>  
>
> [INFO] [ERROR] Line 193: Rebind result 
> 'ch.zh.ksta.zhstregisterjp.client.ui.components.ZHStRegisterJPThreeListField.ZHStRegisterJPThreeListFieldAppearance'
>  
> must be a class
>
> [INFO] [ERROR] Line 141: Rebind result 
> 'com.sencha.gxt.data.shared.LabelProvider' must be a class
>
>  
>
> What is this «rebinding» about? Is there some explanation somewhere? And 
> why does it fail here? Esp. the latter error bothers me since that is in 
> some library we use and I can’t change that.
>
>  
>
> And the third one:
>
>  
>
> [INFO] [ERROR] Line 85: Only string constants may be used as 
> property name in System.getProperty()
>
>  
>
> The code causing the above is from a spring library:
>
>  
>
> public static boolean getBoolean(final String name) {
>
> boolean result = false;
>
> try {
>
> result = Boolean.parseBoolean(System.getProperty(name));
>
> } catch (IllegalArgumentException | NullPointerException e) {
>
> }
>
> return result;
>
> }
>
>  
>
> Does that REALLY mean that GWT can’t handle a System.getProperty(…)-calls 
> with an argument that’s passed into the method? That seems completely 
> brain-damaged to me. Why is that so???
>
>  
>
>  
>
>  
>
> *From:* google-we...@googlegroups.com  *On 
> Behalf Of *Michael Moser
> *Sent:* Friday, February 10, 2023 2:08 PM
> *To:* google-we...@googlegroups.com
> *Subject:* Can one convince code server to continue with compilation even 
> if certain source files are missing?
>
>  
>
> Hi all
>
> I am trying to set my GWT development environment up such that I deploy to 
> a local Tomcat (v8.5 in my case) from my IDE (Eclipse and IntelliJ – I am 
> setting this up for an entire team) and then start CodeServer to supply the 
> JS code, the code maps and what not.
>
>  
>
> I managed to get things starting up, the application gets deployed to 
> Tomcat from the IDE and then I manually start the code server via mvn 
> gtw:codeServer in a command window. Note: I am NOT using any GWT plugin, 
> neither Eclipse’s nor IntelliJ’s. Maybe I will give them another  try 
> later, but in my last installation neither worked.
>
>  
>
> I can then connect to the WebPage, I get the login-form and the initial 
> webpage and the code-server starts compiling the JS-code. So far so good.
>
>  
>
> However, then the compilation in the code server always fails due to some 
> missing source files. I analyzed the errors and there indeed bugs in our 
> code. Earlier developers added code that should be server-side only into 
> shared DTO classes ☹. I will need to re-arrange and fix that but I don’t 
> have the time right now.
>
>  
>
> The offending methods are never used on the client side and thus 
> apparently they are ignored and do no harm. Amazingly the GWT compiler – 
> when compiling the application for the version that gets packed up as war 
> file – ignores those issues and continues with the compilation and the 
> deployed application then runs just fine.
>
>  
>
> But when the very same application is compiled in code-server the 
> compilation fails:
>
> …
>
> [INFO]   Compiling module ch.zh.ksta.zhstregisterjp.ZHStRegisterJPWeb
>
> [INFO]  Ignored 8 units with compilation errors in first pass.
>
> [INFO] Compile with -strict or with -logLevel set to TRACE or DEBUG to see 
> all errors.
>
> [INFO]  [ERROR] Errors in 
> 'file:/D:/Projects/KStA_ZH_RegisterJP/code/application/zhstregisterjp-common/src/main/java/ch/zh/ksta/zhstregisterjp/shared/security/SecurityUtils.java'
>
> [INFO] [ERROR] Line 36: No source code is available for type 
> org.springframework.security.core.context.SecurityContextHolder; did you 
> forget to inherit a required module?
>
> …
>
> [INFO]   [ERROR] Compiler returned false
>
> [INFO]   [WARN] recompile failed
>
> [INFO]   [WARN] continuing to serve previous version