-
Notifications
You must be signed in to change notification settings - Fork 28
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
Error: Failed to initialize Spring Context #85
Comments
FYI. There are three things to test:
The second item is achieved by clicking the "fix" link in the TeamCity administration section on the Webhooks Rest API tab (bottom left). |
@netwolfuk When I click the fix button i get following message:
|
Thanks for testing it. Hmm that's odd. |
no sadly - no warnings or errors related. |
Ok. Thanks for looking. I'll look at spinning up something in AWS to do some testing. I'm sorry this isn't as straight forward as I hoped. Thanks for working through it with me so far. |
np - let me know if there is anything I can do! |
Thanks. Hopefully I'll have a new version to test within a few days. |
Btw. Unless you want to edit templates, the rest API is not required. Webhook functionality does not require the API. |
Well technically I want to edit headers - at least that's what I think is the problem why I can't post to a discord webhook. |
Ah. Well, you would've been disappointed. Can you raise a new issue with requirements on what header(s) you need to set? |
well technically discord supports slack like json format. Added new issue #86 for this |
I have half fixed this issue on windows. So, names like So that bug is fixed and removing the jars from the API zip file now works. However, removing the jars from TeamCity's "unpacked" folder does not work because Windows has the files locked. Interestingly, they are also not cleared out (re-unpacked) on a teamcity restart. I don't know how I can work around that. I'll have a look at issue #86 and then do a release. |
Maybe a temporary workaround could be that the tool would list all files that need to be deleted/updated and the owner of teamcity would be able to do that manually during a restart cycle. |
Yes. Great idea. I will list then all explicitly and what their fix status is. The fix link attempts to fix all items, so a UI change to indicate that would be an improvement. Currently it stops processing when it encounters an error. That was a change I made yesterday so that I could return the error, but in hindsight that was not a great idea. |
I have improved the UX a bit and now show more information. A new build should kick off shortly and then be available for download. |
sure let me know when the build is ready for testing. |
Oops. String.join is java 8, so the build failed. Sorry. I'll sort that out when I get back to the computer. I really should configure my ide for java 7. |
A new build is available. I won't get to test it. Busy at our place. And I've fixed my ide to build with Java 7. Hopefully no more of these embarrassing compiler issues. |
I just did a quick test in AWS:
When I ran the new "Fix...." link, it indicated that the files were in use. Restarting TeamCity (from the TeamCity diagnostics area) did not clear the unpacked folder, and neither did restarting the windows service for TeamCity Server. The two jars are slightly easier to spot, because they have the timestamp of the previous unpack, not when the service is restarted. |
Good news. On Win 10, System user & TC as service everything works just fine now. Cheers! |
Terrific. Thanks for the feedback. I will check that it all still works correctly on Linux and in Docker and then do a release. |
What did you think of the template edit process? Was it straightforward enough? Did you override an existing template or copy it to create a new one? I have created a new github repository for sharing templates. I need to write up some docs and test that it all works, but the plan is to allow people to submit pull requests to add new templates. It's possible to export a template as XML, I just need to validate that the import process works correctly. |
It was fine - I had no problem cloning the template and editing some wordings for my purpose. |
Great. I was wondering about providing a test button, to execute a test webhook POST before saving the template. Would that be useful? |
a test is always nice, especially since else you have to actually do a build to test it :) |
This bug is now closed as it is fixed in alpha14. The testing stuff (#79) will be deferred for either 1.1 RC, or the 1.2 release cycle. It's currently allocated against the 1.2 milestone. |
Expected Behavior
It is expected that the plugins install fine without error, or at least known errors.
Current Behavior
Error when installing webhook rest plugin.
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'webHookTeamCityRestApiZipPluginFixer' defined in Byte array resource [plugin: tcWebHooks-rest-api#tcwebhooks-rest-api-1.1-alpha13.203.278-jar-with-dependencies.jar!/META-INF/build-server-plugin-RESTListener.xml]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Illegal character in opaque part at index 11: jar:file:d:\TeamCity\bin\..\webapps\ROOT\WEB-INF\plugins\rest-api.zip at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1628) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543) at jetbrains.buildServer.plugins.spring.SpringPluginLoader.pluginClassesLoaded(SpringPluginLoader.java:102) at sun.reflect.GeneratedMethodAccessor70.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at jetbrains.buildServer.util.EventDispatcher$3.run(EventDispatcher.java:126) at jetbrains.buildServer.util.NamedThreadFactory.executeWithNewThreadName(NamedThreadFactory.java:71) at jetbrains.buildServer.util.EventDispatcher.dispatch(EventDispatcher.java:120) at jetbrains.buildServer.util.EventDispatcher$2.invoke(EventDispatcher.java:70) at com.sun.proxy.$Proxy25.pluginClassesLoaded(Unknown Source) at jetbrains.buildServer.plugins.PluginManagerImpl$2.visitPlugin(PluginManagerImpl.java:140) at jetbrains.buildServer.plugins.PluginsCollection.foreachLoadedPluginsAsync(PluginsCollection.java:277) at jetbrains.buildServer.plugins.PluginManagerImpl.firePluginClassesLoaded(PluginManagerImpl.java:138) at jetbrains.buildServer.plugins.PluginManagerImpl.loadPlugins(PluginManagerImpl.java:85) at jetbrains.buildServer.web.plugins.PluginManagerConfigurator.initializePlugins(PluginManagerConfigurator.java:15) at jetbrains.buildServer.web.impl.BuildServerConfigurator.loadConfiguration(BuildServerConfigurator.java:56) at java.util.concurrent.CopyOnWriteArrayList.forEach(CopyOnWriteArrayList.java:891) at jetbrains.buildServer.serverSide.impl.BuildServerLifecycleProcessor.doStartup(BuildServerLifecycleProcessor.java:13) at jetbrains.buildServer.maintenance.TeamCityDispatcherServlet$WebApplicationCreatorAndDestroyer.createApplication(TeamCityDispatcherServlet.java:22) at jetbrains.buildServer.maintenance.StartupProcessor.doApplicationStarting(StartupProcessor.java:736) at jetbrains.buildServer.maintenance.StartupProcessor.access$700(StartupProcessor.java:499) at jetbrains.buildServer.maintenance.StartupProcessor$3.call(StartupProcessor.java:14) at jetbrains.buildServer.util.NamedThreadFactory.executeWithNewThreadName(NamedThreadFactory.java:86) at jetbrains.buildServer.maintenance.StartupProcessor.processConcreteStage(StartupProcessor.java:806) at jetbrains.buildServer.maintenance.StartupProcessor.processConcreteStageSafe(StartupProcessor.java:311) at jetbrains.buildServer.maintenance.StartupProcessor.processTeamCityLifecycle(StartupProcessor.java:11) at jetbrains.buildServer.maintenance.StartupProcessor.access$000(StartupProcessor.java:93) at jetbrains.buildServer.maintenance.StartupProcessor$1.run(StartupProcessor.java:2) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.IllegalArgumentException: Illegal character in opaque part at index 11: jar:file:d:\TeamCity\bin\..\webapps\ROOT\WEB-INF\plugins\rest-api.zip at java.net.URI.create(URI.java:852) at webhook.teamcity.server.WebHookTeamCityRestApiZipPluginFixer.doesRestApiZipFileContainJaxJars(WebHookTeamCityRestApiZipPluginFixer.java:197) at webhook.teamcity.server.WebHookTeamCityRestApiZipPluginFixer.findRestApiZipPlugins(WebHookTeamCityRestApiZipPluginFixer.java:71) 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.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1758) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1695) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1624) ... 37 more Caused by: java.net.URISyntaxException: Illegal character in opaque part at index 11: jar:file:d:\TeamCity\bin\..\webapps\ROOT\WEB-INF\plugins\rest-api.zip at java.net.URI$Parser.fail(URI.java:2848) at java.net.URI$Parser.checkChars(URI.java:3021) at java.net.URI$Parser.parse(URI.java:3058) at java.net.URI.<init>(URI.java:588) at java.net.URI.create(URI.java:850) ... 46 more
Steps to Reproduce (for bugs)
Your Environment
Example Configuration (xml)
The text was updated successfully, but these errors were encountered: