Compare commits

...

12 Commits

Author SHA1 Message Date
kjwang
89ac637904 Fix TUP-41299 Cannot connect to Oracle with patch R2023-11 (#6693) (#6711)
Fix TUP-41299 Cannot connect to Oracle with patch R2023-11
https://jira.talendforge.org/browse/TUP-41299
2024-01-09 10:33:54 +08:00
bhe-talendbj
6d8b1b51c7 fix(TUP-41391): initialized workspace location too early (#6690) 2024-01-03 16:46:10 +08:00
hcyi
e30b1a45d2 fix(TUP-41106):Track shared mode with data collector. (#6674)
* fix(TUP-41106):Track shared mode with data collector.

* fix(TUP-41106):Track Enable Java 17 compatibility with data collector.

* fix(TUP-41106):revert Track Enable Java 17 compatibility with data
collector.
2023-12-29 15:09:29 +08:00
Oleksandr Zhelezniak
e3e23006ed feat(TDI-50721): bump connectors 1.27.28 2023-12-28 15:12:16 +02:00
bhe-talendbj
0e04133323 fix(TUP-41250): clear builtinPluginsCache (#6652)
* fix(TUP-41250): add new method to reset cache

* fix(TUP-41250): fix clear cache

* fix(TUP-41250): fix cache clear
2023-12-27 17:57:02 +08:00
bhe-talendbj
a8f2e79338 chore(TUP-40916): Studio issues if Java version is > Java 17 (#6577)
* chore(TUP-40916): validate java version

* chore(TUP-40916): update version compare

* chore(TUP-40916): update version compare

* chore(TUP-40916): update version compare

* chore(TUP-40916): update version compare
2023-12-18 14:56:41 +08:00
bhe-talendbj
6950d5cf6a chore(TUP-41184): correct maven repository id (#6625) 2023-12-11 15:42:39 +08:00
jzhao
5d8dc7531f chore(TDI-50507): bump component-runtime to 1.38.12 (#6576) 2023-11-23 10:47:17 +08:00
Oleksandr Zhelezniak
8a6b2ab76a chore(TDI-50555): bump connectors 1.27.27 2023-11-20 18:51:50 +02:00
jzhao
5d277417ae fix(TDI-50399): Json:20230227 | CVE-2023-5072 (#6562) 2023-11-20 11:51:01 +08:00
msjian
c4c8ab5ba6 fix(TDQ-21531) : fix run match analysis get error when check "store on disk"(#6549) 2023-11-10 17:45:13 +08:00
Jill Yan
f660181adf APPINT-35965 downgrade plexus-io (#6508)
* APPINT-35965 downgrade plexus-io

* APPINT-35965 downgrade plexus-io
2023-10-30 08:30:00 +08:00
21 changed files with 250 additions and 32 deletions

View File

@@ -46,7 +46,7 @@ public class MyURLClassLoader extends URLClassLoader {
private Map pclasses = new HashMap();
public MyURLClassLoader(String fileName) throws IOException {
this(new File(fileName).toURL());
this(new File(fileName).toURI().toURL());
}
public MyURLClassLoader(URL url) {

View File

@@ -85,6 +85,7 @@ import org.talend.core.context.Context;
import org.talend.core.context.RepositoryContext;
import org.talend.core.exception.TalendInternalPersistenceException;
import org.talend.core.hadoop.BigDataBasicUtil;
import org.talend.core.hadoop.IHadoopDistributionService;
import org.talend.core.model.general.ILibrariesService;
import org.talend.core.model.general.ModuleNeeded;
import org.talend.core.model.general.Project;
@@ -133,14 +134,15 @@ import org.talend.core.repository.utils.ProjectDataJsonProvider;
import org.talend.core.repository.utils.RepositoryPathProvider;
import org.talend.core.repository.utils.XmiResourceManager;
import org.talend.core.runtime.CoreRuntimePlugin;
import org.talend.core.runtime.hd.IDynamicDistributionManager;
import org.talend.core.runtime.repository.item.ItemProductKeys;
import org.talend.core.runtime.services.IGenericWizardService;
import org.talend.core.runtime.services.IMavenUIService;
import org.talend.core.runtime.util.ItemDateParser;
import org.talend.core.runtime.util.SharedStudioUtils;
import org.talend.core.service.ICoreUIService;
import org.talend.core.service.IUpdateService;
import org.talend.core.service.IDetectCVEService;
import org.talend.core.service.IUpdateService;
import org.talend.core.utils.CodesJarResourceCache;
import org.talend.cwm.helper.SubItemHelper;
import org.talend.cwm.helper.TableHelper;
@@ -2449,6 +2451,15 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
runProcessService.clearProjectRelatedSettings();
}
if (GlobalServiceRegister.getDefault().isServiceRegistered(IHadoopDistributionService.class)) {
IHadoopDistributionService hdService = GlobalServiceRegister.getDefault()
.getService(IHadoopDistributionService.class);
if (hdService != null) {
IDynamicDistributionManager dynamicDistrManager = hdService.getDynamicDistributionManager();
dynamicDistrManager.reset(null);
}
}
// clear detect CVE cache
if (GlobalServiceRegister.getDefault().isServiceRegistered(IDetectCVEService.class)) {
IDetectCVEService detectCVESvc = GlobalServiceRegister.getDefault().getService(IDetectCVEService.class);

View File

@@ -39,6 +39,9 @@ import org.talend.core.GlobalServiceRegister;
import org.talend.core.runtime.CoreRuntimePlugin;
import org.talend.core.runtime.projectsetting.ProjectPreferenceManager;
import org.talend.designer.runprocess.IRunProcessService;
import org.talend.utils.JavaVersion;
import org.talend.utils.StudioKeysFileCheck;
import org.talend.utils.VersionException;
/**
* Utilities around perl stuff. <br/>
@@ -280,6 +283,10 @@ public final class JavaUtils {
if (version == null) {
return defaultCompliance;
}
JavaVersion ver = new JavaVersion(version);
if (ver.getMajor() > 8) {
return String.valueOf(ver.getMajor());
}
if (version.startsWith(JavaCore.VERSION_1_8)) {
return JavaCore.VERSION_1_8;
}
@@ -361,4 +368,26 @@ public final class JavaUtils {
}
}
public static void validateJavaVersion() {
try {
// validate jvm which is used to start studio
StudioKeysFileCheck.validateJavaVersion();
// validate default complier's compliance level
IVMInstall install = JavaRuntime.getDefaultVMInstall();
String ver = getCompilerCompliance((IVMInstall2) install, JavaCore.VERSION_1_8);
if (new JavaVersion(ver).compareTo(new JavaVersion(StudioKeysFileCheck.JAVA_VERSION_MAXIMUM_STRING)) > 0) {
VersionException e = new VersionException(VersionException.ERR_JAVA_VERSION_NOT_SUPPORTED,
"The maximum Java version supported by Studio is " + StudioKeysFileCheck.JAVA_VERSION_MAXIMUM_STRING
+ ". Your compiler's compliance level is " + ver);
throw e;
}
} catch (Exception e1) {
if (e1 instanceof VersionException) {
throw e1;
}
ExceptionHandler.process(e1);
}
}
}

View File

@@ -31,6 +31,8 @@ public interface IDynamicDistributionManager {
public void reloadAllDynamicDistributions(IProgressMonitor monitor) throws Exception;
public void reset(IProgressMonitor monitor);
public boolean isLoaded();
public void load(IProgressMonitor monitor, boolean resetModulesCache) throws Exception;

View File

@@ -17,6 +17,7 @@ import org.eclipse.jface.preference.IPreferenceStore;
import org.talend.commons.utils.VersionUtils;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.prefs.ITalendCorePrefConstants;
import org.talend.core.runtime.util.SharedStudioUtils;
import org.talend.core.ui.CoreUIPlugin;
import org.talend.core.ui.branding.IBrandingService;
import org.talend.daikon.token.TokenGenerator;
@@ -41,6 +42,8 @@ public class DefaultTokenCollector extends AbstractTokenCollector {
private static final TokenKey OS = new TokenKey("os"); //$NON-NLS-1$
private static final TokenKey SHARE_MODE = new TokenKey("share.mode"); //$NON-NLS-1$
public static final String COLLECTOR_SYNC_NB = "COLLECTOR_SYNC_NB"; //$NON-NLS-1$
public DefaultTokenCollector() {
@@ -70,7 +73,7 @@ public class DefaultTokenCollector extends AbstractTokenCollector {
// typeStudio
if (GlobalServiceRegister.getDefault().isServiceRegistered(IBrandingService.class)) {
IBrandingService brandingService = (IBrandingService) GlobalServiceRegister.getDefault().getService(
IBrandingService brandingService = GlobalServiceRegister.getDefault().getService(
IBrandingService.class);
tokenStudioObject.put(TYPE_STUDIO.getKey(), brandingService.getAcronym());
// tokenStudioObject.put(TYPE_STUDIO.getKey(), brandingService.getShortProductName());
@@ -92,6 +95,8 @@ public class DefaultTokenCollector extends AbstractTokenCollector {
tokenStudioObject.put(STOP_COLLECTOR.getKey(), "0"); //$NON-NLS-1$
}
// Share mode
tokenStudioObject.put(SHARE_MODE.getKey(), SharedStudioUtils.isSharedStudioMode());
return tokenStudioObject;
}
}

View File

@@ -116,7 +116,17 @@
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-io</artifactId>
<version>3.4.1</version>
<version>3.2.0</version>
<exclusions><!-- fix CVE to plexus-io:3.2.0-->
<exclusion>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</exclusion>
<exclusion>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>

View File

@@ -42,7 +42,7 @@
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20230227</version>
<version>20231013</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>

View File

@@ -10,7 +10,7 @@
<artifactId>studio-tacokit-dependencies</artifactId>
<packaging>pom</packaging>
<properties>
<tacokit.components.version>1.27.26</tacokit.components.version>
<tacokit.components.version>1.27.28</tacokit.components.version>
</properties>
<repositories>
<repository>

View File

@@ -11,7 +11,7 @@
<packaging>pom</packaging>
<properties>
<tcomp.version>1.38.11</tcomp.version>
<tcomp.version>1.38.12</tcomp.version>
<slf4j.version>1.7.32</slf4j.version>
<log4j2.version>2.17.1</log4j2.version>
<reload4j.version>1.2.19</reload4j.version>

View File

@@ -11,7 +11,7 @@
<packaging>pom</packaging>
<repositories>
<repository>
<id>Talend OpenSource Release</id>
<id>talend_open</id>
<url>https://artifacts-oss.talend.com/nexus/content/repositories/TalendOpenSourceRelease/</url>
</repository>
</repositories>

View File

@@ -10,4 +10,5 @@ bin.includes = META-INF/,\
templates/,\
lib/crypto-utils.jar,\
lib/slf4j-api-1.7.25.jar,\
distribution/license.json
distribution/license.json,\
lib/jboss-marshalling-2.0.12.Final.jar

View File

@@ -278,8 +278,8 @@ public class ModulesNeededProvider {
public static void reset() {
// clean the cache
ExtensionModuleManager.getInstance().clearCache();
getModulesNeeded().clear();
getAllManagedModules().clear();
componentImportNeedsList.clear();
allManagedModules.clear();
systemModules = null;
}

View File

@@ -229,7 +229,6 @@ public abstract class AbstractLibrariesService implements ILibrariesService {
public void resetModulesNeeded() {
ModulesNeededProvider.reset();
ModuleStatusProvider.reset();
ModulesNeededProvider.getModulesNeeded().clear();
checkLibraries();
}

View File

@@ -52,7 +52,7 @@ public class HotClassLoader extends URLClassLoader {
if (pathToAdd2 != null && pathToAdd2.length() > 0) {
try {
File pathToAdd = new File(pathToAdd2).getCanonicalFile();
addURL(pathToAdd.toURL());
addURL(pathToAdd.toURI().toURL());
} catch (IOException e) {
ExceptionHandler.process(e);
}

View File

@@ -122,4 +122,6 @@ DataTransferMessages.DataTransfer_browse=B&rowse...
DataTransferMessages.ArchiveExport_selectDestinationTitle=Export to Archive File
WorkbenchMessages.ShowView_errorTitle=Problems Showing View
ComponentsManager.form.install.dialog.restart.title=Restarting Studio
ComponentsManager.form.install.dialog.restart.message=We need to restart studio to finish the installation.\n\nDo you want to restart studio right now?
ComponentsManager.form.install.dialog.restart.message=We need to restart studio to finish the installation.\n\nDo you want to restart studio right now?
JavaVersion.CheckError=Java upgrade required, minimal required java version is {0}, current version is {1}.
JavaVersion.CheckError.notSupported=The maximum Java version supported by Studio is {0}. Your current version is {1}.

View File

@@ -78,6 +78,7 @@ import org.talend.repository.ProjectManager;
import org.talend.repository.model.IRepositoryService;
import org.talend.repository.ui.login.LoginHelper;
import org.talend.utils.StudioKeysFileCheck;
import org.talend.utils.VersionException;
/**
* This class controls all aspects of the application's execution.
@@ -112,6 +113,23 @@ public class Application implements IApplication {
StudioKeysFileCheck.check(ConfigurationScope.INSTANCE.getLocation().toFile());
Display display = PlatformUI.createDisplay();
try {
StudioKeysFileCheck.validateJavaVersion();
} catch (Exception e) {
Shell shell = new Shell(display, SWT.NONE);
if (e instanceof VersionException) {
String msg = Messages.getString("JavaVersion.CheckError", StudioKeysFileCheck.JAVA_VERSION_MINIMAL_STRING,
StudioKeysFileCheck.getJavaVersion());
if (!((VersionException) e).requireUpgrade()) {
msg = Messages.getString("JavaVersion.CheckError.notSupported",
StudioKeysFileCheck.JAVA_VERSION_MAXIMUM_STRING, StudioKeysFileCheck.getJavaVersion());
}
MessageDialog.openError(shell, null, msg);
}
return IApplication.EXIT_OK;
}
try {
// TUP-5816 don't put any code ahead of this part unless you make sure it won't trigger workspace
// initialization.

View File

@@ -2848,7 +2848,7 @@ public class DatabaseForm extends AbstractForm {
File file = new File(stringToFile);
if (file != null) {
try {
MyURLClassLoader cl = new MyURLClassLoader(file.toURL());
MyURLClassLoader cl = new MyURLClassLoader(new URL[] {file.toURI().toURL()},this.getClass().getClassLoader());
Class[] classes = cl.getAssignableClasses(Driver.class);
for (Class classe : classes) {
driverClassTxt.add(classe.getName());
@@ -6109,7 +6109,7 @@ public class DatabaseForm extends AbstractForm {
File file = new File(stringToFile);
if (file != null) {
try {
MyURLClassLoader cl = new MyURLClassLoader(file.toURL());
MyURLClassLoader cl = new MyURLClassLoader(new URL[] {file.toURI().toURL()},this.getClass().getClassLoader());
Class[] classes = cl.getAssignableClasses(Driver.class);
for (Class classe : classes) {
generalJdbcClassNameText.add(classe.getName());

View File

@@ -165,6 +165,14 @@
<overWrite>false</overWrite>
<outputDirectory>${project.basedir}/tmp/org/apache/maven/maven-bom/4.0.0-alpha-5</outputDirectory>
</artifactItem>
<artifactItem>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-io</artifactId>
<version>3.2.0</version>
<type>jar</type>
<overWrite>false</overWrite>
<outputDirectory>${project.basedir}/tmp/org/codehaus/plexus/plexus-io/3.2.0</outputDirectory>
</artifactItem>
</artifactItems>
<outputDirectory>${project.basedir}/tmp</outputDirectory>
</configuration>

View File

@@ -12,40 +12,106 @@
// ============================================================================
package org.talend.utils;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.apache.commons.lang3.StringUtils;
/*
* Created by bhe on Dec 24, 2019
*/
public class JavaVersion implements Comparable<JavaVersion> {
private int major, minor, security;
private static final Logger LOGGER = Logger.getLogger(JavaVersion.class.getCanonicalName());
private int major, minor, buildNumber, security;
public JavaVersion(String v) {
parseVersion(v);
}
/**
* @return the major
*/
public int getMajor() {
return major;
}
/**
* @return the minor
*/
public int getMinor() {
return minor;
}
/**
* @return the buildNumber
*/
public int getBuildNumber() {
return buildNumber;
}
/**
* @return the security
*/
public int getSecurity() {
return security;
}
@Override
public int compareTo(JavaVersion o) {
if (this.major - o.major == 0) {
if (this.minor - o.minor == 0) {
return this.security - o.security;
if (this.buildNumber - o.buildNumber == 0) {
return this.security - o.security;
}
return this.buildNumber - o.buildNumber;
}
return this.minor - o.minor;
}
return this.major - o.major;
}
private String normalizeVersion(String v) {
v = v.replaceAll("[^\\d._]", "");
if (v.isEmpty()) {
v = "0";
}
return v;
}
private void parseVersion(String v) {
if (v == null || v.isEmpty()) {
return;
}
String[] version = v.split("[\\._]");
this.major = Integer.parseInt(version[0]);
if (version.length > 1) {
this.minor = Integer.parseInt(version[1]);
try {
this.major = Integer.parseInt(normalizeVersion(version[0]));
} catch (Exception e) {
LOGGER.log(Level.WARNING, "Major version parse error of " + v, e);
}
if (version.length > 2) {
if (version.length > 1 && !StringUtils.isEmpty(version[1])) {
try {
this.minor = Integer.parseInt(normalizeVersion(version[1]));
} catch (Exception e) {
LOGGER.log(Level.WARNING, "Minor version parse error of " + v, e);
}
}
if (version.length > 2 && !StringUtils.isEmpty(version[2])) {
try {
this.buildNumber = Integer.parseInt(normalizeVersion(version[2]));
} catch (Exception e) {
LOGGER.log(Level.WARNING, "Build number parse error of " + v, e);
}
}
if (version.length > 3 && !StringUtils.isEmpty(version[3])) {
// strip non number part if any
String securityNumber = version[version.length - 1];
String securityNumber = version[3];
for (int i = 0; i < securityNumber.length(); i++) {
char c = securityNumber.charAt(i);
if (c > '9' || c < '0') {
@@ -53,8 +119,11 @@ public class JavaVersion implements Comparable<JavaVersion> {
break;
}
}
this.security = Integer.parseInt(securityNumber);
try {
this.security = Integer.parseInt(securityNumber);
} catch (Exception e) {
LOGGER.log(Level.WARNING, "Security version parse error of " + v, e);
}
}
}
@@ -63,6 +132,7 @@ public class JavaVersion implements Comparable<JavaVersion> {
int result = 1;
result = result * prime + this.major;
result = result * prime + this.minor;
result = result * prime + this.buildNumber;
result = result * prime + this.security;
return result;
}
@@ -84,10 +154,11 @@ public class JavaVersion implements Comparable<JavaVersion> {
sb.append(".");
sb.append(this.minor);
sb.append(".");
if (this.major == 1) {
sb.append("0_");
sb.append(this.buildNumber);
if (this.security > 0) {
sb.append("_");
sb.append(this.security);
}
sb.append(this.security);
return sb.toString();
}
}
}

View File

@@ -32,10 +32,14 @@ public class StudioKeysFileCheck {
private static final String JAVA_VERSION_PROP = "java.version";
private static final String JAVA_VERSION_MINIMAL_STRING = "1.8.0_161";
public static final String JAVA_VERSION_MINIMAL_STRING = "1.8.0_161";
private static final JavaVersion JAVA_VERSION_MINIMAL = new JavaVersion(JAVA_VERSION_MINIMAL_STRING);
public static final String JAVA_VERSION_MAXIMUM_STRING = "11";
private static final JavaVersion JAVA_VERSION_MAXIMUM = new JavaVersion(JAVA_VERSION_MAXIMUM_STRING);
private StudioKeysFileCheck() {
}
@@ -64,11 +68,24 @@ public class StudioKeysFileCheck {
String currentVersion = System.getProperty(JAVA_VERSION_PROP);
JavaVersion cv = new JavaVersion(currentVersion);
if (cv.compareTo(JAVA_VERSION_MINIMAL) < 0) {
RuntimeException e = new RuntimeException(
VersionException e = new VersionException(VersionException.ERR_JAVA_VERSION_UPGRADE_REQUIRED,
"Java upgrade required, minimal required java version is " + JAVA_VERSION_MINIMAL_STRING
+ ", current version is " + currentVersion);
LOGGER.error(e);
LOGGER.error(e.getMessage(), e);
throw e;
}
JavaVersion currentMajor = new JavaVersion(String.valueOf(cv.getMajor()));
if (currentMajor.compareTo(JAVA_VERSION_MAXIMUM) > 0) {
VersionException e = new VersionException(VersionException.ERR_JAVA_VERSION_NOT_SUPPORTED,
"The maximum Java version supported by Studio is " + JAVA_VERSION_MAXIMUM_STRING
+ ". Your current version is " + currentVersion);
LOGGER.error(e.getMessage(), e);
throw e;
}
}
public static String getJavaVersion() {
return System.getProperty(JAVA_VERSION_PROP);
}
}

View File

@@ -0,0 +1,45 @@
// ============================================================================
//
// Copyright (C) 2006-2023 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.utils;
/**
* @author PCW created on Nov 20, 2023
*
*/
@SuppressWarnings("serial")
public class VersionException extends RuntimeException {
public static final int ERR_JAVA_VERSION_UPGRADE_REQUIRED = 0;
public static final int ERR_JAVA_VERSION_NOT_SUPPORTED = 1;
private int errID;
public VersionException(String msg) {
super(msg);
}
public VersionException(int errID, String msg) {
this(msg);
this.errID = errID;
}
public int getErrID() {
return this.errID;
}
public boolean requireUpgrade() {
return this.errID == ERR_JAVA_VERSION_UPGRADE_REQUIRED;
}
}