Comments (9)
Getting the same issue, would be good if you can fix it!
org.yaml.snakeyaml.error.YAMLException: java.io.IOException: Stream closed
at org.yaml.snakeyaml.reader.StreamReader.update(StreamReader.java:198)
at org.yaml.snakeyaml.reader.StreamReader.(StreamReader.java:62)
at org.yaml.snakeyaml.Yaml.load(Yaml.java:411)
at ua_parser.Parser.initialize(Parser.java:69)
at ua_parser.Parser.(Parser.java:44)
at ua_parser.Parser.(Parser.java:40)
at ua_parser.TestTest.test(TestTest.java:14)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
Caused by: java.io.IOException: Stream closed
at java.io.PushbackInputStream.ensureOpen(PushbackInputStream.java:57)
at java.io.PushbackInputStream.read(PushbackInputStream.java:149)
at org.yaml.snakeyaml.reader.UnicodeReader.init(UnicodeReader.java:88)
at org.yaml.snakeyaml.reader.UnicodeReader.read(UnicodeReader.java:118)
at java.io.Reader.read(Reader.java:123)
at org.yaml.snakeyaml.reader.StreamReader.update(StreamReader.java:182)
... 29 more
from uap-java.
Seems like the code is trying to load this file, which is not present in the project ,-)
private static final String REGEX_YAML_PATH = "/ua_parser/regexes.yaml";
from uap-java.
In the same directory where you have the uap-java
repo, which you are trying to build, you need also to put this repo:
It contains resources uap-java
is expecting to find.
from uap-java.
Directory structure:
find ./ua-parser/ -depth -2
./ua-parser/
./ua-parser//uap-core
./ua-parser//uap-java
I ran command from ./ua-parser/uap-java directory, mvn package. I failed for couple of entries
mvn package
Summary of mvn package
*It fails for
Failed tests: testCachedParseDevice(ua_parser.CachingParserTest): Mozilla/5.0 (Linux; U; Android 4.0.3; en-us; Amaze_4G Build/IML74K) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30(..)
testParseDevice(ua_parser.CachingParserTest): Mozilla/5.0 (Linux; U; Android 4.0.3; en-us; Amaze_4G Build/IML74K) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30(..)
testParseDevice(ua_parser.ParserTest): Mozilla/5.0 (Linux; U; Android 4.0.3; en-us; Amaze_4G Build/IML74K) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30(..)*
from uap-java.
Yes, I'm having the same problems. It seems that the some of the different implementations are not up to date with the core
, so some tests fail.
from uap-java.
I created a test class RunTest.java, it does not execute well
java RunTest
Exception in thread "main" java.lang.NoClassDefFoundError: org/yaml/snakeyaml/constructor/BaseConstructor
at RunTest.main(RunTest.java:10)
Caused by: java.lang.ClassNotFoundException: org.yaml.snakeyaml.constructor.BaseConstructor
at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 1 more
This class looks like
import ua_parser.Parser;
import ua_parser.Client;
class RunTest{
public static void main (String []args){
try{
String uaString = "Mozilla/5.0 (iPhone; CPU iPhone OS 5_1_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9B206 Safari/7534.48.3";
Parser uaParser = new Parser();
Client c = uaParser.parse(uaString);
System.out.println(c.userAgent.family); // => "Mobile Safari"
System.out.println(c.userAgent.major); // => "5"
System.out.println(c.userAgent.minor); // => "1"
System.out.println(c.os.family); // => "iOS"
System.out.println(c.os.major); // => "5"
System.out.println(c.os.minor); // => "1"
System.out.println(c.device.family); // => "iPhone"
}
catch(Exception ex){ex.printStackTrace();}
}
}
Disclaimer : I am new to maven tool.
from uap-java.
Tests are working with PR #7
from uap-java.
I noticed a commit by "commenthol" on Nov 5, 2014 tried to address the same, more or less.
That was reverted by "tobie" two days later, without further comment.
Now the regex file in ua-core has had the new formats for several months, and it seems this pull request is just waiting for someone to merge it. I'm not entirely sure who's the official maintainer here, the readme file only lists the initial author.
from uap-java.
Still the issue exists. Admins, please, merge [~lefloh] pull request
from uap-java.
Related Issues (20)
- can parse postman user-agent
- Building jar doesn't work HOT 1
- maven release HOT 1
- Hi, Benjamin HOT 1
- Why not deploy to maven central? HOT 1
- Third party library or framework integration plan HOT 5
- Please release to include latest changes to UAP-Core HOT 5
- IOException not imported by CacheParser HOT 5
- Update uap-core to 0.13.0 HOT 1
- SnakeYAML requires the java.desktop module HOT 1
- parse error HOT 2
- UserAgent Parser does not support patchMinor
- CVE-2022-25857 snakeyaml: Denial of Service due to missing nested depth limitation for collections HOT 2
- Migrate yaml parsing to compile phase HOT 2
- Make it possible to use RE2J instead of java.util.regexp HOT 5
- Change yaml parser to org.snakeyaml:snakeyaml-engine HOT 8
- CVE-2022-1471 - Dependency Snakeyaml Critical 9.8 score vulnerability HOT 10
- User-agent with CriOS mapped wrongly
- User-agent with EdgiOS mapped wrongly
- Bring back Java 8 Support 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 uap-java.