Corrupt theme file unrecognized magic number: 0 [CodenameOne] - themes

Why am getting below error in codename one while running or opening theme file. please provide solution on same.
java.io.IOException: Corrupt theme file unrecognized magic number: 0
com.svastikagames.gkquiz.MyApplication.start() Error java.lang.NullPointerException
at com.codename1.ui.util.Resources.openFileImpl(Resources.java:332)
at com.codename1.ui.util.Resources.openFile(Resources.java:261)
at com.codename1.ui.util.Resources.<init>(Resources.java:181)
at com.codename1.ui.util.Resources.open(Resources.java:729)
at com.codename1.ui.util.Resources.openLayered(Resources.java:694)
at com.codename1.ui.util.Resources.openLayered(Resources.java:658)
at generated.StateMachineBase.startApp(StateMachineBase.java:59)
at generated.StateMachineBase.<init>(StateMachineBase.java:31)
at generated.StateMachineBase.<init>(StateMachineBase.java:124)
at userclasses.StateMachine.<init>(StateMachine.java:236)
at com.svastikagames.gkquiz.MyApplication.start(MyApplication.java:25)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.codename1.impl.javase.Executor$1$1.run(Executor.java:100)
at com.codename1.ui.Display.processSerialCalls(Display.java:1149)
at com.codename1.ui.Display.mainEDTLoop(Display.java:966)
at com.codename1.ui.RunnableWrapper.run(RunnableWrapper.java:120)
at com.codename1.impl.CodenameOneThread.run(CodenameOneThread.java:176)

Usually this error means the file is 0 length and got corrupted at some point due to an unclear reason.
If the file is of 0 length there is nothing we can do to help recover its content unless you are using the XML team mode.
If you are using that then just launch the designer tool from command line and edit the theme it should actually work since it loads the resources from the XML's under the res directory and not the res file itself. If it prints out errors during save these might help you narrow down the problem and you can also refer these errors to us.
In order to launch the designer from command line use this on Unix/Linux/Mac:
java -jar ~/.codenameone/designer_1.jar
And on Windows:
java -jar MY_USER_DIRECTORY\.codenameone\designer_1.jar

Related

Uploading archive with xcode: Invalid prefix or suffix

Good morning,
I am trying to upload my first app through Xcode. Everything looks fine. I create the archive and if I run Validate App, result is valid.
But whenever I try to upload it it fails with the following message:
There was a general exception while executing.
An exception has ocurred: Invalid prefix or suffix.
I haven't found anything similar or any tip of what maybe happening.
Any help would be appreciated.
Update: Using transporter got this log
[2020-02-26 13:19:30 GMT-03:00] <main> DBG-X: parameter Success = true
[2020-02-26 13:19:30 GMT-03:00] <main> ERROR: There was a general exception while executing
[2020-02-26 13:19:30 GMT-03:00] <main> ERROR: An exception has occurred: Invalid prefix or suffix
[2020-02-26 13:19:30 GMT-03:00] <main> DEBUG: java.lang.IllegalArgumentException: Invalid prefix or suffix
at java.nio.file.TempFileHelper.generatePath(TempFileHelper.java:63)
at java.nio.file.TempFileHelper.create(TempFileHelper.java:127)
at java.nio.file.TempFileHelper.createTempFile(TempFileHelper.java:161)
at java.nio.file.Files.createTempFile(Files.java:897)
at com.apple.transporter.transport.http.impl.ObjectStoreTransport.transmitFilesForRequest(ObjectStoreTransport.java:455)
at com.apple.transporter.transport.http.impl.ObjectStoreTransport.performDiagnostic(ObjectStoreTransport.java:435)
at com.apple.transporter.transport.TransportByPodPolicy.performDiagnostic(TransportByPodPolicy.java:205)
at com.apple.transporter.operation.Upload.performDiagnosticForTransport(Upload.java:474)
at com.apple.transporter.operation.Upload.performUploadRequest(Upload.java:283)
at com.apple.transporter.operation.Upload.performUploadRequest(Upload.java:129)
at com.apple.transporter.operation.Upload.performRequest(Upload.java:1268)
at com.apple.transporter.operation.Verify.execute(Verify.java:120)
at com.apple.transporter.Application.reallyBegin(Application.java:224)
at com.apple.transporter.Application.begin(Application.java:114)
at com.apple.transporter.osgi.TransporterService.start(TransporterService.java:87)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.apple.transporter.starter.TransporterStarter.runService(TransporterStarter.java:476)
at com.apple.transporter.starter.TransporterStarter.runTransporterService(TransporterStarter.java:450)
at com.apple.transporter.starter.TransporterStarter.start(TransporterStarter.java:188)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.apple.transporter.bootstrap.BootstrapperPhase2.runStartable(BootstrapperPhase2.java:355)
at com.apple.transporter.bootstrap.BootstrapperPhase2.runStarter(BootstrapperPhase2.java:317)
at com.apple.transporter.bootstrap.BootstrapperPhase2.start(BootstrapperPhase2.java:130)
at com.apple.transporter.bootstrap.BootstrapperPhase1.startOSGiFramework(BootstrapperPhase1.java:321)
at com.apple.transporter.bootstrap.BootstrapperPhase1.bootstrap(BootstrapperPhase1.java:99)
at com.apple.transporter.bootstrap.BootstrapperPhase1.bootstrap(BootstrapperPhase1.java:59)
at com.apple.transporter.launcher.Launcher.launchBootstrapper(Launcher.java:37)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.apple.transporter.launcher.Application.start(Application.java:220)
at com.apple.transporter.launcher.Application.main(Application.java:658)
[2020-02-26 13:19:30 GMT-03:00] <main> DBG-X: Returning 1
Not related to generated IPA maybe?
Just when I started decompiling .jar files to try to reverse engineer them, my co-worker told me how he resolved this problem. This is pure insanity.
First of all, use Transporter app (get it from the appstore). Open it up and go to preferences. Uncheck "Signiant" transfer protocol, so it looks like this:
Now export .ipa or .pkg package from your built archive, drop it in Transporter and start uploading.
How to export a package:
Go to Organizer (Window -> Organizer), select your bundle and press "Distribute App". Choose App Store Connect -> Export -> ...
tl;dr;
1) change your timezone to UTC
or
2) add line DEFAULT_JVM_OPTIONS="-Duser.timezone=UTC${DEFAULT_JVM_OPTIONS:+ $DEFAULT_JVM_OPTIONS}" into file iTMSTransporter
just before JAVA_EXECUTABLE=${JVM_EXECUTABLE}.
file located at /Applications/Xcode.app/Contents/SharedFrameworks/ContentDeliveryServices.framework/Versions/A/itms/bin for XCode or /Applications/Transporter.app/Contents/itms/bin for Transporter. At the time of this answer. In future versions that can change.
Details:
I've got same issue and after spending a whole bunch of time googling for a solution, I've ended up with debugging transporter jar file.
Turned out it uses user timezone to generate some temporary file, and if timezone contains "/" it will fail as it is not allowed in file name, since it is folder separator. Such a silly bug and shame on transporter developers!
I am not a Java developer, and have zero knowledge on how Java programs run and work with all those tmp files and time zones, so have no idea if there are other ways to workaround that issue. If someone will end up with a better solution, please share.
Anyway I am going to report a bug.
Don't know exactly why, but changing Wifi connection worked.
Found additional info on this bug on:
https://forums.developer.apple.com/thread/128983

IntelliJ IDEA - Cannot inject value for option 'onRedeploy'

While trying out Automatic redeployment in IntelliJ IDEA, I'm stuck with onRedeploy, My bash script file has the following code:
#!/usr/bin/env bash
mvn package
java -jar target/Test-1.0-SNAPSHOT-fat.jar \
--redeploy="src/**/*.js,src/**/*.java,src/**/*.html,src/**/*.jade" \
--onRedeploy="./run.sh"
So, whenever I run this bash script, I got an error:
Error while executing command run: Cannot inject value for option 'onRedeploy'
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at io.vertx.core.cli.annotations.CLIConfigurator.inject(CLIConfigurator.java:237)
at io.vertx.core.spi.launcher.DefaultCommandFactory.create(DefaultCommandFactory.java:50)
at io.vertx.core.impl.launcher.VertxCommandLauncher.getNewCommandInstance(VertxCommandLauncher.java:162)
at io.vertx.core.impl.launcher.VertxCommandLauncher.execute(VertxCommandLauncher.java:217)
at io.vertx.core.impl.launcher.VertxCommandLauncher.dispatch(VertxCommandLauncher.java:383)
at io.vertx.core.impl.launcher.VertxCommandLauncher.dispatch(VertxCommandLauncher.java:328)
at io.vertx.core.Launcher.main(Launcher.java:48)
Caused by: java.lang.NullPointerException
at io.vertx.core.impl.launcher.commands.RunCommand.setOnRedeployCommandOld(RunCommand.java:154)
... 11 more
I followed up a tutorial from youtube by Clement Escoffier & Paulo Lopes
demonstrating how to develop a realtime web application using vert.x 3
It looks like the Output Stream of yours is null. Obvs a Bug in vertx3 but not really worth fixxing because:
You would see this message: "[WARNING] the 'onRedeploy' option is deprecated, and will be removed in vert.x 3.3. Use " +
"'on-redeploy' instead."
so try "--on-redeploy" instead and tell me if it works.
Jeerze

OSGi update site fails with "null" error

Sometimes, after server restart all applications fail because of missing ExtLib libraries. They should be installed during HTTP startup from NSF update site. Server log shows:
HTTP JVM: CLFAD0330I: NSF Based plugins are being
installed in the OSGi runtime. For more information please consult the
log
HTTP JVM: null. For more detailed information,
please consult error-log-0.xml located
in /data/domino/workspace/logs
... repeated ~30x
Content of the error-log-0.xml is no help - fails show only as empty line. Thankfully there is another log file startup.log containing stack trace of the problem:
!ENTRY org.eclipse.osgi 4 0 2015-04-24 09:20:02.450 !MESSAGE Error
installing bundle:
osginsf:update/extlib.nsf/E7D8A0430DEAFDF2C1257B4F003FF202/com.ibm.xsp.extlib.core_8.5.3.20130315-0724.jar
!STACK 0 java.io.IOException at
com.ibm.domino.internal.protocol.osginsf.OSGiNSFUrlConnection.getInputStream(OSGiNSFUrlConnection.java:133)
at java.net.URL.openStream(URL.java:1022) at
org.eclipse.core.runtime.adaptor.EclipseStarter.installBundles(EclipseStarter.java:1105)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.loadBasicBundles(EclipseStarter.java:646)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.access$1(EclipseStarter.java:623)
at
org.eclipse.core.runtime.adaptor.EclipseStarter$1.bundleChanged(EclipseStarter.java:308)
at
... stripped ...
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:611) at
com.ibm.domino.http.bootstrap.osgi.LaunchRCP.startRCP(LaunchRCP.java:342)
at
com.ibm.domino.http.bootstrap.osgi.LaunchRCP.launchOSGIFramework(LaunchRCP.java:172)
at
com.ibm.domino.http.bootstrap.BootstrapOSGIClassLoader.launchOSGIFramework(BootstrapOSGIClassLoader.java:79)
at
com.ibm.domino.http.bootstrap.BootstrapOSGIClassLoader.loadClass(BootstrapOSGIClassLoader.java:63)
at java.lang.ClassLoader.loadClass(ClassLoader.java:638) at
com.ibm.domino.http.bootstrap.BootstrapClassLoader.findClass(BootstrapClassLoader.java:79)
!ENTRY org.eclipse.update.configurator 4 0 2015-04-24 09:20:02.762
!MESSAGE
D:\Lotus\Domino\data\domino\workspace.config\domino\eclipse\plugins\plugins
is not a valid plugins directory.
What catched my eye is the last line - the mentioned plugin directory does not exist (one extra '/plugins' directory).
The only workaround is to recreate update site from scratch (delete all content and reimport local update site).
BTW, I have found very old discussion, with no solution on ExtLib project site.
What is the cause of failed update? I can't tell whether IO exception is caused by wrong file path or dead URL to update site (network misconfiguration).
Problem was solved by increasing disk size for Domino binaries - it went out of space (and nobody noticed) by growth of Windows directory (Windows updates). Data and translog directories use different drives, so server was running with no "out of space" errors.
It seems IO Exception was thrown during unsuccessful disk write.

Oracle Data Integrator (ODI - v11.1.1.3) "unable to load language: beanshell" Error

Following an install of Eclipse 3.7.2 on my Ubuntu 12.04 development machine, I have been unable to execute any ODI packages/interfaces/procedures. On execution (for both simulated and actual runs), an error is thrown (java trace below). I am not sure if it's anything to do with the Eclipse install, but it seems likely. Does anyone have an idea how to fix this?
Also, when launching ODI from the terminal using 'bash odi', the following error is displayed in the terminal:
2013-08-15 14:43:46.162 ERROR Error during RuntimeClassLoader initialization. ODI will start without RuntimeClassLoader
Error output:
oracle.odi.core.exception.OdiRuntimeException: Error during Code Interpretor creation
at com.sunopsis.dwg.codeinterpretor.SnpCodeInterpretor.getInstance(SnpCodeInterpretor.java:209)
at com.sunopsis.dwg.codeinterpretor.SnpGeneratorSQLCIT.<init>(SnpGeneratorSQLCIT.java:300)
at com.sunopsis.graphical.dialog.SnpsDialogExecution.doPackageExecuter(SnpsDialogExecution.java:907)
at oracle.odi.ui.action.SnpsPopupActionExecuteHandler.actionPerformed(SnpsPopupActionExecuteHandler.java:68)
at oracle.odi.ui.SnpsActionControler.handleEvent(SnpsActionControler.java:75)
at oracle.ide.controller.IdeAction.performAction(IdeAction.java:529)
at oracle.ide.controller.IdeAction.actionPerformedImpl(IdeAction.java:884)
at oracle.ide.controller.IdeAction.actionPerformed(IdeAction.java:501)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at javax.swing.AbstractButton.doClick(AbstractButton.java:357)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:809)
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:850)
at java.awt.Component.processMouseEvent(Component.java:6297)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3275)
at java.awt.Component.processEvent(Component.java:6062)
at java.awt.Container.processEvent(Container.java:2039)
at java.awt.Component.dispatchEventImpl(Component.java:4660)
at java.awt.Container.dispatchEventImpl(Container.java:2097)
at java.awt.Component.dispatchEvent(Component.java:4488)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4575)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4236)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4166)
at java.awt.Container.dispatchEventImpl(Container.java:2083)
at java.awt.Window.dispatchEventImpl(Window.java:2489)
at java.awt.Component.dispatchEvent(Component.java:4488)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:674)
at java.awt.EventQueue.access$400(EventQueue.java:81)
at java.awt.EventQueue$2.run(EventQueue.java:633)
at java.awt.EventQueue$2.run(EventQueue.java:631)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
at java.awt.EventQueue$3.run(EventQueue.java:647)
at java.awt.EventQueue$3.run(EventQueue.java:645)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:644)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Caused by: org.apache.bsf.BSFException: unable to load language: beanshell
at org.apache.bsf.BSFManager.loadScriptingEngine(BSFManager.java:718)
at com.sunopsis.dwg.codeinterpretor.SnpCodeInterpretor.loadEngine(SnpCodeInterpretor.java:85)
at com.sunopsis.dwg.codeinterpretor.SnpCodeInterpretor.<init>(SnpCodeInterpretor.java:75)
at com.sunopsis.dwg.codeinterpretor.SnpCodeInterpretor.getInstance(SnpCodeInterpretor.java:184)
... 45 more
After digging around for about a day on this issue, I brazenly tried running ODI as the root user on the off chance that this was a permissions issue. I started ODI from the command line (using 'bash odi') for greater verbosity, and it loaded without the error mentioned above. Something gave me the impression that this wasn't a permissions issue, but one related to the user settings.
To rectify the issue, I removed my user's odi settings folder (renaming it, for safety):
mv ~/.odi ~/.backup_odi
Then I started ODI from the terminal under my own user (i.e. not root) - there were no errors! None of my connections were available in the new settings folder though. This I fixed by closing ODI and entering the following:
cp ~/.backup_odi/oracledi/snps_login_work.xml ~/.odi/oracledi/
If anybody else encounters this issue, I hope you find this post quicker than it took me to fix it!
org.apache.bsf.BSFException: unable to load language: beanshell
The exception was thrown because bsh-2.Ob4.jar was not in the classpath and it is a dependent jar of bsf.jar

Configuring Teamcity's logging behaviour

I'm using Teamcity 5 for our CI environment. It's a great tool, but I've been struggling with one thing: the stdout_yyyyMMdd.log file in the \TeamCity\logs folder grows to ridiculous sizes. Is there a way to turn it off?
Places I've looked so far:
Jetbrains: Nothing on stdout;
Google for "tomcat stdout logs": the first few links don't really address the issue.
Edit:
At KIR's suggestion, I actually looked to see what's in stdout. It's the same exception message repeated over and over again:
[2010-12-01 08:57:21,268] WARN - jetbrains.buildServer.SERVER - java.io.FileNotFoundException: <...Path...>\.BuildServer\system\caches\search\_8p.prx (The system cannot find the file specified)
[2010-12-01 08:57:21,315] ERROR - erverSide.search.SearchService - SearchService.enqueueHistory
java.io.FileNotFoundException: <...Path...>\.BuildServer\system\caches\search\_8p.prx (The system cannot find the file specified)
at java.io.RandomAccessFile.open(Native Method)
at java.io.RandomAccessFile.<init>(Unknown Source)
at org.apache.lucene.store.SimpleFSDirectory$SimpleFSIndexInput$Descriptor.<init>(SimpleFSDirectory.java:78)
at org.apache.lucene.store.SimpleFSDirectory$SimpleFSIndexInput.<init>(SimpleFSDirectory.java:108)
at org.apache.lucene.store.SimpleFSDirectory.openInput(SimpleFSDirectory.java:65)
at org.apache.lucene.index.SegmentReader$CoreReaders.<init>(SegmentReader.java:132)
at org.apache.lucene.index.SegmentReader.get(SegmentReader.java:638)
at org.apache.lucene.index.SegmentReader.get(SegmentReader.java:599)
at org.apache.lucene.index.DirectoryReader.<init>(DirectoryReader.java:104)
at org.apache.lucene.index.ReadOnlyDirectoryReader.<init>(ReadOnlyDirectoryReader.java:27)
at org.apache.lucene.index.DirectoryReader$1.doBody(DirectoryReader.java:74)
at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:704)
at org.apache.lucene.index.DirectoryReader.open(DirectoryReader.java:69)
at org.apache.lucene.index.IndexReader.open(IndexReader.java:476)
at org.apache.lucene.index.IndexReader.open(IndexReader.java:314)
at jetbrains.buildServer.serverSide.search.SearchService.getIndexSearcher(SearchService.java:451)
at jetbrains.buildServer.serverSide.search.SearchService.enqueueHistory(SearchService.java:515)
at jetbrains.buildServer.serverSide.search.BackgroundIndexer.run(BackgroundIndexer.java:32)
at java.lang.Thread.run(Unknown Source)
Any idea what this file is?
If you're running TC on unix you could use logrotate: http://linuxcommand.org/man_pages/logrotate8.html (Obviously, this is a workaround but it should be effective.)
This guy has a windows equivalent that may do the trick too: http://www.datori.org/?p=7
Remove .BuildServer\system\caches\search directory and restart TeamCity. May be this would help.
The problem is caused by someone or something deleting the Lucene Index in Team city.
Everytime you hit a page after this it will log in stdout that it couldnt find the file.
If you clear out the whole folder which should be
%USERPROFILE%.BuildServer\system\caches\search\
See http://confluence.jetbrains.net/display/TCD5/TeamCity+Data+Directory for more information on where to find the folder.
And restart Teamcity it will recreate the index on start up and stop logging the error message.
Oh and search should start working again too.

Resources