-
Notifications
You must be signed in to change notification settings - Fork 657
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
Add support to compile with Java 17 #4014
base: 4.10.x
Are you sure you want to change the base?
Conversation
bfac13b
to
34a1854
Compare
* @throws UnsupportedOperationException if JTA is not supported | ||
*/ | ||
UserTransaction getUserTransaction(); | ||
// TODO javax.transaction package is no longer available. Need to find a way to add this back |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
javax.transaction
is not available with JDK 17. Since this seems to be not used, removed. But need to validate the functionality.
touch(); | ||
return null; //To change body of implemented methods use File | Settings | File Templates. | ||
} | ||
// @Override |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
javax.transaction
is not available with JDK 17. Since this seems to be not used, removed. But need to validate the functionality.
@@ -55,6 +56,7 @@ | |||
* This class stores the configuration of the Carbon Server. | |||
*/ | |||
@SuppressWarnings("unused") | |||
//@Component(service = ServerConfigurationService.class) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this.
@@ -50,7 +50,7 @@ public void setSecurityManager() { | |||
String resourcePath = resourceURL.getPath(); | |||
resourcePath = resourcePath + "policy-test.policy"; | |||
System.setProperty("java.security.policy", resourcePath); | |||
System.setSecurityManager(new SecurityManager()); | |||
// System.setSecurityManager(new SecurityManager()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Security manager not working properly with Java 17. Hence need to get rid of security manager.
<class name="org.wso2.carbon.base.CarbonBaseUtilsTest" /> | ||
<!-- <class name="org.wso2.carbon.base.CarbonBaseUtilsWithIncorrectSecPolicy" />--> | ||
<class name="org.wso2.carbon.base.CarbonContextHolderBaseTest" /> | ||
<!-- <class name="org.wso2.carbon.base.ServerConfigurationTest" />--> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test was working incorrectly before. Due to a new validation added in Files API, this is failing now.
<classes> | ||
<class name="org.wso2.carbon.base.CarbonApplicationContextHolderBaseTest" /> | ||
<class name="org.wso2.carbon.base.CarbonBaseUtilsTest" /> | ||
<!-- <class name="org.wso2.carbon.base.CarbonBaseUtilsWithIncorrectSecPolicy" />--> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Security manager related functionality is not working with JDK 17.
@@ -32,7 +27,11 @@ | |||
*/ | |||
public class CarbonSecurityManager extends SecurityManager { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possibly need to remove this.
@@ -170,6 +168,11 @@ | |||
org.wso2.carbon.crypto:org.wso2.carbon.crypto.provider:${carbon.crypto.version} | |||
</bundleDef> | |||
<bundleDef>org.wso2.orbit.sun.xml.bind:jaxb:${version.org.wso2.orbit.javax.xml.bind.jaxb}</bundleDef> | |||
<!-- TODO previously javax.activation package has come from org.eclipse.osgi_3.14.0.v20190517-1309 --> | |||
<bundleDef>org.wso2.orbit.javax.activation:activation:1.1.1.wso2v4</bundleDef> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check if this is the best component to add javax.activation. Based on this, update the import packages as well.
<bundleDef>org.wso2.orbit.javax.activation:activation:1.1.1.wso2v4</bundleDef> | ||
<!-- TODO previously javax.transaction package has come from org.eclipse.osgi_3.14.0.v20190517-1309 --> | ||
<!-- TODO previously javax.xml.soap was provided by org.eclipse.osgi_3.14.0.v20190517-1309 --> | ||
<bundleDef>javax.xml.soap:javax.xml.soap-api:1.4.0</bundleDef> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check if this is the best component to add javax.xml.soap. Based on this, update the import packages as well.
@@ -170,6 +168,11 @@ | |||
org.wso2.carbon.crypto:org.wso2.carbon.crypto.provider:${carbon.crypto.version} | |||
</bundleDef> | |||
<bundleDef>org.wso2.orbit.sun.xml.bind:jaxb:${version.org.wso2.orbit.javax.xml.bind.jaxb}</bundleDef> | |||
<!-- TODO previously javax.activation package has come from org.eclipse.osgi_3.14.0.v20190517-1309 --> | |||
<bundleDef>org.wso2.orbit.javax.activation:activation:1.1.1.wso2v4</bundleDef> | |||
<!-- TODO previously javax.transaction package has come from org.eclipse.osgi_3.14.0.v20190517-1309 --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Temporarily removed the javax.transaction usages. Validate if this is actually required add a suitable dependency back.
@@ -80,6 +81,9 @@ | |||
<featureArtifactDef> | |||
org.wso2.ciphertool:org.wso2.ciphertool.feature:${version.ciphertool} | |||
</featureArtifactDef> | |||
<!-- <featureArtifactDef>--> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove commented code.
@@ -113,7 +113,7 @@ | |||
<module>org.wso2.carbon.registry.api</module> | |||
<module>org.wso2.carbon.user.api</module> | |||
<module>org.wso2.carbon.osgi.security</module> | |||
<module>org.wso2.carbon.registry.xboot</module> | |||
<!-- <module>org.wso2.carbon.registry.xboot</module>--> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove commented code.
</init-param>--> | ||
<load-on-startup>0</load-on-startup> | ||
</servlet> | ||
<!-- <servlet>--> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove commented code.
@@ -262,6 +255,9 @@ public void start(BundleContext context) throws Exception { | |||
//Registering filedownload servlet | |||
Servlet fileDownloadServlet = new ContextPathServletAdaptor(new FileDownloadServlet( | |||
context, getConfigurationContextService()), "/filedownload"); | |||
// Dictionary<String, Object> fileDownloadServletProperties = new Hashtable<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will have to migrate the filedownload and fileupload services to Whiteboard pattern.
@@ -425,6 +427,18 @@ public void registerServlet(Servlet servlet, String urlPattern, Dictionary param | |||
httpService.registerServlet(urlPattern, | |||
new FilterServletAdaptor(associatedFilter, null, adaptedJspServlet), params, httpContext); | |||
} | |||
// Dictionary<String, Object> properties = new Hashtable<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove commented code.
public TilesJspServlet(Bundle bundle, UIResourceRegistry uiResourceRegistry) { | ||
super(bundle, uiResourceRegistry); | ||
} | ||
|
||
//TODO check if this is needed | ||
@Override | ||
public void init() throws ServletException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be not needed. Validate and remove.
import javax.servlet.ServletRequest; | ||
import javax.servlet.ServletResponse; | ||
|
||
public class FilterServletAdaptor implements Servlet { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is copied from http helper component. Try to get rid of this.
return new CustomTilesInitializer(); | ||
} | ||
|
||
// @Override |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove commented code.
@@ -161,9 +161,9 @@ protected static boolean saveOriginalUrl(CarbonUIAuthenticator authenticator, | |||
} | |||
} else { | |||
if (skipLoginPage) { | |||
response.sendRedirect(contextPath + "/carbon/admin/login_action.jsp"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
redirection after management console login is still not working properly. /carbon/
part is added twice sometimes.
@@ -62,6 +73,17 @@ | |||
</exclusion> | |||
</exclusions> | |||
</dependency> | |||
<!-- <!– Adding temporarily to compile –>--> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove commented code.
@@ -71,6 +70,7 @@ | |||
* @see EmbeddedRegistry | |||
* @see UserRegistry | |||
*/ | |||
//@Component(service = RegistryService.class) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove commented code.
<groupId>org.eclipse.equinox</groupId> | ||
<artifactId>org.eclipse.equinox.http.helper</artifactId> | ||
</dependency> | ||
<!-- <dependency>--> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove commented code.
No description provided.