Giter Site home page Giter Site logo

meteogroup / jbrotli Goto Github PK

View Code? Open in Web Editor NEW
93.0 93.0 21.0 1022 KB

The repo has been migrated to Bitbucket https://bitbucket.org/dtnse/jbrotli/src/master/ and archived

License: Apache License 2.0

CMake 0.40% Shell 0.53% Java 43.48% C++ 7.86% C 7.41% Batchfile 0.47% HTML 34.68% Common Lisp 2.41% Roff 2.74%

jbrotli's People

Contributors

nitram509 avatar rdblue avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jbrotli's Issues

All responses truncated to exactly 8192 bytes

Possibly related to #14

I'm running into an issue where using the provided BrotliFilter with default settings will cause all responses to be truncated to a Content-Length of exactly 8192 bytes.

If you adjust the parameters, even setting the compression quality to 0 still causes all routes that match that filter to be truncated.

I've looked through the jbrotli source and I can't see what could be causing this, but there aren't any headers being applied on my own end and the output is normal when the filter is not in use or isn't applied to a route.

Is there any known reason why this could be happening?

Create a multi-architecture jar

Have you thought about creating a multi-architecture jar and at init time look at the current architecture and load that native library?

zstd-jni and lz4-java do this. This turns it into one big jar instead of several jars. This in turn simplifies releases of applications that use jbrotli.

For the furture, for unsupported platforms, we could use the java decoder implementation that has surfaced in the brotli repo. Would be a nice fallback.

Bad Apache HttpClient example

What I'm talking about is this file.

The example doesn't just unnecessarily implement things like HttpRequestInterceptor and HttpResponseInterceptor, it will actually disable Apache HttpClient's built-in content encoding support, namely gzip and deflate.

This is all you need to do:

final LinkedHashMap<String, InputStreamFactory> contentDecoderMap = new LinkedHashMap<>();
contentDecoderMap.put("br", new InputStreamFactory() {
	@Override
	public InputStream create(InputStream inStream) throws IOException {
		return new BrotliInputStream(inStream);
	}
});
contentDecoderMap.put("gzip", GZIPInputStreamFactory.getInstance());
contentDecoderMap.put("x-gzip", GZIPInputStreamFactory.getInstance());
contentDecoderMap.put("deflate", DeflateInputStreamFactory.getInstance());
try (CloseableHttpClient httpClient = HttpClients.custom()
		.setContentDecoderRegistry(contentDecoderMap)
		.build()) {
	//...
}

And everything else will be handled by HttpClient automatically.

Not building with old GCC because of '-std=c++11' flag

Is the flag "-std=c++11" really required in CMakeLists.txt? I removed this flag because my GCC was really old and still worked for me.
For some reasons, I don't have a control over the GCC of the machine where I build the code.

bintray repo delivering 302 -> 404

hey, we are trying to integrate your nice library into our play2 scala frontend for https://www.welt.de, but we can't resolve your dependency:

[warn] ==== jcenter: tried
[warn] https://jcenter.bintray.com/org/meteogroup/jbrotli/jbrotli/0.5.0/jbrotli-0.5.0.pom

if i follow that link with curl it leads to a 404:

curl -IL https://jcenter.bintray.com/org/meteogroup/jbrotli/jbrotli/0.5.0/jbrotli-0.5.0.pom                           
HTTP/1.1 302
Server: nginx
Date: Mon, 16 Apr 2018 20:31:27 GMT
Content-Length: 0
Connection: keep-alive
Location: https://repo.jfrog.org/artifactory/libs-release-bintray/org/meteogroup/jbrotli/jbrotli/0.5.0/jbrotli-0.5.0.pom?referrer

HTTP/1.1 404 Not Found
Content-Type: application/json;charset=ISO-8859-1
Date: Mon, 16 Apr 2018 20:31:28 GMT
Server: nginx
X-Artifactory-Id: repo.jfrog.org
X-Artifactory-Node-Id: artrjo-s1
X-Node: nginx-dedicated3c.prod-use1
Connection: keep-alive

this url works:
https://dl.bintray.com/nitram509/jbrotli/org/meteogroup/jbrotli/jbrotli-native-linux-x86-amd64/0.5.0/jbrotli-native-linux-x86-amd64-0.5.0.pom but I dont know how to configure the resolver to reach that url

we followed the integration guide from https://github.com/guardian/play-brotli-filter

can you help us?

Truncated result

When returning a large json, it appears that the response is truncated when Brotli is used (but works fine with gzip). The integration isn't doing anything fancy - its RestEasy (Jax-rs), Guice, and Jackson. Brotli was added as,

filter("/*").through(BrotliServletFilter.class);
bind(BrotliServletFilter.class).asEagerSingleton();

For small payloads it works perfectly, but for a large one it returns back content-length:21949 which is probably incorrect.

Cannot install your repo via SBT

Sbt supports Maven projects installing, but I cannot install yours via

libraryDependencies += "org.meteogroup.jbrotli" % "jbrotli" % "0.5.0"

So it fails with "unresolved dependency: org.meteogroup.jbrotli#jbrotli;0.5.0: not found" exception

Make BrotliLibraryLoader.loadBrotli() call idempotent

Is it possible to make BrotliLibraryLoader.loadBrotli() method not load the native library if the library is already loaded? Currently I have to employ ClassLoader hack to list all loaded native libraries and see if brotli is already in there.

Note, that I cannot employ a flag of some kind (setting it to true or something after the first call to the aforementioned method), because my code is running as a plugin, and it is possible that some other plugin (written by someone else) already loaded native library for jbrotli.

Tests failing on `master`

In my attempt to help support 0.6.0 version, I am trying to build first on master.
The compilation succeed but the tests are failing:

Steps to reproduce

git clone [email protected]:MeteoGroup/jbrotli.git
cd jbrotli
git submodule init 
git submodule update

Error message

readlink: illegal option -- f
usage: readlink [-n] [file ...]
Warning: JAVA_HOME environment variable is not set.
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO] 
[INFO] jbrotli-native-darwin-x86-amd64
[INFO] jbrotli
[INFO] jbrotli-native
[INFO] jbrotli-performance
[INFO] jbrotli-servlet
[INFO] jbrotli-examples-dropwizard
[INFO] jbrotli-examples-http-client
[INFO] jbrotli-examples-simple-web-app
[INFO] jbrotli-examples-spring-boot
[INFO] jbrotli-examples
[INFO] jbrotli-parent
[INFO] 
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building jbrotli-native-darwin-x86-amd64 0.6.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ jbrotli-native-darwin-x86-amd64 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/mchauvin/Code/mchv/jbrotli/jbrotli-native/darwin-x86-amd64/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ jbrotli-native-darwin-x86-amd64 ---
[INFO] No sources to compile
[INFO] 
[INFO] --- exec-maven-plugin:1.4.0:exec (build-native) @ jbrotli-native-darwin-x86-amd64 ---
-- The C compiler identification is AppleClang 8.0.0.8000042
-- The CXX compiler identification is AppleClang 8.0.0.8000042
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Java: /Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/Home/bin/java (found version "1.8.0.111") found components:  Development 
-- Found JNI: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/JavaVM.framework  
-- JNI_INCLUDE_DIRS=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/JavaVM.framework/Headers;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/JavaVM.framework/Headers;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/JavaVM.framework/Headers
-- JNI_LIBRARIES=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/JavaVM.framework;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/JavaVM.framework
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/mchauvin/Code/mchv/jbrotli/jbrotli-native/darwin-x86-amd64/target
Scanning dependencies of target brotli
[  3%] Building C object CMakeFiles/brotli.dir/brotli/common/dictionary.c.o
[  6%] Building C object CMakeFiles/brotli.dir/brotli/enc/backward_references.c.o
[ 10%] Building C object CMakeFiles/brotli.dir/brotli/enc/bit_cost.c.o
[ 13%] Building C object CMakeFiles/brotli.dir/brotli/enc/block_splitter.c.o
[ 17%] Building C object CMakeFiles/brotli.dir/brotli/enc/brotli_bit_stream.c.o
[ 20%] Building CXX object CMakeFiles/brotli.dir/brotli/enc/compressor.cc.o
[ 24%] Building C object CMakeFiles/brotli.dir/brotli/enc/cluster.c.o
[ 27%] Building C object CMakeFiles/brotli.dir/brotli/enc/compress_fragment.c.o
[ 31%] Building C object CMakeFiles/brotli.dir/brotli/enc/compress_fragment_two_pass.c.o
[ 34%] Building C object CMakeFiles/brotli.dir/brotli/enc/encode.c.o
[ 37%] Building CXX object CMakeFiles/brotli.dir/brotli/enc/encode_parallel.cc.o
[ 41%] Building C object CMakeFiles/brotli.dir/brotli/enc/entropy_encode.c.o
[ 44%] Building C object CMakeFiles/brotli.dir/brotli/enc/histogram.c.o
[ 48%] Building C object CMakeFiles/brotli.dir/brotli/enc/literal_cost.c.o
[ 51%] Building C object CMakeFiles/brotli.dir/brotli/enc/memory.c.o
[ 55%] Building C object CMakeFiles/brotli.dir/brotli/enc/metablock.c.o
[ 58%] Building C object CMakeFiles/brotli.dir/brotli/enc/static_dict.c.o
[ 62%] Building CXX object CMakeFiles/brotli.dir/brotli/enc/streams.cc.o
[ 65%] Building C object CMakeFiles/brotli.dir/brotli/enc/utf8_util.c.o
[ 68%] Building C object CMakeFiles/brotli.dir/brotli/dec/bit_reader.c.o
[ 72%] Building C object CMakeFiles/brotli.dir/brotli/dec/decode.c.o
[ 75%] Building C object CMakeFiles/brotli.dir/brotli/dec/huffman.c.o
[ 79%] Building C object CMakeFiles/brotli.dir/brotli/dec/state.c.o
[ 82%] Building CXX object CMakeFiles/brotli.dir/jbrotli-native/src/main/cpp/param_converter.cxx.o
[ 86%] Building CXX object CMakeFiles/brotli.dir/jbrotli-native/src/main/cpp/org_meteogroup_jbrotli_BrotliCompressor.cxx.o
[ 89%] Building CXX object CMakeFiles/brotli.dir/jbrotli-native/src/main/cpp/org_meteogroup_jbrotli_BrotliStreamCompressor.cxx.o
[ 93%] Building CXX object CMakeFiles/brotli.dir/jbrotli-native/src/main/cpp/org_meteogroup_jbrotli_BrotliStreamDeCompressor.cxx.o
[ 96%] Building CXX object CMakeFiles/brotli.dir/jbrotli-native/src/main/cpp/org_meteogroup_jbrotli_BrotliDeCompressor.cxx.o
[100%] Linking CXX shared library libbrotli.dylib
[100%] Built target brotli
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ jbrotli-native-darwin-x86-amd64 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/mchauvin/Code/mchv/jbrotli/jbrotli-native/darwin-x86-amd64/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.5.1:testCompile (default-testCompile) @ jbrotli-native-darwin-x86-amd64 ---
[INFO] Compiling 1 source file to /Users/mchauvin/Code/mchv/jbrotli/jbrotli-native/darwin-x86-amd64/target/test-classes
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ jbrotli-native-darwin-x86-amd64 ---
[INFO] Surefire report directory: /Users/mchauvin/Code/mchv/jbrotli/jbrotli-native/darwin-x86-amd64/target/surefire-reports


-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running TestSuite
Configuring TestNG with: org.apache.maven.surefire.testng.conf.TestNG652Configurator@782830e
Tests run: 96, Failures: 10, Errors: 0, Skipped: 0, Time elapsed: 5.462 sec <<< FAILURE!
compress_with_byte_array_and_flushing(org.meteogroup.jbrotli.BrotliStreamCompressorByteArrayTest)  Time elapsed: 0.014 sec  <<< FAILURE!
java.lang.AssertionError: 
Expected size:<10> but was:<9> in:
<[11, 27, 0, 0, 36, -126, -30, -103, 64]>
	at org.meteogroup.jbrotli.BrotliStreamCompressorByteArrayTest.compress_with_byte_array_and_flushing(BrotliStreamCompressorByteArrayTest.java:53)

compress_with_byte_array_using_position_and_length(org.meteogroup.jbrotli.BrotliStreamCompressorByteArrayTest)  Time elapsed: 0.006 sec  <<< FAILURE!
java.lang.AssertionError: 
Expecting:
 <[11, 27, 0, 0, 36, -126, -30, -103, 64]>
to be equal to:
 <[27, 54, 0, 0, 36, -126, -30, -103, 64, 0]>
but was not.
	at org.meteogroup.jbrotli.BrotliStreamCompressorByteArrayTest.compress_with_byte_array_using_position_and_length(BrotliStreamCompressorByteArrayTest.java:112)

compress_with_byte_array_without_flushing(org.meteogroup.jbrotli.BrotliStreamCompressorByteArrayTest)  Time elapsed: 0.003 sec  <<< FAILURE!
java.lang.AssertionError: 
Expecting:
 <[11, 27, 0, 0, 36, -126, -30, -103, 64]>
to be equal to:
 <[27, 54, 0, 0, 36, -126, -30, -103, 64, 0]>
but was not.
	at org.meteogroup.jbrotli.BrotliStreamCompressorByteArrayTest.compress_with_byte_array_without_flushing(BrotliStreamCompressorByteArrayTest.java:77)

compress_with_array_wrapped_ByteBuffer_and_flushing(org.meteogroup.jbrotli.BrotliStreamCompressorByteBufferTest)  Time elapsed: 0.003 sec  <<< FAILURE!
java.lang.AssertionError: 
Expecting:
 <9>
to be equal to:
 <10>
but was not.
	at org.meteogroup.jbrotli.BrotliStreamCompressorByteBufferTest.compress_with_array_wrapped_ByteBuffer_and_flushing(BrotliStreamCompressorByteBufferTest.java:154)

compress_with_array_wrapped_ByteBuffer_using_arrayOffset_and_length(org.meteogroup.jbrotli.BrotliStreamCompressorByteBufferTest)  Time elapsed: 0.003 sec  <<< FAILURE!
java.lang.AssertionError: 
Expecting:
 <9>
to be equal to:
 <10>
but was not.
	at org.meteogroup.jbrotli.BrotliStreamCompressorByteBufferTest.compress_with_array_wrapped_ByteBuffer_using_arrayOffset_and_length(BrotliStreamCompressorByteBufferTest.java:216)

compress_with_array_wrapped_ByteBuffer_using_position_and_length(org.meteogroup.jbrotli.BrotliStreamCompressorByteBufferTest)  Time elapsed: 0.003 sec  <<< FAILURE!
java.lang.AssertionError: 
Expecting:
 <9>
to be equal to:
 <10>
but was not.
	at org.meteogroup.jbrotli.BrotliStreamCompressorByteBufferTest.compress_with_array_wrapped_ByteBuffer_using_position_and_length(BrotliStreamCompressorByteBufferTest.java:192)

compress_with_array_wrapped_ByteBuffer_without_flushing(org.meteogroup.jbrotli.BrotliStreamCompressorByteBufferTest)  Time elapsed: 0.005 sec  <<< FAILURE!
java.lang.AssertionError: 
Expecting:
 <9>
to be equal to:
 <10>
but was not.
	at org.meteogroup.jbrotli.BrotliStreamCompressorByteBufferTest.compress_with_array_wrapped_ByteBuffer_without_flushing(BrotliStreamCompressorByteBufferTest.java:170)

compress_with_direct_ByteBuffer_and_flushing(org.meteogroup.jbrotli.BrotliStreamCompressorByteBufferTest)  Time elapsed: 0.003 sec  <<< FAILURE!
java.lang.AssertionError: 
Expecting:
 <9>
to be equal to:
 <10>
but was not.
	at org.meteogroup.jbrotli.BrotliStreamCompressorByteBufferTest.compress_with_direct_ByteBuffer_and_flushing(BrotliStreamCompressorByteBufferTest.java:96)

compress_with_direct_ByteBuffer_using_position_and_length(org.meteogroup.jbrotli.BrotliStreamCompressorByteBufferTest)  Time elapsed: 0.002 sec  <<< FAILURE!
java.lang.AssertionError: 
Expecting:
 <9>
to be equal to:
 <10>
but was not.
	at org.meteogroup.jbrotli.BrotliStreamCompressorByteBufferTest.compress_with_direct_ByteBuffer_using_position_and_length(BrotliStreamCompressorByteBufferTest.java:137)

compress_with_direct_ByteBuffer_without_flushing(org.meteogroup.jbrotli.BrotliStreamCompressorByteBufferTest)  Time elapsed: 0.004 sec  <<< FAILURE!
java.lang.AssertionError: 
Expecting:
 <9>
to be equal to:
 <10>
but was not.
	at org.meteogroup.jbrotli.BrotliStreamCompressorByteBufferTest.compress_with_direct_ByteBuffer_without_flushing(BrotliStreamCompressorByteBufferTest.java:114)


Results :

Failed tests:   compress_with_byte_array_and_flushing(org.meteogroup.jbrotli.BrotliStreamCompressorByteArrayTest): (..)
  compress_with_byte_array_using_position_and_length(org.meteogroup.jbrotli.BrotliStreamCompressorByteArrayTest): (..)
  compress_with_byte_array_without_flushing(org.meteogroup.jbrotli.BrotliStreamCompressorByteArrayTest): (..)
  compress_with_array_wrapped_ByteBuffer_and_flushing(org.meteogroup.jbrotli.BrotliStreamCompressorByteBufferTest): (..)
  compress_with_array_wrapped_ByteBuffer_using_arrayOffset_and_length(org.meteogroup.jbrotli.BrotliStreamCompressorByteBufferTest): (..)
  compress_with_array_wrapped_ByteBuffer_using_position_and_length(org.meteogroup.jbrotli.BrotliStreamCompressorByteBufferTest): (..)
  compress_with_array_wrapped_ByteBuffer_without_flushing(org.meteogroup.jbrotli.BrotliStreamCompressorByteBufferTest): (..)
  compress_with_direct_ByteBuffer_and_flushing(org.meteogroup.jbrotli.BrotliStreamCompressorByteBufferTest): (..)
  compress_with_direct_ByteBuffer_using_position_and_length(org.meteogroup.jbrotli.BrotliStreamCompressorByteBufferTest): (..)
  compress_with_direct_ByteBuffer_without_flushing(org.meteogroup.jbrotli.BrotliStreamCompressorByteBufferTest): (..)

Tests run: 96, Failures: 10, Errors: 0, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] jbrotli-native-darwin-x86-amd64 ................... SUCCESS [ 14.323 s]
[INFO] jbrotli ........................................... FAILURE [  7.363 s]
[INFO] jbrotli-native .................................... SKIPPED
[INFO] jbrotli-performance ............................... SKIPPED
[INFO] jbrotli-servlet ................................... SKIPPED
[INFO] jbrotli-examples-dropwizard ....................... SKIPPED
[INFO] jbrotli-examples-http-client ...................... SKIPPED
[INFO] jbrotli-examples-simple-web-app ................... SKIPPED
[INFO] jbrotli-examples-spring-boot ...................... SKIPPED
[INFO] jbrotli-examples .................................. SKIPPED
[INFO] jbrotli-parent .................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 22.060 s
[INFO] Finished at: 2017-09-14T15:39:40+00:00
[INFO] Final Memory: 19M/312M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project jbrotli: There are test failures.
[ERROR] 
[ERROR] Please refer to /Users/mchauvin/Code/mchv/jbrotli/jbrotli/target/surefire-reports for the individual test results.
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :jbrotli

@nitram509 any idea what I am missing?

crash on linux

Code:

BrotliLibraryLoader.loadBrotli();
org.apache.commons.io.IOUtils.copyLarge(new ByteArrayInputStream(new byte[40960]), new BrotliOutputStream(new ByteArrayOutputStream()));

StdError:

hs_err_pid17982.txt

 A fatal error has been detected by the Java Runtime Environment:

  SIGSEGV (0xb) at pc=0x00007f5050c854d1, pid=17982, tid=139983466776320

 JRE version: Java(TM) SE Runtime Environment (8.0_65-b17) (build 1.8.0_65-b17)
 Java VM: Java HotSpot(TM) 64-Bit Server VM (25.65-b01 mixed mode linux-amd64 compressed oops)
 Problematic frame:
 C  [libbrotli.so+0xb4d1]  brotli::CreateBackwardReferences(unsigned long, unsigned long, bool, unsigned char const*, unsigned long, int, int, brotli::Hashers*, int, int*, unsigned long*, brotli::Command*, unsigned long*, unsigned long*)+0x2011

 Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again

 An error report file with more information is saved as:
 /tmp/brotli/hs_err_pid17982.log

 If you would like to submit a bug report, please visit:
   http://bugreport.java.com/bugreport/crash.jsp
 The crash happened outside the Java Virtual Machine in native code.
 See problematic frame for where to report the bug.

Response incomplete

screenshot 2019-01-30 at 5 46 10 am

File 1

function ctiapisetCenter(id)
{ 
	document.getElementById(id).style.display="block";
	createFreezeLayer();
	$top = $(window).height()/2;
	$contop = $("#"+id).innerHeight()/2;
	$left = $(window).width()/2;
	$conleft = $("#"+id).width()/2;
	$("#"+id).css({'top': $top-$contop, 'left': $left-$conleft});
}
$(document).ready(function(){
	if($(".selector").length !==0 && typeof $.fn.sortable === "function"){
		$( ".selector" ).sortable( "disable" );
	}
}

File 2

Territory.showOrHideDelIcon = function(obj, option)
{
	$(obj).children('a').eq(0).toggle(option);
};
Territory.getCurrencyObj = function(sampleStr)
{
	var currencyDet = {};
	currencyDet.format = ',|.';
	currencyDet.decimals = 2;
	if(User.userDetails.BASE_CURRENCY && User.userDetails.CURRENCY_DETAILS[User.userDetails.BASE_CURRENCY])
	{
		currencyDet = User.userDetails.CURRENCY_DETAILS[User.userDetails.BASE_CURRENCY];
	}
	else if(User.userDetails.defaultOrgCurrency)
	{
		currencyDet.symbol = User.userDetails.defaultOrgCurrency;
	}			
	var quotaPercent,shortPercent;
	if(!currencyDet.symbol && sampleStr)
	{
		sampleStr = sampleStr.trim();
		var currency = sampleStr.match(/^.*?(?=[0-9])/);//No I18N
		currencyDet.symbol = currency[0];
	}
	return currencyDet;

Above two are the example code snippets script files after brotli compression. As you can see the functions were not completed.

How to install brotli library on ubuntu xenial?

I integrated jbrotli within my apache httpclient but can't use it because BrotliLibraryLoader.loadBrotli(); fails. I already installed brotli via apt-get install brotli and also compiled brotli by myself and created the symlink to the brotli.so file but it's also not working.

Couldn't load native library 'brotli'. [LoaderResult: os.name="Linux", os.arch="amd64", os.version="4.4.0-51-generic", java.vm.name="OpenJDK 64-Bit Server VM", java.vm.version="25.111-b14", java.vm.vendor="Oracle Corporation", alreadyLoaded="null", loadedFromSystemLibraryPath="false", nativeLibName="libbrotli.so", temporaryLibFile="/tmp/brotli5285008184952161942/libbrotli.so", libNameWithinClasspath="/lib/linux-x86-amd64/libbrotli.so", usedThisClassloader="false", usedSystemClassloader="false", java.library.path="/usr/java/packages/lib/amd64:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib"];

What's the correct way to install brotli on ubuntu xenial that jbrotli can make use of it?

Deploy to central.maven.org for better adoption.

Using artifacts from external repositories is discouraged for artifacts destined to central.maven.org.

Don't use bintray exclusively, sync to central.maven.org as well.

While the rules (regarding external repository references) for artifact sync from oss.sonatype.org to the maven global repository system are a bit relaxed currently, this is a temporary relaxation and will become more strict soon.

When this occurs, projects using your artifacts can no longer sync to central.maven.org

Compile with GCC 4.8

I've had to rebuild jbrotli for our environment using GCC 4.8. Everything works fine with 4.8, which is the default version that ships with Ubuntu 14.04 LTS. Compiling with 4.9 prevents jbrotli from working in several environments (including EMR), so I'd recommend building with 4.8. That would make the binary more portable and much easier to use in Hadoop. I also used CMake 2.8 instead of 3.0, without any problem.

Tomcat not able to get it running

Hi,

just downloaded your project, trying to get it working with Tomcat both Windows and Linux

i followed theses steps

  1. downloaded the brotli project from google and placed it in the folder brotli of your project
  2. Downloaded the CMAKE, to compile or run the build.bat file, but was not able to do so.

Not able to move forward with this.

I am looking for something like jar file for the wrapper your have writter or dll file.

Thanks,
Vijay

compile with -02?

Is the .so file compiled with -o2 or similar optimization level?

The speed of the so file in 0.5 release looks consistent with non-optimized build. It can be 3x faster with -o2 ;-)

UnsatisfiedLinkError in BrotliStreamCompressor

When running this code

new BrotliStreamCompressor();

UnsatisfiedLinkError is thrown with following stack trace:

Exception in thread "main" java.lang.UnsatisfiedLinkError: org.meteogroup.jbrotli.BrotliStreamCompressor.initJavaFieldIdCache()I at org.meteogroup.jbrotli.BrotliStreamCompressor.initJavaFieldIdCache(Native Method) at org.meteogroup.jbrotli.BrotliStreamCompressor.<clinit>(BrotliStreamCompressor.java:28) at xxx.Main.main(Main.java:59)

Possible cause:
jbrotli-native/src/main/cpp/org_meteogroup_jbrotli_BrotliStreamCompressor.cxx line 45
native code is trying to get ID of field which does not exist.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.