Java Service Wrapper on Raspberry PI - raspberry-pi

I'm trying the use the Tanuki Java Service Wrapper.
The hardware I'm using is a Raspberry Pi with the Raspbian wheezy distribution.
(see http://www.raspberrypi.org/downloads)
I've tried the Wrapper 32-bit armel release, but get problems with reading the libwrapper.so.
INFO | jvm 1 | 2013/04/24 20:15:34 | WrapperManager: Initializing...
INFO | jvm 1 | 2013/04/24 20:15:42 | WrapperManager Debug: Attempt to load native library with name: libwrapper.so Result: /usr/iHome/lib/libwrapper.so: /usr/iHome/lib/libwrapper.so: cannot open shared object file: No such file or directory
I've also tried the armhf release, since it seems that "apt-get java-7-openjdk", installed the jdk-armhf version, but there I did get "Segmentation fault" when starting the Wrapper.
Some extra info:
pi#raspberrypi /usr/lib/jvm $ java -version
java version "1.7.0_07" OpenJDK Runtime Environment (IcedTea7 2.3.2)
(7u7-2.3.2a-1+rpi1)OpenJDK Zero VM (build 22.0-b10, mixed mode)
pi#raspberrypi /usr/lib/jvm $ ls -altr
total 28
-rw-r--r-- 1 root root 2437 Sep 26 2012 .java-1.7.0-openjdk-armhf.jinfo
lrwxrwxrwx 1 root root 20 Sep 26 2012 java-1.7.0-openjdk-armhf -> java-7-> openjdk-armhf
drwxr-xr-x 3 root root 4096 Jan 17 20:59 java-7-openjdk-common
drwxr-xr-x 5 root root 4096 Jan 17 21:00 java-7-openjdk-armhf
drwxr-xr-x 4 root root 4096 Jan 17 21:00 .
drwxr-xr-x 74 root root 12288 Apr 24 20:32 ..
pi#raspberrypi /usr/lib/jvm $ uname -a
Linux raspberrypi 3.2.27+ #250 PREEMPT Thu Oct 18 19:03:02 BST 2012 armv6l GNU/Linux
Thanks in advance,
BR, Rob

This issue has already been discussed on the Java Service Wrapper user mailing list in this thread, but here is the summary of the resolution.
The armhf version of the Wrapper is being built on an armv7 platform and apparently this is not compatible for armv6 hard float architectures. When using the armel version of the Wrapper with an armhf jvm then loading the native library fails due to the target mismatch.
The suggested solutions were to either use an armel jvm with the armel version of the Wrapper (since armv6 boards should support both) or to create the armhf binary for his board himself.
For the second suggestion, the pre-release (from the sourceforge project site of the Wrapper) package has to get downloaded, extracted and the following shell script executed:
./build32.sh release
With the created binary the Wrapper was able to launch successfully. (the build process requires a JDK and Apache-Ant installed)
Cheers,

Related

Build AOSP on MacOS M1

I wanted to get my feet wet with AOSP on my MacOS M1 (ARM64) with Big Sur, but it looks like there is no configuration build for this host.
When I look under build/soong/cc/config I only see one Darwin related file, namely x86_darwin_host.go.
With the latest aosp release, namely android-11.0.0_r35 I'm able to build a generic arm64 target, but the resulting emulator does not boot. Configuration shows that the HOST is detected as x86_64, in fact binaries generated are in x86_64 format.
total 0
drwxr-xr-x 3 salvatorebenedetto staff 102 Apr 10 15:21 common
drwxr-xr-x 9 salvatorebenedetto staff 374 Apr 10 15:21 darwin-x86
➜ aosp file out/host/darwin-x86/lib64/libc++.dylib
out/host/darwin-x86/lib64/libc++.dylib: Mach-O 64-bit dynamically linked shared library x86_64
➜ aosp
This is what I get when booting the emulator from the kernel
RAMDISK: lz4 image found at block 0
RAMDISK: lz4 decompressor not configured!
Invalid ramdisk decompression routine. Select appropriate config option.
Kernel panic - not syncing: Could not decompress initial ramdisk image.
CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.18.94+ #1
Hardware name: ranchu (DT)
Call trace:
[<ffffffc00008a590>] dump_backtrace+0x0/0x128
[<ffffffc00008a6cc>] show_stack+0x14/0x1c
[<ffffffc0005ca064>] dump_stack+0x80/0xa4
[<ffffffc0005c95a0>] panic+0xe8/0x228
[<ffffffc00074ba34>] rd_load_image+0x2fc/0x5e0
[<ffffffc00074be30>] initrd_load+0x50/0x2cc
[<ffffffc00074b47c>] prepare_namespace+0xd8/0x1ac
[<ffffffc00074ad04>] kernel_init_freeable+0x1bc/0x1dc
[<ffffffc0005c8150>] kernel_init+0x10/0xf4
Rebooting in 5 seconds..Reboot failed -- System halted
Any idea how I can debug what is wrong with the initrd image?
I think this should help, it has a peace specific for setup the missing sdk 10.15.
Good luck, let us know if it works to you!

VS code setup for Java remote development

few weeks back vscode made JDK-11 mandatory for java development in VS-code
The Eclipse Platform has decided to require Java 11 as the minimum requirement for its September 2020 release. See https://www.eclipse.org/lists/eclipse-pmc/msg03821.html.
Because vscode-java depends on the Eclipse JDT.LS, the same requirement applies to vscode-java but on a more agressive timeline: vscode-java usually consumes JDT.LS builds that depend on bleeding edge JDT features, effectively shipping pre-release versions of Eclipse Platform/JDT. As of July 22nd, 2020, Java 11 is now required for running vscode-java.
source: vscode
i am using remote ssh extension to connect to my remote VM (ubuntu on vagrant).
when i open Java file in remote-ssh ,i am getting error saying install Java 11.
i have the java 11 already in my vagrant.
i can see the following in my VM
$ update-java-alternatives -l
java-1.11.0-openjdk-amd64 1111 /usr/lib/jvm/java-1.11.0-openjdk-amd64
java-1.8.0-openjdk-amd64 1081 /usr/lib/jvm/java-1.8.0-openjdk-amd64
vagrant#vagrant:/usr/lib/jvm
$ ls
total 24K
drwxr-xr-x 4 root root 4.0K Feb 21 2020 .
drwxr-xr-x 138 root root 4.0K Aug 13 17:57 ..
lrwxrwxrwx 1 root root 25 Feb 20 2019 default-java -> java-1.11.0-openjdk-amd64
lrwxrwxrwx 1 root root 21 Jan 15 2020 java-1.11.0-openjdk-amd64 -> java-11-openjdk-amd64
-rw-r--r-- 1 root root 2.0K Jan 15 2020 .java-1.11.0-openjdk-amd64.jinfo
drwxr-xr-x 7 root root 4.0K Feb 21 2020 java-11-openjdk-amd64
lrwxrwxrwx 1 root root 20 Jan 17 2020 java-1.8.0-openjdk-amd64 -> java-8-openjdk-amd64
-rw-r--r-- 1 root root 2.7K Jan 17 2020 .java-1.8.0-openjdk-amd64.jinfo
drwxr-xr-x 7 root root 4.0K Feb 21 2020 java-8-openjdk-amd64
all my java projects depends on java-8 so just to work with in vscode , i need Java-11.
please help me to setup this Env.
The easiest is to change your java config with the following command:
sudo alternatives --config java
and choose the Java version you want active.

postgres 9.4 can't find compiled pg_rewind library

I'm running Postgres 9.4 installed on Ubuntu 16.04.3. Postgres was installed using apt-get, I downloaded the sources and dependencies with apt-get too. I downloaded pg_rewind REL9_4_STABLE branch and built it. When I try to run my pg_rewind command I get the following:
The servers diverged at WAL position 0/6148D50 on timeline 1.
Rewinding from Last common checkpoint at 0/5000098 on timeline 1
SQL command failed
CREATE OR REPLACE FUNCTION rewind_support.rewind_support_ls_dir(text, boolean) RETURNS SETOF text AS '$libdir/pg_rewind_support' LANGUAGE C STRICT;
ERROR: could not access file "$libdir/pg_rewind_support": No such file or directory
Failure, exiting
I found the pg_rewind_support.so library file and I placed it in the locations returned by pg_config --libdir and --pkglibdir with no success. I even created a copy without .so extension.
$ls -la $(pg_config --pkglibdir)/pg_rewind_support*
-rw-r--r-- 1 root root 18768 Jul 16 17:59 /usr/lib/postgresql/9.4/lib/pg_rewind_support
-rw-r--r-- 1 root root 18768 Jul 16 17:50 /usr/lib/postgresql/9.4/lib/pg_rewind_support.so
$ls -la $(pg_config --libdir)/pg_rewind_support*
-rw-r--r-- 1 root root 18768 Jul 16 17:59 /usr/lib/x86_64-linux-gnu/pg_rewind_support
-rw-r--r-- 1 root root 18768 Jul 16 17:44 /usr/lib/x86_64-linux-gnu/pg_rewind_support.so
Any ideas how can I make my apt-get installed Postgres recognize the pg_rewind library? I don't want to end up running in production a full postgres that was packaged and built in-house.
In working through this with the OP, the steps to build pg_rewind were:
Download the appropriate PostgreSQL 9.4.18 tarball, unpack.
Download pg_rewind, move into contrib/
Configure PostgreSQL to match the directory layout that Debian/Ubuntu uses:
./configure --libdir=/usr/lib/postgresql/9.4/lib --bindir=/usr/lib/postgresql/9.4/bin
Do a "make" on PostgreSQL.
Do a "make" and a "sudo make install" on pg_rewind.
pg_rewind must be installed on both the source system (so that the .so is available there) and on the target system (so the pg_rewind binary is available there).

Where are the iOS frameworks binaries located in the filesystem?

I'm kind of confused about frameworks on iOS. I think they are basically a directory containing a dynamic library, headers and resources.
But in my device the frameworks directories in System/Library/Frameworks don't contain the dynamic library. How is this possible? Shouldn't it be present to be loaded in memory when the application requiring it is launched?
The binaries no longer exist on-device (and have not since iOS 3.1): Apple has merged them all into one large mmap()'ed cache file, to make app launch a bit more efficient. As the pages usually never change, the kernel can effectively share them between every running image. You can still use dlopen() on files held within the cache, as dyld short-circuits file lookup when the given library exists in the cache.
The cache file is in /System/Library/Caches/com.apple.dyld, and is named after the architecture (armv6 or armv7). The libraries within can be extracted using dsc_extractor or KennyTM's dyld_decache, available in this repository, but once extracted they can't actually be loaded into memory properly (as they all effectively get their symbol tables merged in the cache.)
There's a bit of a better (though older and less informed, more in-depth) write-up here: http://blog.howett.net/2009/09/cache-or-check/.
I've noticed this, too. Strange. I can't explain to you "where they are", but I have observed, for example:
If I list out a (private) framework directory:
iPhone4:/System/Library/PrivateFrameworks/BluetoothManager.framework root# ls -alt
total 8
lrwxr-xr-x 1 root wheel 28 Nov 4 2011 CodeResources -> _CodeSignature/CodeResources
drwxr-xr-x 3 root wheel 170 Nov 2 2011 ./
drwxr-xr-x 2 root wheel 102 Nov 2 2011 _CodeSignature/
-rw-r--r-- 1 root wheel 740 Nov 2 2011 Info.plist
drwxr-xr-x 170 root wheel 5814 Dec 31 2007 ../
iPhone4:/System/Library/PrivateFrameworks/BluetoothManager.framework root# ls -alt _CodeSignature/
total 0
drwxr-xr-x 3 root wheel 170 Nov 2 2011 ../
drwxr-xr-x 2 root wheel 102 Nov 2 2011 ./
-rw-r--r-- 1 root wheel 1222 Nov 2 2011 CodeResources
You don't see a BluetoothManager.framework/BluetoothManager dylib file. However, this code does actually work to dynamically open that framework, as if that file exists:
handle = dlopen("/System/Library/PrivateFrameworks/BluetoothManager.framework/BluetoothManager", RTLD_LAZY);
Using the find command from the root filesystem ("/") location also finds no file on the device named BluetoothManager.
I know that's probably not the answer you're looking for, but depending on why you want to know, maybe it helps?

Problem provisioning iPhone with 3.0.1 after it worked before

After I installed iPhone OS 3.0.1 on my iPhone I followed the instructions on Apple's website (see this question), created the symbolic links, and everything worked fine. That is, I could test my application on the iPhone.
Now it stopped working. I verified that the symbolic link is still there. I also tried deleting and recreating it and I also tried naming it 3.0.1 (7A400) instead of just 3.0.1. None of this worked, my iPhone is still showing up as "Could not support development" in the Xcode organizer.
Here are the contents of /Developer/Platforms/iPhoneOS.platform/Device Support on my computer:
Macintosh:~ thm$ ls -la /Developer/Platforms/iPhoneOS.platform/DeviceSupport/
total 40
drwxrwxr-x 12 root admin 408 13 Aug 22:42 .
drwxrwxr-x 7 root admin 238 22 Jun 20:43 ..
lrwxr-xr-x 1 root admin 11 21 Jun 20:17 2.0 (5A345) -> 2.0 (5A347)
drwxrwxr-x 5 root admin 170 21 Jun 20:17 2.0 (5A347)
lrwxr-xr-x 1 root admin 11 21 Jun 20:17 2.0.1 (5B108) -> 2.0 (5A347)
lrwxr-xr-x 1 root admin 11 21 Jun 20:17 2.0.2 (5C1) -> 2.0 (5A347)
drwxrwxr-x 5 root admin 170 21 Jun 20:17 2.1
lrwxr-xr-x 1 root admin 3 21 Jun 20:17 2.1.1 -> 2.1
drwxrwxr-x 5 root admin 170 21 Jun 20:17 2.2
drwxrwxr-x 5 root admin 170 21 Jun 20:17 2.2.1
drwxrwxr-x 5 root admin 170 21 Jun 20:17 3.0 (7A341)
lrwxr-xr-x 1 root admin 12 13 Aug 22:42 3.0.1 -> 3.0 (7A341)/
I wonder if this is caused by my recent upgrade to Mac OS 10.5.8? I'm not sure whether I tested anything on the iPhone after the upgrade.
Did anybody else have a similar problem? Any ideas what might be causing this?
Any help is greatly appreciated.
Try starting with the simple stuff. First, have you tried restarting xcode, your Mac, and the iPhone?
Have you try this? Work for me.
http://adcdownload.apple.com/iphone/iphone_sdk_3.0__final/iphone_os_3.0.1_advisory.pdf