Jira Fails to Start with MalformedURLException
Symptoms
Jira fails to start.
The following appears in the atlassian-jira.log
:
2022-03-02 20:36:23,924-0700 localhost-startStop-1 ERROR [c.a.c.service.client.ClientResourceLocator]
java.net.MalformedURLException
at java.net.URL.<init>(URL.java:645)
at java.net.URL.<init>(URL.java:508)
at java.net.URL.<init>(URL.java:457)
at com.atlassian.crowd.service.client.BaseResourceLocator.getProperties(BaseResourceLocator.java:97)
at com.atlassian.crowd.service.client.ClientPropertiesImpl.newInstanceFromResourceLocator(ClientPropertiesImpl.java:176)
at com.atlassian.crowd.integration.rest.service.factory.RestCrowdHttpAuthenticationFactory.createInstance(RestCrowdHttpAuthenticationFactory.java:37)
at com.atlassian.crowd.integration.rest.service.factory.RestCrowdHttpAuthenticationFactory.<clinit>(RestCrowdHttpAuthenticationFactory.java:20)
2022-03-02 18:00:34,274-0700 localhost-startStop-1 ERROR [o.a.c.c.C.[Catalina].[localhost].[/jira]] Exception starting filter [trustedapps]
java.lang.NoClassDefFoundError: Could not initialize class com.atlassian.crowd.integration.rest.service.factory.RestCrowdHttpAuthenticationFactory
at com.atlassian.jira.security.login.SSOSeraphAuthenticator.<init>(SSOSeraphAuthenticator.java:30)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
Diagnosis
Jira is configured to use Crowd for SSO authentication.
Cause
This is known to be caused by problems in the crowd.properties file, specifically:
- It's not in the correct location.
- Linux Only: The file is not owned by the user starting up Jira, thus JIRA cannot see the file.
- The URLs in the file are malformed.
Resolution
- Ensure that the crowd.properties file is located in the following location:
- <jira-install>/atlassian-jira/WEB-INF/classes/crowd.properties
Ensure that the crowd.properties file is owned by the appropriate user:
Check the file information with:
ls -al
Change the file owner with:
chown <jirauser> crowd.properties
Verify the URLs in the file are not malformed, for example:
crowd.server.url=http\://captain-planet\:8095/crowd/services/
This should be:
crowd.server.url=http://captain-planet:8095/crowd/services/
These changes will require a restart of Jira to take effect.
If this error is happening while Crowd for SSO authentication isn't being used in your environment, please make sure that you're using the correct authenticator class in the seraph-config.xml file with the following steps:
- Open the <jira-install>/atlassian-jira/WEB-INF/classes/seraph-config.xml file
- Find the following line:
<authenticator class="com.atlassian.jira.security.login.SSOSeraphAuthenticator"/>
- Replace it with the following to comment the authenticator class for Crowd SSO:
<!-- <authenticator class="com.atlassian.jira.security.login.JiraSeraphAuthenticator"/> -->
- Find the following line:
<!--<authenticator class="com.atlassian.jira.security.login.JiraSeraphAuthenticator"/> -->
- Replace it with the following to uncomment the default authenticator class:
<authenticator class="com.atlassian.jira.security.login.JiraSeraphAuthenticator"/>
These changes will require a restart of Jira to take effect.