Hand coded GUI build failed in Codename One - codenameone

In this project I started to create a form with the GUI Builder but I did not feel comfortable with this tool. Consequently I rather hand coded it based on a demo example https://github.com/codenameone/MaterialScreensUIKit/blob/master/src/com/codename1/uikit/materialscreens/LoginForm.java.
I should mention that I changed the name for the hand coded form from MainForm to MainForm2 and that I am using Netbeans with the latest availabel plugin of CN1 (updated November 7th 2016). Now for nearly each and every simulator run (when I click on the IDE play button) I get this error :
ant -f /home/blablah/CN1Project -Dnb.internal.action.name=run run
Processing GUI builder file: /home/blablah/CN1Project/src/myPackage/MainForm.java
/home/blablah/CN1Project/build.xml:469: Gui builder source file corrupt, the don't edit below/above this line comments seem to be missing or modified!
ErrCcode A: -1 ErrCode B: -1
BUILD FAILED (total time: 0 seconds)
Line 469 reads :  <generateGuiSources srcDir="src" encoding="UTF-8" guiDir="res/guibuilder" />
I understand the error message and I can confirm that the line comments is missing since I did create the form manually. Yet if I click a second time on the play button the simulator runs without error. Please note that the same behaviour also appears if I send build to CN1 server (two clicks needed).
What's the proper way of creating manually a Form (as shown in the demo codes), should I create it via new CN1/ GUI Builder Form or can I simply add the comments to make the compiling process happier ?
Any help appreciated,

In your project directory look under res/guibuilder and in that hierarchy you will find a .gui file matching your java source file. Delete that and the file will stop being a GUI builder file.

Related

Packaged shell extension killing application

I have a WPF application. To give it an identity to consume UWP APIs, I've added sparse package support. This installs / uninstalls / updates (we're not using MSIX) with my WPF application fine, and my app is running with an identity. It shows in task manager with a Package Name listed on my process.
Now I'm attempting to add context menu support following Microsoft's docs.
I've created a shell extension which will show when opening the context menu for any file and folder, which is pretty much a copy of their sample with different GetIcon(), GetTitle() and Invoke() implementations for IExplorerCommand.
I'm specifying this in the AppxManifest.xml (values anonymised):
<desktop4:Extension Category="windows.fileExplorerContextMenus">
<desktop4:FileExplorerContextMenus>
<desktop5:ItemType Type="*">
<desktop5:Verb Id="MyFileCommand" Clsid="file-guid"/>
</desktop5:ItemType>
<desktop5:ItemType Type="Directory">
<desktop5:Verb Id="MyFolderCommand" Clsid="folder-guid"/>
</desktop5:ItemType>
</desktop4:FileExplorerContextMenus>
</desktop4:Extension>
<com:Extension Category="windows.comServer">
<com:ComServer>
<com:SurrogateServer DisplayName="SSVerbHandler">
<com:Class Id="file-guid" Path="my-shell-extension.dll" ThreadingModel="STA"/>
</com:SurrogateServer>
<com:SurrogateServer DisplayName="SSVerbHandler">
<com:Class Id="folder-guid" Path="my-shell-extension.dll" ThreadingModel="STA"/>
</com:SurrogateServer>
</com:ComServer>
</com:Extension>
This works, my context menu entry is listed and performs the action as expected. But here's the issue: each time the context menu is opened for the first time, it kills the already running instance of my WPF application. By first time, I mean restarting explorer.exe and right clicking on a file or folder.
My gut feeling is this is related to UWP side of things. This is because originally it would always kill my application when right clicking to open a context menu. But with a little trial and error I solved this by configuring multi-instance support in my AppxManifest.xml:
<Package
...
xmlns:desktop4="http://schemas.microsoft.com/appx/manifest/desktop/windows10/4"
xmlns:iot2="http://schemas.microsoft.com/appx/manifest/iot/windows10/2"
IgnorableNamespaces="uap mp desktop4 iot2">
...
<Applications>
<Application Id="App"
...
desktop4:SupportsMultipleInstances="true"
iot2:SupportsMultipleInstances="true">
...
</Application>
</Applications>
...
</Package>
I'm hoping someone can suggest any troubleshooting ideas as I'm now struggling.
I've sprinkled some ol' trusty MessageBox functions within the shell extension in DllMain, DllCanUnloadNow and DllGetClassObject. But for that first load attempt, no message boxes are shown, no context menu item listed and my application is still killed.
I've poked around in the event viewer hoping to see any errors or warnings listed recently, plus in Applications and Service Logs\Microsoft\Windows\Appx* and Applications and Service Logs\Microsoft\Windows\AppModel-Runtime. Nothing has jumped out at me.
According to this SO anwser, if there's an error with the shell extension itself, it may not show. That does fit, but I'm sceptical as it always works on subsequent attempts, and the previously solved UWP killing issue.
In the scenario where my application stops, using these powershell commands I get:
$process = Start-Process .\MyApp.exe -PassThru -Wait
$process.ExitCode
1
I do have crash logging in my app, but nothing gets logged. This is the only place Environment.Exit(1) is called within the WPF application.
I did try the silent monitoring detection in GFlags on the WPF application, but couldn't seem to trigger it. Only when I manually closed the application. (Ignore Self Exits unchecked for testing). I'm not sure if that's because the exit code is 1.
When the error occurs with process monitor running, I can see lots of ThreadExit before a final ProcessExit with the exit code 1. That would imply it's exiting cleanly with my application itself returning 1?
It's also worth mentioning I've lived in managed / .NET land for the last decade or so, I don't have much experience with C++ (or unmanaged languages in general) or UWP, and the first time I've attempted to write a shell extension.

Why does System.IO.Compression.ZipFile.ExtractToDirectory() throw InvalidDataException on Artifact.zip from TeamCity?

I recently updated Jetbrains Team City to version 2020.2.2. I use it to build my project whenever I check code into my source repository. I use the TeamCity API to DownloadAll in order to retrieve an Artifacts.zip that contains all the files generated by the build.
The recent update has a bug in it which is corrupting the Artifacts.zip file that is downloaded.
I am now getting an InvalidDataException "A local file header is corrupt." when My program calls System.IO.Compression.ZipFile.ExtractToDirectory() on the Artifacts.zip file.
I am able to right click on this very same file and unzip it using the built in windows "Extract All" and also with 7-Zip extract to folder. No problems with those, but for some reason, my program throws the above exception.
I use the following command on the Team City API to get the file:
https://{myserver}/httpAuth/repository/downloadAll/{myrepository}/{buildId}:id/artifacts.zip
Does anybody know why this would have just started happening on February 1, 2021?
I wrote up a bug on the JetBrains Team City site describing the above problem. They responded this morning with a fix. This appears to have been introduced with TeamCity Enterprise 2020.2.2 (build 85899):
Please add an internal property: (Click blue link to the left for instructions on how)
teamcity.internal.artifacts.useZip64=false
We applied the above property, and the problem was immediately resolved. No reboot of TeamCity was necessary.
Here is a LINK to the bug/solution on the JetBrains TeamCity site.

C/C++ Code generation from xcos in scilab

I've developed a model in xcos in scilab and I'd like to generate the C/C++ code of this model so that I can deploy it in embedded system.
However the issue is that the Code generating item in Tools menu is disabled. I guess it means I don't have the tool which converts the graphical model into code. I'm running linux.
Could you please help me with finding the plugin to generate the code?
You might have already done it, but would be useful for others.
The answer is X2C software, can be downloaded from - http://www.mechatronic-simulation.org/download/
Download the zip file, unzip it and navigate to "X2Copen-v1028-2016-09-10\X2C\System\Scilab\Scripts" and run the file "setup.sce" from scilab console.
You can run this file just by drag and drop to scilab console.
Start XCOS from scilab and create your model, then press "Start communicator" and "Transform model and push to communicator". You will see a dialog box for connection configuration, choose appropriate and download.

After latest update the java file from the gui do strange things

Yesterday i updated to the latest version of CodenameOne.
I like the new version of the new GUI but... 2 problems:
When I try to add a command from the new GUI, the code created to the java file creates an error. If I remember correct it says ";" missing. So i create now the command by code.
On buttons I create a new Action Event. It is created to the jave file, but it never run the code to the onButton_1ActionEvent handler. I tried with debug and never goes in there. It works perfect when i create the Action event from the code myself.
So is it a bug, or i do something wrong? Plugin Version is 3.5.5
Thank you
We released 3.5.6 yesterday which is still undergoing verification right now. When submitting issues/problems we need the version of the GUI builder from the about menu, it looks like this:

"Operation in progress..." Never Ends When Previewing Rows in Kettle Spoon via Salesforce

I am trying to pull data from a Salesforce API account using Pentaho/Kettle Spoon. I am able to establish a connection on Pentaho with this account. I am also able to get fields from specific modules. However, when I try and "Preview rows" (even with a small number of rows), the "Operation in Progress" window comes up and never completes the task. When I try and cancel the job, Pentaho hangs and I have to force quit it.
I am running Fedora 21. Any input is greatly appreciated.
Thanks!
This works for me:
Since upgrading to Fedora 22 Spoon (the client tool of PDI) was not working properly anymore. Although I could start Spoon properly and create transformations etc, once I wanted to execute a transformation or sometimes even when trying to open settings, nothing was working and the terminal window showed several (SWT:20352): GLib-CRITICAL error messages. In a nutshell, Spoon was rendered useless.
Here is how to solve this:
Go to the Eclipse Download Page and download the latest 64bit verion of Eclipse IDE for Java EE Developers. Note: There is a separate download area for SWT; however, for Linux there is no 64 bit version available. The only way to get one is to build it yourself. So I just went the easier way and downloaded Eclipse instead.
Unzip the file and search for swt. A search result will show a few files, but the ones interesting for us are (your version number might be different): org.eclipse.swt_3.103.2.v20150203-1313.jar and org.eclipse.swt.gtk.linux.x86_64_3.103.2.v20150203-1351.jar.
Copy the first one of these files into <PDI_HOME>/libswt/linux/x86 and the second into <PDI_HOME>/libswt/linux/x86_64.
oth folders still have the original jar files in them. Rename them to swt-jar-old (Note: no extension, so that they are not picked up).
Start Spoon. There will be a few error messages shown, but so far Spoon is working way better for me than before.
FONT: http://diethardsteiner.github.io/pdi/2015/06/07/Fixing-PDI-GLib-CRITICAL.html
i'm running Ubuntu 14.04, i5,6gb RAM, got same trouble..
when i check, the load in proccessor is 100%, evertime i try showing the content or other thing in pentaho, the Operation in progress is show up, and never end..
How to solve, check your access to file/connection in your database,unrecognize file,field,etc. after this resolve, my proccessor run normal, and i could run / execute the transformation.

Resources