Spring Application context has not been set

lamella
Contributor
March 10, 2022

I just had use the atlas-create-confluence-plugin command to create an empty confluence plugin, after plugin created, i use the atlas-run to run this empty plugin,but it run with any error, when i open the url with http://localhost:1990/confluence, it make 404, what should i do to solve this problem?

 

Version about my development environment :

windows11, idea, atlassian-plugin-sdk-8.2.7, JDK1.8, chrome 98.0.4758.102

 

The code error :

[INFO] [talledLocalContainer] java.lang.IllegalStateException: Spring Application context has not been set
[INFO] [talledLocalContainer] at com.atlassian.spring.container.SpringContainerContext.getComponent(SpringContainerContext.java:48)
[INFO] [talledLocalContainer] at com.atlassian.spring.container.ContainerManager.getComponent(ContainerManager.java:33)
[INFO] [talledLocalContainer] at com.atlassian.confluence.plugin.PluginFrameworkContextListener.getPluginSystemLifecycle(PluginFrameworkContextListener.java:187)
[INFO] [talledLocalContainer] at com.atlassian.confluence.plugin.PluginFrameworkContextListener.contextInitialized(PluginFrameworkContextListener.java:69)
[INFO] [talledLocalContainer] at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4643)
[INFO] [talledLocalContainer] at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5109)
[INFO] [talledLocalContainer] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
[INFO] [talledLocalContainer] at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:743)
[INFO] [talledLocalContainer] at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:719)
[INFO] [talledLocalContainer] at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:703)
[INFO] [talledLocalContainer] at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:986)
[INFO] [talledLocalContainer] at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1858)
[INFO] [talledLocalContainer] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[INFO] [talledLocalContainer] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[INFO] [talledLocalContainer] at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
[INFO] [talledLocalContainer] at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112)
[INFO] [talledLocalContainer] at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:772)
[INFO] [talledLocalContainer] at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:426)
[INFO] [talledLocalContainer] at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1585)
[INFO] [talledLocalContainer] at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:308)
[INFO] [talledLocalContainer] at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
[INFO] [talledLocalContainer] at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:424)
[INFO] [talledLocalContainer] at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:367)
[INFO] [talledLocalContainer] at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:969)
[INFO] [talledLocalContainer] at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:839)
[INFO] [talledLocalContainer] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
[INFO] [talledLocalContainer] at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1429)
[INFO] [talledLocalContainer] at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1419)
[INFO] [talledLocalContainer] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[INFO] [talledLocalContainer] at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
[INFO] [talledLocalContainer] at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
[INFO] [talledLocalContainer] at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:944)
[INFO] [talledLocalContainer] at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:261)
[INFO] [talledLocalContainer] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
[INFO] [talledLocalContainer] at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
[INFO] [talledLocalContainer] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
[INFO] [talledLocalContainer] at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:770)
[INFO] [talledLocalContainer] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
[INFO] [talledLocalContainer] at org.apache.catalina.startup.Catalina.start(Catalina.java:682)
[INFO] [talledLocalContainer] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[INFO] [talledLocalContainer] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[INFO] [talledLocalContainer] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[INFO] [talledLocalContainer] at java.lang.reflect.Method.invoke(Method.java:498)
[INFO] [talledLocalContainer] at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:350)
[INFO] [talledLocalContainer] at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:492)

 

1 answer

1 accepted

1 vote
Answer accepted
Andrii Maliuta
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 11, 2022
lamella
Contributor
March 13, 2022

Thanks, but this doc can't help me, i find problem in pom file with confluence.version, i update it to 7.0.5 fixed this problem, SDK create command might need an upgrade in my local.

Like Andrii Maliuta likes this
lamella
Contributor
March 17, 2022

Hi Andrey,

    Do you know how to change DB from H2 to mysql in plugin development? Or where can i find the default user/password about H2DB that jira/confluence use?

    Thanks! : )

Andrii Maliuta
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 18, 2022

Hi @lamella  ,

To access H2 for Confluence:

  1. Shut down Confluence.
  2. Back up your <confluence-home>/database directory.
  3. Launch DBVisualizer. (or other DB view tool)
  4. Choose to Create new database connection and follow the prompts to set up the connection. 
    The information you'll need is:
    Database driver: H2 embedded 
    Database Useridsa
    Database password: leave this field blank
    Database filename:<confluence-home>/database/h2db
     leave off the .h2.db file extension.
  5. Connect to the database. 

Please refer to https://confluence.atlassian.com/conf59/embedded-h2-database-792499591.html  for details

--------------------------

To change H2 to other DB - https://confluence.atlassian.com/doc/migrating-to-another-database-148867.html 

You can change the JDBC URL in  <confluence-home>/confluence.cfg.xml

Hope this helps :)

James Watts March 15, 2023

I was able to update the confluence.version and confluence.data.version in the pom.xml file which resolved the 404 error I was getting, however am left with a blank page when visiting http://localhost:1990/confluence

Log file:

127.0.0.1 - - [15/Mar/2023:14:56:12 -0500] "GET /cargocpc/index.html HTTP/1.1" 200 124
0:0:0:0:0:0:0:1 - - [15/Mar/2023:14:56:26 -0500] "GET /confluence HTTP/1.1" 302 -
0:0:0:0:0:0:0:1 - - [15/Mar/2023:14:56:26 -0500] "GET /confluence/ HTTP/1.1" 200 80
0:0:0:0:0:0:0:1 - - [15/Mar/2023:14:56:38 -0500] "GET /confluence/ HTTP/1.1" 304 -
0:0:0:0:0:0:0:1 - - [15/Mar/2023:14:56:39 -0500] "GET /confluence/ HTTP/1.1" 304 -
0:0:0:0:0:0:0:1 - - [15/Mar/2023:14:56:39 -0500] "GET /confluence/ HTTP/1.1" 304 -

lamella
Contributor
March 16, 2023

@James Watts What version of confluence are you using now? I don't know the reason for this problem, but after you change the version of confluence, you need to execute the mvn clean command, and then execute atlas-run to run your new version of confluence. If you haven't executed mvn clean, why don't you try it? Maybe this will solve your problem.

:-)

Like James Watts likes this
James Watts March 16, 2023

Thanks.  Yes, I did do a clean as well.  I decided to start fresh with atlas-create-confluence-plugin, then updated the pom, then atlas-run and it launched fine that time.  Thanks for the reply!

Like lamella likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events