Comments (3)
Hey
I also encountered the same warning on several native host systems. As you mentioned the crash is not relatable to lib musl nor glibc (Alpine or not Alpine) - I guess it happens somewhere in the J2V8 library. As always: Wild guessing without a stacktrace ;)
I am not satisfied with the whole J2V8 solution so I wrote a TCP based solution in the last days. TCP and gRPC are now Angular official ways to interact with Angular Universal, so this is the way to go/the future proof way.
I pushed a first runnable version that needs some further love (Better documentation, support for lazy modules and better Node.js error handling).
Is it possible for you to give it a try? I would also be interested in a Docker image (Image with Java 8+ and Node.js).
You can find more information in the README.md
and this image: https://raw.githubusercontent.com/swaechter/angularj-universal/master/doc/AngularJ_Universal_HighLevelOverview.png
from angularj-universal.
Sorry for the delay, new year and such.
So I solved the issue by building an imagine with the right binaries for j2v8 built for the alpine image.
Then excluding the packaged one
<dependency>
<groupId>ch.swaechter</groupId>
<artifactId>angularj-universal-renderer-v8</artifactId>
<version>0.0.3</version>
<exclusions>
<exclusion>
<groupId>com.eclipsesource.j2v8</groupId>
<artifactId>j2v8_linux_x86_64</artifactId>
</exclusion>
</exclusions>
</dependency>
I'll be happy to try the TCP version, but your 0.0.4-SNAPSHOT does not seem to be available on maven, unless I missed some definition for a snapshot repo in the examples.
For reference, here is the dockerfile for the alpine image I'm using. I don't know if this is the right or best way of doing it, but I got sick of things so just left it when it started working.
FROM openjdk:8u181-jdk-alpine
RUN apk add --update --virtual build-dependencies wget git g++ python linux-headers alpine-sdk binutils-gold --no-cache && \
# Download and build J2V8 4.8.0
# Source: https://github.com/eclipsesource/J2V8/issues/151
mkdir /data/ && cd /data/ && git clone https://github.com/eclipsesource/J2V8.git && cd /data/J2V8/ && git checkout 0828fcd5ac2a0f4281e7a5ef913da8cd5a993ac9 && \
# Set compiler flags
export CCFLAGS="${CCFLAGS} -fPIC" CXXFLAGS="${CXXFLAGS} -fPIC" CPPFLAGS="${CPPFLAGS} -fPIC" && \
# Download and build the J2V8 specific node version
cd /data/J2V8/ && sh ./build-node.sh && \
cd /data/J2V8/jni && \
g++ -I ../node -I ../node/deps/v8 -I ../node/deps/v8/include \
-I ../node/src -I $JAVA_HOME -I $JAVA_HOME/linux \
com_eclipsesource_v8_V8Impl.cpp -std=c++11 -fPIC -shared -o /usr/lib/libj2v8_linux_x86_64.so \
-Wl,--whole-archive ../node/out/Release/obj.target/libnode.a -Wl,--no-whole-archive \
-Wl,--start-group \
../node/out/Release/obj.target/deps/v8/src/libv8_libbase.a \
../node/out/Release/obj.target/deps/v8/src/libv8_libplatform.a \
../node/out/Release/obj.target/deps/v8/src/libv8_base.a \
../node/out/Release/obj.target/deps/v8/src/libv8_nosnapshot.a \
../node/out/Release/obj.target/deps/v8/src/libv8_libsampler.a \
../node/out/Release/obj.target/deps/uv/libuv.a \
../node/out/Release/obj.target/deps/openssl/libopenssl.a \
../node/out/Release/obj.target/deps/http_parser/libhttp_parser.a \
../node/out/Release/obj.target/deps/gtest/libgtest.a \
../node/out/Release/obj.target/deps/zlib/libzlib.a \
../node/out/Release/obj.target/deps/cares/libcares.a \
-Wl,--end-group \
-lrt -z noexecstack -D NODE_COMPATIBLE=1 && \
# https://github.com/eclipsesource/J2V8/commit/67bfd09f24fece7a0eddcbb0388a572c895c4b8e
strip --strip-unneeded -R .note -R .comment /usr/lib/libj2v8_linux_x86_64.so && \
# Cleanup
apk del build-dependencies && \
rm -rf /var/cache/apk/* && \
rm -rf /data/
from angularj-universal.
Ah, glad to hear that. Where you able to figure out the exact reason like for example some JVM binary related issue or so?
As you mentioned you have to add the OSS Sonatype snapshot repository. Here is a full Maven example:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>ch.swaechter</groupId>
<artifactId>acme</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>ch.swaechter</groupId>
<artifactId>angularj-universal-renderer-tcp</artifactId>
<version>0.0.4-SNAPSHOT</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>snapshots-repo</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</project>
Keep in mind that your Docker image also needs a Node.js binary to start the Node.js mini app with the TCP server socket. You can find a working Linux-ish Java configuraiton example in the README.md
from angularj-universal.
Related Issues (20)
- Cyrillic symbols with server side rendering HOT 3
- Question: AngularJ-Universal limitations HOT 1
- Release 0.0.2 HOT 2
- feature request: Add Lazy Loading module support HOT 2
- bug: Please delete temp files HOT 2
- Once the project is imported, how can I run it? HOT 3
- No provider for InjectionToken MODULE_MAP! with lazy loading HOT 3
- Getting a login page HOT 1
- Question: How to use parameterized routes and wildcard routes HOT 10
- Does graalvm help us? HOT 5
- Implement an upcomming TCP/gRPC renderer in Angular Universal HOT 1
- How to use Angular Universal with Spring Backend HOT 4
- How to use this library with angular 6 HOT 1
- Unable to start spring boot with angularj-universal "window is not defined" HOT 1
- Rendering takes too long HOT 6
- Getting the Request server side HOT 10
- LazyModule using Socket engine HOT 2
- angular 8 not working HOT 6
- This is still alive HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angularj-universal.