Codenameone build server error java.lang.NullPointerException - java

Dev Platform: Mac OSX
IDE: NetBeans
Targeted Device: Android
Topic: Build Server Issues
Details:
I resurrected an old CN1 project that I last sent to the build server ~2 years ago. I have spent a good amount of time doing extensive refactoring and it works great on the simulator. Note that the app uses a custom cn1lib, where I have a fair amount of code. The simulator seems good with this.
However, when I try to "send Android build" to the build server, it gets a java.lang.NullPointerException. Just to make sure that my Android certs were correct, I sent your "KitchenSink" demo to the build server and all worked well. But no good with my app. I'm not sure what to do from here. Any suggestions?
The exception on my app, when sent to the build server looks like this:
java.lang.NullPointerException
at com.codename1.build.client.CodeNameOneBuildTask.execute(CodeNameOneBuildTask.java:330)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
at sun.reflect.GeneratedMethodAccessor79.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:435)
at org.apache.tools.ant.Target.performTasks(Target.java:456)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1405)
at org.apache.tools.ant.Project.executeTarget(Project.java:1376)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1260)
at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:286)
at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:555)
at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:153)
BUILD FAILED (total time: 2 seconds)
The error also references this section of the build.xml file:
<target name="build-for-android-device" depends="clean,copy-android-override,copy-libs,jar,clean-override">
<codeNameOne
jarFile="${dist.jar}"
displayName="${codename1.displayName}"
packageName = "${codename1.packageName}"
mainClassName = "${codename1.mainName}"
version="${codename1.version}"
icon="${codename1.icon}"
vendor="${codename1.vendor}"
subtitle="${codename1.secondaryTitle}"
targetType="android"
keystoreAlias="${codename1.android.keystoreAlias}"
keystore="${codename1.android.keystore}"
certPassword="${codename1.android.keystorePassword}"
automated="${automated}"
/>
</target>
Thanks in advance for any help.

Okay, I resolved the problem. It seems that I had some obsolete cn1lib files in my lib directory. These I had later consolidated into a single cn1lib file. I suspect that they were conflicting.
All seems good now. Sorry for the false alarm!

(Initial problem was solved, I'm posting here just for anyone who may suffer from similar problem.)
I recently encountered the same error message on Windows - Eclipse Oxygen - CN4.0
build.xml:287: java.lang.NullPointerException
at com.codename1.build.client.CodeNameOneBuildTask.execute(CodeNameOneBuildTask.java:337)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
at sun.reflect.GeneratedMethodAccessor192.invoke(Unknown Source)
...
...
In my case it turns out that the icon file was not 512x512. Replacing the icon with another .png solved the problem. Debug message provided doesn't tell much about the cause, so it's like a trial and error.
Edit: Another symptom was failure to CN1 settings -> Basics if the icon was damaged

Related

Weblogic Error - Could not initialize class weblogic.jndi.Environment

When I try to debug a WebApp configured to run with Oracle Weblogic Server from NetBeans 10, I always get the following error:
There's not even complicated steps, I just open my project and then right-click / Debug.
java.lang.NoClassDefFoundError: Could not initialize class weblogic.jndi.Environment
at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:117)
at java.naming/javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:730)
at java.naming/javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:305)
at java.naming/javax.naming.InitialContext.init(InitialContext.java:236)
at java.naming/javax.naming.InitialContext.<init>(InitialContext.java:208)
at weblogic.management.remote.common.ClientProviderBase.makeConnection(ClientProviderBase.java:178)
at weblogic.management.remote.common.ClientProviderBase.newJMXConnector(ClientProviderBase.java:84)
at java.management/javax.management.remote.JMXConnectorFactory.newJMXConnector(JMXConnectorFactory.java:378)
at org.netbeans.modules.j2ee.weblogic9.WLConnectionSupport$1.call(WLConnectionSupport.java:182)
at org.netbeans.modules.j2ee.weblogic9.WLConnectionSupport.executeAction(WLConnectionSupport.java:112)
at org.netbeans.modules.j2ee.weblogic9.WLConnectionSupport.executeAction(WLConnectionSupport.java:161)
at org.netbeans.modules.j2ee.weblogic9.deploy.WLDeploymentManager.getTargets(WLDeploymentManager.java:632)
at org.netbeans.modules.j2ee.deployment.impl.ServerInstance.getTargetMap(ServerInstance.java:560)
at org.netbeans.modules.j2ee.deployment.impl.ServerInstance.getTargets(ServerInstance.java:518)
at org.netbeans.modules.j2ee.deployment.impl.ServerString.getTargets(ServerString.java:117)
at org.netbeans.modules.j2ee.deployment.impl.ServerString.toTargets(ServerString.java:155)
at org.netbeans.modules.j2ee.deployment.impl.TargetServer.init(TargetServer.java:146)
at org.netbeans.modules.j2ee.deployment.impl.TargetServer.undeploy(TargetServer.java:771)
at org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.undeploy(Deployment.java:337)
at org.netbeans.modules.j2ee.ant.Undeploy.execute(Undeploy.java:92)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at jdk.internal.reflect.GeneratedMethodAccessor99.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
at org.apache.tools.ant.Task.perform(Task.java:350)
at org.apache.tools.ant.Target.execute(Target.java:449)
at org.apache.tools.ant.Target.performTasks(Target.java:470)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1388)
at org.apache.tools.ant.Project.executeTarget(Project.java:1361)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:261)
at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:574)
at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:128)
BUILD FAILED (total time: 0 seconds)
My environment is:
NetBeans 10 running on Java 10.0.2+13
Windows 10
Weblogic Server 10.3.6 running on Java 1.6.0.45
How to fix?
For Eclipse IDE, the solution for me was to switch from JDK11 to JDK8 on the client.
I've decided to post this question because it took me the whole morning to find a solution... especially because the most common reason for java.lang.NoClassDefFoundError: Could not initialize class weblogic.jndi.Environment to occur, is when weblogic.jar and wlfullclient.jar aren't being properly located by any of IDE, WebApp, or WL.
To fix the issue just run your project using NetBeans 8.2, this seems to be a bug at NB10 only.
Also, don't even try running it on NB11, NB12, NB12.1 nor NB12.2. Currently, Java EE plugin for those versions is discontinued so you'll not even be able to add WL to your server list.
The reason it broke in NB10 is that they started removing Java 8 vendor features from it, And the reason it doesn't even is possible to add WL to NB11 > is because Oracle removed JDK8 features for the followed releases of Java... NB integration is not under Apache Licence so they just aren't giving support to it now (is an issue that they refused to fix). However, with a bit of risk, it can be added manually.

[Eclipse not starting]:An error has occured. See the log file null

I'm unable to get my Eclipse Luna running. It was working fine till now and suddenly crashed. Now when i try to start it, I get the error saying:
An error has occured. See the log file null
I tried launching eclipse from terminal and also tried to delete the metadata folder from my workspace but nothing helped me.
Here is the crash log:
org.osgi.framework.BundleException: Error initializing container.
at org.eclipse.osgi.container.SystemModule.init(SystemModule.java:93)
at org.eclipse.osgi.internal.framework.EquinoxBundle$SystemBundle.init(EquinoxBundle.java:209)
at org.eclipse.osgi.internal.framework.EquinoxBundle$SystemBundle.init(EquinoxBundle.java:201)
at org.eclipse.osgi.launch.Equinox.init(Equinox.java:168)
at org.eclipse.core.runtime.adaptor.EclipseStarter.startup(EclipseStarter.java:296)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:231)
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 org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
Caused by: java.lang.ExceptionInInitializerError
at org.eclipse.osgi.internal.framework.EquinoxBundle$SystemBundle$EquinoxSystemModule.initWorker(EquinoxBundle.java:137)
at org.eclipse.osgi.container.SystemModule.init(SystemModule.java:83)
... 12 more
Caused by: java.security.ProviderException: setSeed() failed
at sun.security.provider.NativePRNG$RandomIO.implSetSeed(NativePRNG.java:458)
at sun.security.provider.NativePRNG$RandomIO.access$300(NativePRNG.java:329)
at sun.security.provider.NativePRNG.engineSetSeed(NativePRNG.java:212)
at java.security.SecureRandom.getDefaultPRNG(SecureRandom.java:209)
at java.security.SecureRandom.<init>(SecureRandom.java:190)
at org.eclipse.osgi.internal.framework.UniversalUniqueIdentifier.computeNodeAddress(UniversalUniqueIdentifier.java:127)
at org.eclipse.osgi.internal.framework.UniversalUniqueIdentifier.<clinit>(UniversalUniqueIdentifier.java:35)
... 14 more
Caused by: java.io.IOException: Operation not permitted
at java.io.FileOutputStream.writeBytes(Native Method)
at java.io.FileOutputStream.write(FileOutputStream.java:313)
at sun.security.provider.NativePRNG$RandomIO.implSetSeed(NativePRNG.java:456)
... 20 more
It seems you're using Solaris? This OS has an alternative entropy source called EGD, which needs special protocol to write to, which Sun JDK does not implement...
Can you try adding -Djava.security.egd=/dev/random to the vmargs section of your eclipse.ini.
If you still see the same issue. Make sure your user can write to /dev/random.
I fixed it myself. Few files in my security folder /jre/lib/security had got messed up.
Downloaded latest Java Cryptography Extension (JCE) and put the jars (Download US_export_policy.jar and local_policy.jar) in the security folder. My eclipse works fine now.

MyEclipse 2015 WebSphere 6.1 'Multiple problems have occurred' when server starts

I have a WebSphere 6.1 server with 3 EARs that I've recently imported and migrated in ME2015. Whenever I start my server, I'm given the following error.
(Error message that is repeated is: com.ibm.websphere.management.cmdframework.CommandMgr.getCommandMgr(Lcom/ibm/websphere/management/AdminClient;)Lcom/ibm/websphere/management/cmdframework/CommandMgr;)
The error seems to be of no consequence, because my server and apps start up and work fine. I would still like to see what the problem is. Google hasn't really yielded any results for me.
Contents of the .log file, same for each occurrence of this error:
!ENTRY com.genuitec.eclipse.blue.websphere.core 4 0 2015-06-08 09:20:41.131
!MESSAGE com.ibm.websphere.management.cmdframework.CommandMgr.getCommandMgr(Lcom/ibm/websphere/management/AdminClient;)Lcom/ibm/websphere/management/cmdframework/CommandMgr;
!STACK 0
java.lang.NoSuchMethodError: com.ibm.websphere.management.cmdframework.CommandMgr.getCommandMgr(Lcom/ibm/websphere/management/AdminClient;)Lcom/ibm/websphere/management/cmdframework/CommandMgr;
at com.genuitec.eclipse.blue.websphere.admin.proxy.WebSphereAdminClientProxy.getApplicationState(WebSphereAdminClientProxy.java:407)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.genuitec.eclipse.blue.websphere.admin.WebsphereAdminFactory$PassThroughProxyHandler.invoke(WebsphereAdminFactory.java:161)
at com.genuitec.eclipse.blue.websphere.admin.WebsphereAdminFactory$PassThroughProxyHandler$1.run(WebsphereAdminFactory.java:127)
at com.genuitec.eclipse.blue.websphere.admin.internal.WebSphereAdminThread.run(WebSphereAdminThread.java:55)
From your information, this is a bug in the MyEclipse code. I'll raise that. Sorry about the error message but it doesn't affect your code in any way. MyEclipse is just trying to check the start/stop state of the modules that are deployed. Looks like the method signatures changed in later releases of WebSphere.
If you're on the CI stream, that will be the quickest way of getting a fix, though I can't say exactly when that will be.

JBoss starting with java.io.FileInputStream Error when initializing AbstractKernelController

We have a troublesome JBoss server that recently displayed a new error and refuses to load our web application. No changes have been made to any configuration files - the error just appeared suddenly.
Read all of the JBoss startup,classloader, and bootstrap issues and followed the remedy at: Error starting jboss server but the solutions did not work for us. I apologize for my lack of knowledge and if this is an easy fix. We appreciate the assistance.
Here is the stacktrace:
ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] (Thread-2) Error installing to create: name=b81232b8 aliases=[ProfileKey#421c8a02[domain=default, server=default, name=farm])
state=Configured mode=Manual requiredState=Installed: java.lang.RuntimeException: org.jboss.xb.binding.JBossXBException: Failed to parse source: java.io.FileInputStream#4d4352b2
at org.jboss.system.server.profileservice.repository.clustered.local.AbstractContentMetadataPersister.load(AbstractContentMetadataPersister.java:76)
at org.jboss.system.server.profileservice.repository.clustered.local.AbstractLocalContentManager.<init>(AbstractLocalContentManager.java:139)
at org.jboss.system.server.profileservice.repository.clustered.local.file.FilesystemLocalContentManager.<init>(FilesystemLocalContentManager.java:68)
at org.jboss.system.server.profileservice.repository.clustered.local.file.FilesystemLocalContentManagerFactory.getLocalContentManager(FilesystemLocalContentManagerFactory.java:98)
at org.jboss.system.server.profileservice.repository.clustered.ClusteredDeploymentRepository.create(ClusteredDeploymentRepository.java:201)
at org.jboss.system.server.profileservice.repository.clustered.ClusteredDeploymentRepository.load(ClusteredDeploymentRepository.java:242)
at org.jboss.profileservice.repository.legacy.DelegateProfile.create(DelegateProfile.java:138)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccesorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
...
The solution was laughably simple. We cleared the auto-generated jboss/data directory and it fixed everything. Some binding files must have been corrupted and a clean restart had things working again.

Unsatisfied Link Error BluetoothStackBlueSoleil

I'm trying to use bluetooth for a java application, I'm on Windows 7 64bit.
I'm following this example
http://luugiathuy.com/2011/02/android-java-bluetooth/
Turned out I had problem with the bluecove.jar proposed on that site, so I found this thread
http://code.google.com/p/bluecove/issues/detail?id=109
telling me to get this .jar:
http://snapshot.bluecove.org/distribution/download/2.1.1-SNAPSHOT/2.1.1-SNAPSHOT.62/
Alright then!
But now, I'm facing a new error (yaay...):
Exception in thread "Thread-2" java.lang.UnsatisfiedLinkError: com.intel.bluetooth.BluetoothStackBlueSoleil.getLibraryVersion()I
at com.intel.bluetooth.BluetoothStackBlueSoleil.getLibraryVersion(Native Method)
at com.intel.bluetooth.BlueCoveImpl.setBluetoothStack(BlueCoveImpl.java:964)
at com.intel.bluetooth.BlueCoveImpl.detectStack(BlueCoveImpl.java:502)
at com.intel.bluetooth.BlueCoveImpl.access$500(BlueCoveImpl.java:69)
at com.intel.bluetooth.BlueCoveImpl$1.run(BlueCoveImpl.java:1044)
at java.security.AccessController.doPrivileged(Native Method)
at com.intel.bluetooth.BlueCoveImpl.detectStackPrivileged(BlueCoveImpl.java:1042)
at com.intel.bluetooth.BlueCoveImpl.getBluetoothStack(BlueCoveImpl.java:1035)
at javax.bluetooth.LocalDevice.getLocalDeviceInstance(LocalDevice.java:75)
at javax.bluetooth.LocalDevice.getLocalDevice(LocalDevice.java:95)
at BTThread.waitForConnection(BTThread.java:35)
at BTThread.run(BTThread.java:23)
at java.lang.Thread.run(Unknown Source)
So.. would anyone have any idea why?
The BluetoothStackBlueSoleil seems to be in the .jar I downloaded, so I don't get the unstatisfied link error...
Thanks for any help
I solved my problem by removing Bluesoleil from my computer and installing different Bluetooth drivers.
I think the problem was that there was native methods that you needed to build. You have to compile the native code from the JNI folder using the Android NDK. ndk-build etc
Just in case you see the problem again.

Categories