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

Polishencoding #340

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Polishencoding #340

wants to merge 4 commits into from

Conversation

wkulesza
Copy link

We have added utf-8 encoding to stop monitoring and vehicle monitoring. This is based on 2.0.0 version of OBA.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@sheldonabrown
Copy link
Member

@wkulesza @changtung I distilled your commits down to this:
https://github.com/camsys/onebusaway-application-modules/tree/unified_340

(Please, in the future try to clean up your commits to the smallest changeset possible, it really makes my job easier)

Can you re-test and see if this still meets your testing needs? Or include a testcase so I can validate it.

@changtung
Copy link

I think i have problem with JDBC drivers. Somehow app does not run.
I had to update java to 11 from 8 to compile this, compiles fine however if i place onebusaway-api-webapp and onebusaway-transit-data-federation-webapp into webapps dir of tomcat and restart tomcat, i get such errors:
24-Apr-2023 17:42:56.626 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat/apache-tomcat-9.0.73/webapps/onebusaway-api-webapp] 24-Apr-2023 17:43:00.575 INFO [main] java.util.ArrayList.forEach Name = appDB Ignoring unknown property: value of "DB Connection" for "description" property 24-Apr-2023 17:43:00.729 INFO [main] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time. 24-Apr-2023 17:43:02.756 SEVERE [main] org.apache.catalina.core.StandardContext.startInternal One or more listeners failed to start. Full details will be found in the appropriate container log file 24-Apr-2023 17:43:02.757 SEVERE [main] org.apache.catalina.core.StandardContext.startInternal Context [/onebusaway-api-webapp] startup failed due to previous errors 24-Apr-2023 17:43:02.774 WARNING [main] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesJdbc The web application [onebusaway-api-webapp] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered. 24-Apr-2023 17:43:02.774 WARNING [main] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [onebusaway-api-webapp] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: [email protected]/java.lang.Object.wait(Native Method) [email protected]/java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:155) com.mysql.jdbc.AbandonedConnectionCleanupThread.run(AbandonedConnectionCleanupThread.java:43) 24-Apr-2023 17:43:02.780 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/tomcat/apache-tomcat-9.0.73/webapps/onebusaway-api-webapp] has finished in [6,154] ms
It seems i can't connect to database. I've changed jdbc drivers from 48 to 35 as i was using before and still same error.
Do You know maybe what can cause it ? we use mysql 8.0.27

@sheldonabrown
Copy link
Member

sheldonabrown commented Apr 25, 2023 via email

@changtung
Copy link

I see in webapp-api.log something like this:
2023-04-24T17:39:20,268 WARN [AbstractApplicationContext.java:559] : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.springframework.orm.hibernate4.LocalSessionFactoryBean] for bean with name 'agencyMetadataSessionFactory' defined in class path resource [data-sources.xml]; nested exception is java.lang.ClassNotFoundException: org.springframework.orm.hibernate4.LocalSessionFactoryBean 2023-04-24T17:39:20,271 ERROR [ContextLoader.java:313] : Context initialization failed org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.springframework.orm.hibernate4.LocalSessionFactoryBean] for bean with name 'agencyMetadataSessionFactory' defined in class path resource [data-sources.xml]; nested exception is java.lang.ClassNotFoundException: org.springframework.orm.hibernate4.LocalSessionFactoryBean at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1486) ~[spring-beans-5.2.20.RELEASE.jar:5.2.20.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineTargetType(AbstractAutowireCapableBeanFactory.java:681) ~[spring-beans-5.2.20.RELEASE.jar:5.2.20.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:648) ~[spring-beans-5.2.20.RELEASE.jar:5.2.20.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1614) ~[spring-beans-5.2.20.RELEASE.jar:5.2.20.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1090) ~[spring-beans-5.2.20.RELEASE.jar:5.2.20.RELEASE] at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:877) ~[spring-beans-5.2.20.RELEASE.jar:5.2.20.RELEASE] at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:879) ~[spring-context-5.2.20.RELEASE.jar:5.2.20.RELEASE] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:551) ~[spring-context-5.2.20.RELEASE.jar:5.2.20.RELEASE] at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:401) ~[spring-web-5.2.20.RELEASE.jar:5.2.20.RELEASE] at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:292) ~[spring-web-5.2.20.RELEASE.jar:5.2.20.RELEASE] at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:103) ~[spring-web-5.2.20.RELEASE.jar:5.2.20.RELEASE] at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4493) ~[catalina.jar:9.0.73] at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4939) ~[catalina.jar:9.0.73] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ~[catalina.jar:9.0.73] at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:683) ~[catalina.jar:9.0.73] at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:658) ~[catalina.jar:9.0.73] at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:662) ~[catalina.jar:9.0.73] at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1184) ~[catalina.jar:9.0.73] at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1932) ~[catalina.jar:9.0.73] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[?:?] at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?] at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) ~[tomcat-util.jar:9.0.73] at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:118) ~[?:?] at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:1094) ~[catalina.jar:9.0.73] at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:476) ~[catalina.jar:9.0.73] at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1617) ~[catalina.jar:9.0.73] at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:318) ~[catalina.jar:9.0.73] at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123) ~[catalina.jar:9.0.73] at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:423) ~[catalina.jar:9.0.73] at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:366) ~[catalina.jar:9.0.73] at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:898) ~[catalina.jar:9.0.73] at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:795) ~[catalina.jar:9.0.73] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ~[catalina.jar:9.0.73] at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1332) ~[catalina.jar:9.0.73] at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1322) ~[catalina.jar:9.0.73] at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?] at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) ~[tomcat-util.jar:9.0.73] at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:140) ~[?:?] at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:871) ~[catalina.jar:9.0.73] at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:249) ~[catalina.jar:9.0.73] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ~[catalina.jar:9.0.73] at org.apache.catalina.core.StandardService.startInternal(StandardService.java:428) ~[catalina.jar:9.0.73] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ~[catalina.jar:9.0.73] at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:917) ~[catalina.jar:9.0.73] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ~[catalina.jar:9.0.73] at org.apache.catalina.startup.Catalina.start(Catalina.java:772) ~[catalina.jar:9.0.73] at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?] at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?] at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:347) ~[bootstrap.jar:9.0.73] at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:478) ~[bootstrap.jar:9.0.73] Caused by: java.lang.ClassNotFoundException: org.springframework.orm.hibernate4.LocalSessionFactoryBean at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1412) ~[catalina.jar:9.0.73] at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1220) ~[catalina.jar:9.0.73] at java.lang.Class.forName0(Native Method) ~[?:?] at java.lang.Class.forName(Class.java:398) ~[?:?] at org.springframework.util.ClassUtils.forName(ClassUtils.java:284) ~[spring-core-5.2.20.RELEASE.jar:5.2.20.RELEASE] at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:469) ~[spring-beans-5.2.20.RELEASE.jar:5.2.20.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1551) ~[spring-beans-5.2.20.RELEASE.jar:5.2.20.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1478) ~[spring-beans-5.2.20.RELEASE.jar:5.2.20.RELEASE] ... 51 more 2023-04-24T17:43:01,225 INFO [ContextLoader.java:271] : Root WebApplicationContext: initialization started

and mysql connector to be sure its fine - should i choose depending on jdk version ?

@sheldonabrown
Copy link
Member

sheldonabrown commented Apr 25, 2023 via email

@changtung
Copy link

i receive like app does not see mysql.
`com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

The last packet successfully received from the server was 54 milliseconds ago. The last packet sent successfully to the server was 44 milliseconds ago.
`
but mysql works, data source is defined.

@wkulesza
Copy link
Author

Hi. One pending task is CLA to be signed.
Please help me out here @sheldonabrown - was this signed or not? I can't see any sign button ?
obraz

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

Successfully merging this pull request may close these issues.

4 participants