Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Suddenly having UnsupportedEncodingException GBK

I am at my wits end with this. For no apparent reason, I can no longer use the "Guess Schema" button. My suspicion is that something has changed on my Windows XP machine and I have no idea what. I've googled like crazy to try to figure this out. When I click "Guess Schema", this is what I get:
2011-02-09 16:50:09,227 WARN org.talend.commons.ui.runtime.exception.ExceptionHandler - Exception in component tJavaFlex_1
java.io.UnsupportedEncodingException: GBK
at sun.nio.cs.StreamEncoder.forOutputStreamWriter(Unknown Source)
at java.io.OutputStreamWriter.<init>(Unknown Source)
at scratch.mock_job_for_guess_schema_0_1.Mock_job_for_Guess_schema.tJavaFlex_1Process(Mock_job_for_Guess_schema.java:610)
at scratch.mock_job_for_guess_schema_0_1.Mock_job_for_Guess_schema.runJobInTOS(Mock_job_for_Guess_schema.java:951)
at scratch.mock_job_for_guess_schema_0_1.Mock_job_for_Guess_schema.main(Mock_job_for_Guess_schema.java:735)
org.talend.designer.core.ui.editor.properties.controllers.GuessSchemaProcess$1: Exception in component tJavaFlex_1
java.io.UnsupportedEncodingException: GBK
at sun.nio.cs.StreamEncoder.forOutputStreamWriter(Unknown Source)
at java.io.OutputStreamWriter.<init>(Unknown Source)
at scratch.mock_job_for_guess_schema_0_1.Mock_job_for_Guess_schema.tJavaFlex_1Process(Mock_job_for_Guess_schema.java:610)
at scratch.mock_job_for_guess_schema_0_1.Mock_job_for_Guess_schema.runJobInTOS(Mock_job_for_Guess_schema.java:951)
at scratch.mock_job_for_guess_schema_0_1.Mock_job_for_Guess_schema.main(Mock_job_for_Guess_schema.java:735)
at org.talend.designer.core.ui.editor.properties.controllers.GuessSchemaProcess.run(Unknown Source)
at org.talend.designer.core.ui.editor.properties.controllers.GuessSchemaController.runShadowProcess(Unknown Source)
at org.talend.designer.core.ui.editor.properties.controllers.GuessSchemaController.access$1(Unknown Source)
at org.talend.designer.core.ui.editor.properties.controllers.GuessSchemaController$4$1.run(Unknown Source)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4041)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3660)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.block(ModalContext.java:173)
at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:388)
at org.eclipse.jface.dialogs.ProgressMonitorDialog.run(ProgressMonitorDialog.java:507)
at org.talend.designer.core.ui.editor.properties.controllers.GuessSchemaController.useMockJob(Unknown Source)
at org.talend.designer.core.ui.editor.properties.controllers.GuessSchemaController.createButtonCommand(Unknown Source)
at org.talend.designer.core.ui.editor.properties.controllers.GuessSchemaController.access$0(Unknown Source)
at org.talend.designer.core.ui.editor.properties.controllers.GuessSchemaController$1.widgetSelected(Unknown Source)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:234)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4066)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.talend.rcp.intro.Application.start(Unknown Source)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
Does anyone have any idea what could be going on?
Labels (3)
12 Replies
Anonymous
Not applicable
Author

Sorry. I didn't give a whole lot of information. My main TOS is 4.2.0M2 but I've tried it with various TOS installations on my box and they are all acting the same.
Anonymous
Not applicable
Author

Hi
What's the version of your JRE? Is there a charsets.jar in jre path\lib? To do: try to upgrade your jdk.
Best regards
Shong
Anonymous
Not applicable
Author

I had 1.6 and 1.5 installed. I uninstalled them both and reinstalled only the latest 1.6 and I have the same behavior.
Anonymous
Not applicable
Author

Also, I looked into what GBK encoding is (seems to be Chinese something or other) - and I have no idea why my system would be trying to use this particular encoding.
And I do not have a charsets.jar in my jre/lib directory.
Additionally - here is the cmd line that is being run for the guess schema:
2011-02-10 10:19:26,057 INFO org.talend.designer.core.runprocess.Processor - Command line: C:/Program Files/Java/jre6/bin/java.exe -Xms256M -Xmx1024M -cp C:/TOS/TOS-Win32-r53829-V4.2.0M2/lib/java/javacsv.jar;C:/TOS/TOS-Win32-r53829-V4.2.0M2/lib/java/mysql-connector-java-5.1.0-bin.jar;C:/TOS/TOS-Win32-r53829-V4.2.0M2/workspace/.Java/classes;C:/TOS/TOS-Win32-r53829-V4.2.0M2/lib/java; scratch.mock_job_for_guess_schema_0_1.Mock_job_for_Guess_schema --context=TEST %*
If I run this from the command line manually, I get the same error. I've tried this with other types of databases (Oracle) and still get the same error.
One more thing, these two warnings show up in the error log at the same time I try to guess schema. I do not know if they are related (I doubt they are since this happens in all my Talend versions):
2011-02-10 10:19:19,779 WARN org.talend.core.model.metadata.MappingFileLoader - In dbms id "hive_id" mapping file, Talend types below are not bind with "java" Db types :id_Long
id_String
id_Float
id_Character
id_byte[]
id_List
id_Date
id_BigDecimal
id_Boolean
id_Short
id_Object
id_Double
id_Integer
id_Byte
2011-02-10 10:19:19,700 WARN org.talend.core.model.metadata.MappingFileLoader - In dbms id "hive_id" mapping file, Db types below are not bind with "java" Talend types :TINYINT
DOUBLE
FLOAT
INT
BOOLEAN
BIGINT
STRING
SMALLINT
NUMBER
Anonymous
Not applicable
Author

Update: Still not working. I've installed the JDK instead of just the JRE and it came with charsets.jar. I've pointed Talend at that JRE instead of the other one (and deleted the other one out of Talend's list of installed JREs). That didn't help.
I've installed the latest TOS 4.2.0M3 and created a new workspace with a new job just to test this problem out. That didn't help.
I've changed my Windows Locale settings to different languages with reboots with Talend attempts inbetween. That didn't help.
Changed the Windows locale back to English (US). That didn't help.
Getting really desperate and installed a registry cleaner. Cleaned that junk up. No help there.
I am just completely at a loss as to what has happened.
Anonymous
Not applicable
Author

hi all
you are talking about "guess schema" but what is into your javaflex ...??
2011-02-09 16:50:09,227 WARN  org.talend.commons.ui.runtime.exception.ExceptionHandler  - Exception in component tJavaFlex_1
java.io.UnsupportedEncodingException: GBK

laurent
Anonymous
Not applicable
Author

My job doesn't have a javaflex. All it has is a:
Mysql --> LogRow
My assumption concerning the javaflex is that the "guess schema" uses Talend's own javaflex component to quickly build a little java class in order to figure out the schema. I was thinking that TOS builds this in the background and then consumes the output in order to display the schema window. I didn't actually look at the java file being generated by the "guess schema" button, however - so this was just a guess.
Anonymous
Not applicable
Author

So, that got me to thinking and now I have looked at the code produced by the "guess schema" button. In that code are these lines:
String fileName = (new java.io.File(
"C:/TOS/TOS-Win32-r54685-V4.2.0M3/temp/TempGuessSchemaDelimitedFile.csv"))
.getAbsolutePath().replace("\\", "/");
com.csvreader.CsvWriter csvWriter = new com.csvreader.CsvWriter(
new java.io.BufferedWriter(
new java.io.OutputStreamWriter(
new java.io.FileOutputStream(fileName,
false), "GBK")), ';');

Note the "GBK" in there. That seems a little weird. Especially since earlier in the file there is a UTF-8 charset that is defined
private final static String utf8Charset = "UTF-8";

I am checking to see what some others TOS installations are producing with regards to this source...
Anonymous
Not applicable
Author

Someone I work with tested this out and his generated "guess schema" file also says "GBK". Bummer. I was hoping for something different.