Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not launch browser : java.io.FileNotFoundException: /Library/Java/JavaVirtualMachines/jdk1.8.0_221.jdk/Contents/Home/jre/lib/tzdb.dat (Too many open files) #364

Open
BruceYuan1993 opened this issue Feb 20, 2020 · 3 comments

Comments

@BruceYuan1993
Copy link

[2020-02-20T01:12:49.651] java.lang.Error: java.io.FileNotFoundException: /Library/Java/JavaVirtualMachines/jdk1.8.0_221.jdk/Contents/Home/jre/lib/tzdb.dat (Too many open files)
[2020-02-20T01:12:49.651] at sun.util.calendar.ZoneInfoFile$1.run(ZoneInfoFile.java:261)
[2020-02-20T01:12:49.651] at java.security.AccessController.doPrivileged(Native Method)
[2020-02-20T01:12:49.651] at sun.util.calendar.ZoneInfoFile.(ZoneInfoFile.java:251)
[2020-02-20T01:12:49.651] at sun.util.calendar.ZoneInfo.getTimeZone(ZoneInfo.java:589)
[2020-02-20T01:12:49.651] at java.util.TimeZone.getTimeZone(TimeZone.java:560)
[2020-02-20T01:12:49.651] at java.util.TimeZone.setDefaultZone(TimeZone.java:666)
[2020-02-20T01:12:49.651] at java.util.TimeZone.getDefaultRef(TimeZone.java:636)
[2020-02-20T01:12:49.651] at java.util.TimeZone.getDefault(TimeZone.java:625)
[2020-02-20T01:12:49.652] at java.text.SimpleDateFormat.initializeCalendar(SimpleDateFormat.java:657)
[2020-02-20T01:12:49.652] at java.text.SimpleDateFormat.(SimpleDateFormat.java:601)
[2020-02-20T01:12:49.652] at java.text.SimpleDateFormat.(SimpleDateFormat.java:580)
[2020-02-20T01:12:49.652] at com.machinepublishers.jbrowserdriver.LogHandler.(LogHandler.java:28)
[2020-02-20T01:12:49.652] at com.machinepublishers.jbrowserdriver.Settings.(Settings.java:57)
[2020-02-20T01:12:49.652] at java.lang.Class.forName0(Native Method)
[2020-02-20T01:12:49.652] at java.lang.Class.forName(Class.java:264)
[2020-02-20T01:12:49.652] at com.machinepublishers.jbrowserdriver.$Proxy1.(Unknown Source)
[2020-02-20T01:12:49.654] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[2020-02-20T01:12:49.654] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
[2020-02-20T01:12:49.654] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
[2020-02-20T01:12:49.654] at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
[2020-02-20T01:12:49.654] at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:739)
[2020-02-20T01:12:49.654] at sun.rmi.server.Util$1.run(Util.java:155)
[2020-02-20T01:12:49.654] at sun.rmi.server.Util$1.run(Util.java:153)
[2020-02-20T01:12:49.654] at java.security.AccessController.doPrivileged(Native Method)
[2020-02-20T01:12:49.654] at sun.rmi.server.Util.createProxy(Util.java:153)
[2020-02-20T01:12:49.654] at sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:226)
[2020-02-20T01:12:49.655] at java.rmi.server.UnicastRemoteObject.exportObject(UnicastRemoteObject.java:383)
[2020-02-20T01:12:49.655] at java.rmi.server.UnicastRemoteObject.exportObject(UnicastRemoteObject.java:346)
[2020-02-20T01:12:49.655] at java.rmi.server.UnicastRemoteObject.(UnicastRemoteObject.java:225)
[2020-02-20T01:12:49.655] at com.machinepublishers.jbrowserdriver.RemoteObject.(RemoteObject.java:26)
[2020-02-20T01:12:49.655] at com.machinepublishers.jbrowserdriver.JBrowserDriverServer.(JBrowserDriverServer.java:157)
[2020-02-20T01:12:49.655] at com.machinepublishers.jbrowserdriver.JBrowserDriverServer.main(JBrowserDriverServer.java:125)
[2020-02-20T01:12:49.655] Caused by: java.io.FileNotFoundException: /Library/Java/JavaVirtualMachines/jdk1.8.0_221.jdk/Contents/Home/jre/lib/tzdb.dat (Too many open files)
[2020-02-20T01:12:49.655] at java.io.FileInputStream.open0(Native Method)
[2020-02-20T01:12:49.655] at java.io.FileInputStream.open(FileInputStream.java:195)
[2020-02-20T01:12:49.655] at java.io.FileInputStream.(FileInputStream.java:138)
[2020-02-20T01:12:49.655] at sun.util.calendar.ZoneInfoFile$1.run(ZoneInfoFile.java:255)
[2020-02-20T01:12:49.655] ... 31 more
[2020-02-20T01:12:50.423] 错误: 找不到或无法加载主类 com.machinepublishers.jbrowserdriver.JBrowserDriverServer

org.openqa.selenium.WebDriverException: Could not launch browser.
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: host: 'brucedeMacBook-Pro.local', ip: 'fe80:0:0:0:8fd:d490:4122:375%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.14.6', java.version: '1.8.0_221'
Driver info: driver.version: JBrowserDriver
at com.machinepublishers.jbrowserdriver.Util.handleException(Util.java:136)
at com.machinepublishers.jbrowserdriver.JBrowserDriver.(JBrowserDriver.java:340)
at com.ximalaya.anchor.studio.monitor.processor.DefaultMonitorProcessor.init(DefaultMonitorProcessor.java:61)
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:498)
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:389)
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:333)
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:157)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:416)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1788)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:595)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1287)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1207)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:640)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:116)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1422)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:594)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:879)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:878)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
at com.ximalaya.anchor.studio.monitor.starter.StudioMonitorApplication.main(StudioMonitorApplication.java:19)
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:498)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)
Caused by: java.lang.IllegalStateException: Could not launch browser.
... 46 common frames omitted

@BruceYuan1993
Copy link
Author

@MachinePublishers I can run same code success from idea , but thrown exception while run "java -jar xxx.jar" after package. Could you help to check this issue?

@muf
Copy link

muf commented Jul 9, 2020

@BruceYuan1993 @MachinePublishers same for me.
it runs well on idea. but fails when i run jar file. (my project is spring boot application)

  • And it was okay when i packaged as single stand-alone application jar with maven-shaded-plugin.

@muf
Copy link

muf commented Jul 9, 2020

@BruceYuan1993
this solved my issue.

#229 (comment)

you need to make uber jar from jbrowserdriver,, (which i think really uncomfortable)
and set jar path like this.

i dont know why this solves the problem but will help you

  Settings.builder()
  .timezone(Timezone.ASIA_SEOUL)
  .requestHeaders(requestHeaders)
  .javaOptions("-classpath", "./target/jbrowserdriver-1.1.1-uberjar.jar")
  .build();

** if you deploy to linux server, you need to change jar path properly, because your deployed app jar is actually independent from jbrowserdriver uber jar..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants