Youtube Data API v3 oAuth2 failing to change permissions - youtube

I am using google's apis to create a small desktop application to make uploading videos easier to manage (I manage a network hub channel, long story as to why I need this). I've followed google's guides to get a starting point, but the authentication using oauth2 fails with the following console output:
Sep 12, 2015 9:43:29 PM com.google.api.client.util.store.FileDataStoreFactory setPermissionsToOwnerOnly
WARNING: unable to change permissions for everybody: C:\Users\BossLetsPlays\.oauth-credentials
Sep 12, 2015 9:43:29 PM com.google.api.client.util.store.FileDataStoreFactory setPermissionsToOwnerOnly
WARNING: unable to change permissions for owner: C:\Users\BossLetsPlays\.oauth-credentials
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
java.io.IOException: java.net.BindException: Address already in use: JVM_Bind
at com.google.api.client.extensions.jetty.auth.oauth2.LocalServerReceiver.getRedirectUri(LocalServerReceiver.java:107)
at com.google.api.client.extensions.java6.auth.oauth2.AuthorizationCodeInstalledApp.authorize(AuthorizationCodeInstalledApp.java:76)
at com.bossletsplays.ytclient.utils.AuthUtil.authorize(AuthUtil.java:67)
at com.bossletsplays.ytclient.utils.VideoUploader.upload(VideoUploader.java:48)
at com.bossletsplays.ytclient.gui.MainGui$4.actionPerformed(MainGui.java:152)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$500(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.net.BindException: Address already in use: JVM_Bind
at java.net.DualStackPlainSocketImpl.bind0(Native Method)
at java.net.DualStackPlainSocketImpl.socketBind(Unknown Source)
at java.net.AbstractPlainSocketImpl.bind(Unknown Source)
at java.net.PlainSocketImpl.bind(Unknown Source)
at java.net.ServerSocket.bind(Unknown Source)
at java.net.ServerSocket.<init>(Unknown Source)
at org.mortbay.jetty.bio.SocketConnector.newServerSocket(SocketConnector.java:80)
at org.mortbay.jetty.bio.SocketConnector.open(SocketConnector.java:73)
at org.mortbay.jetty.AbstractConnector.doStart(AbstractConnector.java:283)
at org.mortbay.jetty.bio.SocketConnector.doStart(SocketConnector.java:147)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.Server.doStart(Server.java:235)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at com.google.api.client.extensions.jetty.auth.oauth2.LocalServerReceiver.getRedirectUri(LocalServerReceiver.java:104)
... 40 more
I've seen the issue many places online but no working solutions. Google says the bug is fixed by throwing warnings instead of IOExceptions, but I get both warnings and IOExceptions still.
Here is the code that handles the authentication:
public static final HttpTransport HTTP_TRANSPORT = new NetHttpTransport();
public static final JsonFactory JSON_FACTORY = new JacksonFactory();
private static final String CREDENTIALS_DIRECTORY = ".oauth-credentials";
public static Credential authorize(List<String> scopes, String credentialDatastore) throws IOException {
Reader clientSecretReader = new InputStreamReader(AuthUtil.class.getResourceAsStream("/client_secrets.json"));
GoogleClientSecrets clientSecrets = GoogleClientSecrets.load(JSON_FACTORY, clientSecretReader);
System.out.println(clientSecrets.getDetails().getClientId());
if (clientSecrets.getDetails().getClientId().startsWith("Enter")
|| clientSecrets.getDetails().getClientSecret().startsWith("Enter ")) {
System.out.println(
"Enter Client ID and Secret from https://code.google.com/apis/console/?api=youtube"
+ "into src/main/resources/client_secrets.json");
System.exit(1);
}
FileDataStoreFactory fileDataStoreFactory = new FileDataStoreFactory(
new File(System.getProperty("user.home") + "/" + CREDENTIALS_DIRECTORY));
DataStore<StoredCredential> datastore = fileDataStoreFactory.getDataStore(credentialDatastore);
GoogleAuthorizationCodeFlow flow = new GoogleAuthorizationCodeFlow.Builder(
HTTP_TRANSPORT, JSON_FACTORY, clientSecrets, scopes).setCredentialDataStore(datastore)
.build();
LocalServerReceiver localReceiver = new LocalServerReceiver.Builder().setPort(8080).build();
return new AuthorizationCodeInstalledApp(flow, localReceiver).authorize("user");
}
And yes I have replaced the client id and secrets in the file.

The problem occurs in the line :
LocalServerReceiver localReceiver = new LocalServerReceiver.Builder().setPort(8080).build();
May be the port 8080 is used by another process ...
To be sure run the command :
netstat -an | grep 8080
after that search for the process and kill it

Related

Cannot connect with a backup of a derby database using Netbeans or ij

I back up regularly a derby database, that is on another server, simply by copying the location of the Derby database. So I have many backups depending on the date.
Now I am trying to connect to one of those backups from my computer, after installing Netbeans and Java 1.6 (becuase the app runs on this verion) and also installing derby.
The app connects with Java DB Network (clientDriver) and the connection URL is:
jdbc:derby://localhost:1527/C:Derby.DB
The error that I get is: Unable to connect. Cannot establish a connection to database using org.apache.derby.jdbc.ClientDriver (DERBY SQL error: ERRORCODE: 40000, SQLSTATE: XJ040, SQLERRMC: fail to start database with class loader sun.misc.Launcher$AppClassLoader#610455d6, see the next exception for details.::SQLSTATE:X0Y32
The error message associated with SQLSTATE:X0Y32 is of the form '' already exists in ''
Ive investigated a lot and tried many options with no solution.
Please help!
Thank you
Ive already tried to connect from ij and get the exact same error.
Ive tried to connect from the server and re-direct to the back database and get the exact same error.
Also, when I try to connect through the Embedded Driver, I get this error:
ij> connect 'jdbc:derby:C:/database';
---------------------------------------------------------------- Tue Apr 02 08:39:43 COT 2019: Iniciando instancia
f81e0010-0169-dae4-8f03-00000e572d50 de Derby, versi¾n The Apache
Software Foundation - Apache Derby - 10.12.1.1 - (1704137): in the
database directory using sun.misc.Launcher$AppClassLoader#66d3c617
Loaded from
file:/C:/db-derby-10.12.1.1-bin/db-derby-10.12.1.1-bin/lib/derby.jar
java.vendor=Oracle Corporation java.runtime.version=1.8.0_201-b09
user.dir=C:\ os.name=Windows 10 os.arch=amd64 os.version=10.0
derby.system.home=null Cargador de clases de base de datos iniciado -
derby.database.classpath=''
---------------------------------------------------------------- Tue Apr 02 08:39:43 COT 2019: Cerrando la instancia
f81e0010-0169-dae4-8f03-00000e572d50 en el directorio de base de datos
C:\database con cargador de clases
sun.misc.Launcher$AppClassLoader#66d3c617 Tue Apr 02 08:39:43 COT 2019
Thread[main,5,main] Cleanup action starting java.sql.SQLException:
Cannot establish a connection to database using
sun.misc.Launcher$AppClassLoader#66d3c617, consulte la excepci¾n
siguiente para obtener mßs informaci¾n.
at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown
Source)
at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown
Source)
at org.apache.derby.impl.jdbc.Util.seeNextException(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection.bootDatabase(Unknown
Source)
at org.apache.derby.impl.jdbc.EmbedConnection.(Unknown Source)
at org.apache.derby.jdbc.InternalDriver$1.run(Unknown Source)
at org.apache.derby.jdbc.InternalDriver$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.derby.jdbc.InternalDriver.getNewEmbedConnection(Unknown
Source)
at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
at org.apache.derby.jdbc.AutoloadedDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at org.apache.derby.impl.tools.ij.ij.dynamicConnection(Unknown Source)
at org.apache.derby.impl.tools.ij.ij.ConnectStatement(Unknown Source)
at org.apache.derby.impl.tools.ij.ij.ijStatement(Unknown Source)
at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(Unknown Source)
at org.apache.derby.impl.tools.ij.utilMain.go(Unknown Source)
at org.apache.derby.impl.tools.ij.Main.go(Unknown Source)
at org.apache.derby.impl.tools.ij.Main.mainCore(Unknown Source)
at org.apache.derby.impl.tools.ij.Main.main(Unknown Source)
at org.apache.derby.tools.ij.main(Unknown Source) Caused by: ERROR XJ040: Cannot establish a connection to database using
sun.misc.Launcher$AppClassLoader#66d3c617, consulte la excepci¾n
siguiente para obtener mßs informaci¾n.
at org.apache.derby.iapi.error.StandardException.newException(Unknown
Source)
at org.apache.derby.impl.jdbc.SQLExceptionFactory.wrapArgsForTransportAcrossDRDA(Unknown
Source)
... 23 more Caused by: ERROR X0Y32: Statement 'getUDTs' already exists in Schema 'SYS'.
at org.apache.derby.iapi.error.StandardException.newException(Unknown
Source)
at org.apache.derby.iapi.error.StandardException.newException(Unknown
Source)
at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.addSPSDescriptor(Unknown
Source)
at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.createSPSSet(Unknown
Source)
at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.createSystemSps(Unknown
Source)
at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.updateMetadataSPSes(Unknown
Source)
at org.apache.derby.impl.sql.catalog.DD_Version.handleMinorRevisionChange(Unknown
Source)
at org.apache.derby.impl.sql.catalog.DD_Version.upgradeIfNeeded(Unknown
Source)
at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.loadDictionaryTables(Unknown
Source)
at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.boot(Unknown
Source)
at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown
Source)
at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown
Source)
at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(Unknown
Source)
at org.apache.derby.impl.services.monitor.FileMonitor.startModule(Unknown
Source)
at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Unknown
Source)
at org.apache.derby.impl.db.BasicDatabase$5.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.derby.impl.db.BasicDatabase.bootServiceModule(Unknown
Source)
at org.apache.derby.impl.db.BasicDatabase.boot(Unknown Source)
at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown
Source)
at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown
Source)
at org.apache.derby.impl.services.monitor.BaseMonitor.bootService(Unknown
Source)
at org.apache.derby.impl.services.monitor.BaseMonitor.startProviderService(Unknown
Source)
at org.apache.derby.impl.services.monitor.BaseMonitor.findProviderAndStartService(Unknown
Source)
at org.apache.derby.impl.services.monitor.BaseMonitor.startPersistentService(Unknown
Source)
at org.apache.derby.iapi.services.monitor.Monitor.startPersistentService(Unknown
Source)
at org.apache.derby.impl.jdbc.EmbedConnection$4.run(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.derby.impl.jdbc.EmbedConnection.startPersistentService(Unknown
Source)
... 20 more
============= begin nested exception, level (1) =========== java.sql.SQLException: Statement 'getUDTs' already exists in Schema
'SYS'.
at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown
Source)
at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection.bootDatabase(Unknown
Source)
at org.apache.derby.impl.jdbc.EmbedConnection.(Unknown Source)
at org.apache.derby.jdbc.InternalDriver$1.run(Unknown Source)
at org.apache.derby.jdbc.InternalDriver$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.derby.jdbc.InternalDriver.getNewEmbedConnection(Unknown
Source)
at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
at org.apache.derby.jdbc.AutoloadedDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at org.apache.derby.impl.tools.ij.ij.dynamicConnection(Unknown Source)
at org.apache.derby.impl.tools.ij.ij.ConnectStatement(Unknown Source)
at org.apache.derby.impl.tools.ij.ij.ijStatement(Unknown Source)
at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(Unknown Source)
at org.apache.derby.impl.tools.ij.utilMain.go(Unknown Source)
at org.apache.derby.impl.tools.ij.Main.go(Unknown Source)
at org.apache.derby.impl.tools.ij.Main.mainCore(Unknown Source)
at org.apache.derby.impl.tools.ij.Main.main(Unknown Source)
at org.apache.derby.tools.ij.main(Unknown Source) Caused by: ERROR X0Y32: Statement 'getUDTs' already exists in Schema 'SYS'.
at org.apache.derby.iapi.error.StandardException.newException(Unknown
Source)
at org.apache.derby.iapi.error.StandardException.newException(Unknown
Source)
at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.addSPSDescriptor(Unknown
Source)
at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.createSPSSet(Unknown
Source)
at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.createSystemSps(Unknown
Source)
at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.updateMetadataSPSes(Unknown
Source)
at org.apache.derby.impl.sql.catalog.DD_Version.handleMinorRevisionChange(Unknown
Source)
at org.apache.derby.impl.sql.catalog.DD_Version.upgradeIfNeeded(Unknown
Source)
at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.loadDictionaryTables(Unknown
Source)
at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.boot(Unknown
Source)
at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown
Source)
at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown
Source)
at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(Unknown
Source)
at org.apache.derby.impl.services.monitor.FileMonitor.startModule(Unknown
Source)
at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Unknown
Source)
at org.apache.derby.impl.db.BasicDatabase$5.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.derby.impl.db.BasicDatabase.bootServiceModule(Unknown
Source)
at org.apache.derby.impl.db.BasicDatabase.boot(Unknown Source)
at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown
Source)
at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown
Source)
at org.apache.derby.impl.services.monitor.BaseMonitor.bootService(Unknown
Source)
at org.apache.derby.impl.services.monitor.BaseMonitor.startProviderService(Unknown
Source)
at org.apache.derby.impl.services.monitor.BaseMonitor.findProviderAndStartService(Unknown
Source)
at org.apache.derby.impl.services.monitor.BaseMonitor.startPersistentService(Unknown
Source)
at org.apache.derby.iapi.services.monitor.Monitor.startPersistentService(Unknown
Source)
at org.apache.derby.impl.jdbc.EmbedConnection$4.run(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.derby.impl.jdbc.EmbedConnection.startPersistentService(Unknown
Source)
... 20 more
============= end nested exception, level (1) ===========
============= begin nested exception, level (2) =========== ERROR X0Y32: Statement 'getUDTs' already exists in Schema 'SYS'.
at org.apache.derby.iapi.error.StandardException.newException(Unknown
Source)
at org.apache.derby.iapi.error.StandardException.newException(Unknown
Source)
at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.addSPSDescriptor(Unknown
Source)
at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.createSPSSet(Unknown
Source)
at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.createSystemSps(Unknown
Source)
at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.updateMetadataSPSes(Unknown
Source)
at org.apache.derby.impl.sql.catalog.DD_Version.handleMinorRevisionChange(Unknown
Source)
at org.apache.derby.impl.sql.catalog.DD_Version.upgradeIfNeeded(Unknown
Source)
at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.loadDictionaryTables(Unknown
Source)
at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.boot(Unknown
Source)
at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown
Source)
at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown
Source)
at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(Unknown
Source)
at org.apache.derby.impl.services.monitor.FileMonitor.startModule(Unknown
Source)
at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Unknown
Source)
at org.apache.derby.impl.db.BasicDatabase$5.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.derby.impl.db.BasicDatabase.bootServiceModule(Unknown
Source)
at org.apache.derby.impl.db.BasicDatabase.boot(Unknown Source)
at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown
Source)
at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown
Source)
at org.apache.derby.impl.services.monitor.BaseMonitor.bootService(Unknown
Source)
at org.apache.derby.impl.services.monitor.BaseMonitor.startProviderService(Unknown
Source)
at org.apache.derby.impl.services.monitor.BaseMonitor.findProviderAndStartService(Unknown
Source)
at org.apache.derby.impl.services.monitor.BaseMonitor.startPersistentService(Unknown
Source)
at org.apache.derby.iapi.services.monitor.Monitor.startPersistentService(Unknown
Source)
at org.apache.derby.impl.jdbc.EmbedConnection$4.run(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.derby.impl.jdbc.EmbedConnection.startPersistentService(Unknown
Source)
at org.apache.derby.impl.jdbc.EmbedConnection.bootDatabase(Unknown
Source)
at org.apache.derby.impl.jdbc.EmbedConnection.(Unknown Source)
at org.apache.derby.jdbc.InternalDriver$1.run(Unknown Source)
at org.apache.derby.jdbc.InternalDriver$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.derby.jdbc.InternalDriver.getNewEmbedConnection(Unknown
Source)
at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
at org.apache.derby.jdbc.AutoloadedDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at org.apache.derby.impl.tools.ij.ij.dynamicConnection(Unknown Source)
at org.apache.derby.impl.tools.ij.ij.ConnectStatement(Unknown Source)
at org.apache.derby.impl.tools.ij.ij.ijStatement(Unknown Source)
at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(Unknown Source)
at org.apache.derby.impl.tools.ij.utilMain.go(Unknown Source)
at org.apache.derby.impl.tools.ij.Main.go(Unknown Source)
at org.apache.derby.impl.tools.ij.Main.mainCore(Unknown Source)
at org.apache.derby.impl.tools.ij.Main.main(Unknown Source)
at org.apache.derby.tools.ij.main(Unknown Source)
============= end nested exception, level (2) =========== Cleanup action completed ERROR XJ040: Cannot establish a connection to
database using sun.misc.Launcher$AppClassLoader#66d3c617, consulte la
excepcion siguiente para obtener mas informacion. ERROR X0Y32:
Statement 'getUDTs' already exists in Schema 'SYS'.
Im posting this because finally I could recover the corrupted table and for somenone that would find this helpful.
What I did after replacing these files: c230.dat, c241.dat and c251.dat
I investigated how to recover corrupted tables and found this great page:
https://givemethechills.com/recovering-a-corrupted-embedded-apache-derby-database-after-an-error-xj040-or-if-you-get-an-error-xsdg2/
That basically gave these steps:
Download the latest derby bin.
Add DerbyRecovery-0.0.1-SNAPSHOT.jar to the ij classpath
Run dataFileVTI.sql (remember to change the route to the database in the connect string)
Enter ij and connect to the database using upgrade=true
Use call SYSCS_UTIL.SYSCS_REGISTER_TOOL('customTool',true,'RawDBReader', 'CONTROL','RAW_','c:db','','APP',null); -> change the db route, password, bootpassword and schema
Check with select * from raw_app.table1;
I only got the 3rd step and then decided to restore the database with this command in ij:
jdbc:derby:sample;restoreFrom=c:\Derby.DB
and this worked. After this I could access the table that I needed, with all the records.
So probably only running this command in ij worked after replacing the files, but I'm posting everything I did just in case.
Thanks to all that helped!
Karina S.
[This is not really a solution, but is too long to post as a comment.]
Someone else had the same problem as you (ERROR X0Y32: Statement 'getUDTs' already exists...). See Bug Report DERBY-5371: Database fails to boot, complaining that the getProcedureColumns() system procedure already exists
The final comment in the thread states:
I had a customer who was also hit by this problem on an old database,
with the same error that Andreas reported.
Caused by: java.sql.SQLException: Statement 'getUDTs' already exists
in Schema 'SYS'.
Running the command:
values syscs_util.syscs_get_database_property( 'DataDictionaryVersion'
)
returned 10.5.
I used the same trick of loading fresh c230.dat, c241.dat and c251.dat files in order to get the database to boot.
I'm not sure what exactly has to be done to load "fresh c230.dat, c241.dat and c251.dat files in order to get the database to boot", but if that makes sense to you it might be worth trying.

Deploying Jenkins Sectioned View Plugin extension

I want to create new view for Sectioned View Plugin for Jenkins. How should I deploy my extension? I was trying to deploy it as new plugin in .jpi file but it didn't work. Where should I put my class/jar/jpi (I don't know which is right) file?
UPD: I tried to put jar to \jenkins\plugin\sectioned-view\WEB-INF\lib directory and it works but I doubt it's a right way to deploy that extension
UPD2: When I try to deploy extension as a new plugin I get these exception on startup:
WARNING: Failed to load <packageName>.<mainExtensionClassName>$DescriptorImpl
java.lang.InstantiationException:<jenkinsDirectory>\plugins\installedapplicationssection\WEB-INF\lib\classes.jar might need to be rebuilt: java.lang.ClassNotFoundException: <packageName>.<mainExtensionClassName>$DescriptorImpl
at net.java.sezpoz.IndexItem.element(IndexItem.java:144)
at hudson.ExtensionFinder$Sezpoz._find(ExtensionFinder.java:628)
at hudson.ExtensionFinder$Sezpoz.find(ExtensionFinder.java:617)
at hudson.ExtensionFinder._find(ExtensionFinder.java:151)
at hudson.ClassicPluginStrategy.findComponents(ClassicPluginStrategy.java:316)
at hudson.ExtensionList.load(ExtensionList.java:295)
at hudson.ExtensionList.ensureLoaded(ExtensionList.java:248)
at hudson.ExtensionList.iterator(ExtensionList.java:138)
at hudson.ClassicPluginStrategy.findComponents(ClassicPluginStrategy.java:309)
at hudson.ExtensionList.load(ExtensionList.java:295)
at hudson.ExtensionList.ensureLoaded(ExtensionList.java:248)
at hudson.ExtensionList.get(ExtensionList.java:153)
at hudson.PluginManager$PluginUpdateMonitor.getInstance(PluginManager.java:1109)
at hudson.maven.PluginImpl.init(PluginImpl.java:54)
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 hudson.init.InitializerFinder.invoke(InitializerFinder.java:120)
at hudson.init.InitializerFinder$TaskImpl.run(InitializerFinder.java:184)
at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:259)
at jenkins.model.Jenkins$7.runTask(Jenkins.java:906)
at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:187)
at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:94)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: <packageName>.<mainExtensionClassName>$DescriptorImpl
at hudson.PluginManager$UberClassLoader.findClass(PluginManager.java:985)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at net.java.sezpoz.IndexItem.element(IndexItem.java:134)
But I already have this in my class:
#Extension
public static final class DescriptorImpl extends SectionedViewSectionDescriptor {
#Override
public String getDisplayName() {
return "My Section";
}
}

IO error during HTTP execution

I used the web-harvest for 5 month and I tried to get the content of webs with this syntax:
<var-def name="raw">
<html-to-xml outputtype="pretty" usecdata="false">
<http url="${URL.toString()}" />
</html-to-xml>
</var-def>
I'd gotten the content, but recently I get this error:
ERROR - IO error during HTTP execution for URL: http://google.com
org.webharvest.exception.HttpException: IO error during HTTP execution for URL: http://google.com
at org.webharvest.runtime.web.HttpClientManager.execute(Unknown Source)
at org.webharvest.runtime.processors.HttpProcessor.execute(Unknown Source)
at org.webharvest.runtime.processors.BaseProcessor.run(Unknown Source)
at org.webharvest.runtime.processors.BodyProcessor.execute(Unknown Source)
at org.webharvest.runtime.processors.BaseProcessor.getBodyTextContent(Unknown Source)
at org.webharvest.runtime.processors.BaseProcessor.getBodyTextContent(Unknown Source)
at org.webharvest.runtime.processors.BaseProcessor.getBodyTextContent(Unknown Source)
at org.webharvest.runtime.processors.HtmlToXmlProcessor.execute(Unknown Source)
at org.webharvest.runtime.processors.BaseProcessor.run(Unknown Source)
at org.webharvest.runtime.processors.BodyProcessor.execute(Unknown Source)
at org.webharvest.runtime.processors.VarDefProcessor.execute(Unknown Source)
at org.webharvest.runtime.processors.BaseProcessor.run(Unknown Source)
at org.webharvest.runtime.Scraper.execute(Unknown Source)
at org.webharvest.runtime.Scraper.execute(Unknown Source)
at org.webharvest.gui.ScraperExecutionThread.run(Unknown Source)
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at sun.reflect.GeneratedMethodAccessor18.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocke tFactory.java:140)
at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:125)
at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)
... 15 more
I tied it on another pc and it worked correctly, but on my pc I got this error.
The same happened to me, update your java version to java 8 and it should fix the issue.
http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html
Might be a firewall, or internet connection issue. Try accessing the site first, or running the application as an administrator.

Jenkins - Can't download upgrades / plugins - Proxy is already set - Able to reach .hpi via http fine in IE

I got the Windows Native .zip from Jenkins site and installed Jenkins on my machine (Win 7) as Windows service.
The nice dashboard is up and now I want to download some plugins / even upgrade the version (First) as I got the .zip few weeks back.
When I tried to upgrade / download the plugins (under Manage Jenkins), I'm getting the following error messages, any idea what I could be missing.
Under Plugin's ADVANCE tab, I have provided the proxy server and port. Another point I noticed that when I'm downloading a plugin (and it fails) showing the link to the plugin .hpi file, if I use that "http ://../../.hpi" in Internet Explorer, it pops up fine (telling me to open/save etc) so in one sense, I'm able to reach the .hpi file directly. I can download the .hpi file manually and put it under the Jenkins installation/..respective/../../folder and restart Jenkins service everytime I install a new/replace an existing .hpi, but that I dont want to do that.
Installing Plugins/Upgrades
Preparation
Checking internet connectivity
Checking update center connectivity
java.net.ConnectException: Connection refused: connect at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(Unknown Source) at java.net.PlainSocketImpl.connectToAddress(Unknown Source) at java.net.PlainSocketImpl.connect(Unknown Source) at java.net.SocksSocketImpl.connect(Unknown Source) at java.net.Socket.connect(Unknown Source) at java.net.Socket.connect(Unknown Source) at sun.net.NetworkClient.doConnect(Unknown Source) at sun.net.www.http.HttpClient.openServer(Unknown Source) at sun.net.www.http.HttpClient.openServer(Unknown Source) at sun.net.www.http.HttpClient.(Unknown Source) at sun.net.www.http.HttpClient.New(Unknown Source) at sun.net.www.http.HttpClient.New(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source) at hudson.model.UpdateCenter$UpdateCenterConfiguration.testConnection(UpdateCenter.java:860) at hudson.model.UpdateCenter$UpdateCenterConfiguration.checkUpdateCenter(UpdateCenter.java:709) at hudson.model.UpdateCenter$ConnectionCheckJob.run(UpdateCenter.java:1030) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source)
jenkins.war
Failure -
hudson.util.IOException2: Failed to download from http://updates.jenkins-ci.org/download/war/1.508/jenkins.war
at hudson.model.UpdateCenter$UpdateCenterConfiguration.download(UpdateCenter.java:782)
at hudson.model.UpdateCenter$DownloadJob._run(UpdateCenter.java:1123)
at hudson.model.UpdateCenter$DownloadJob.run(UpdateCenter.java:1101)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.net.ConnectException: Connection refused: connect
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection$6.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.net.www.protocol.http.HttpURLConnection.getChainedException(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at hudson.model.UpdateCenter$UpdateCenterConfiguration.download(UpdateCenter.java:752)
... 8 more
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at sun.net.NetworkClient.doConnect(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.<init>(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getHeaderField(Unknown Source)
at java.net.URLConnection.getHeaderFieldInt(Unknown Source)
at java.net.URLConnection.getContentLength(Unknown Source)
at hudson.model.UpdateCenter$UpdateCenterConfiguration.download(UpdateCenter.java:751)
... 8 more
Preparation
Checking internet connectivity
Checking update center connectivity
java.io.IOException: Server returned HTTP response code: 403 for URL: http://updates.jenkins-ci.org/update-center.json?uctest at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source) at hudson.model.UpdateCenter$UpdateCenterConfiguration.testConnection(UpdateCenter.java:860) at hudson.model.UpdateCenter$UpdateCenterConfiguration.checkUpdateCenter(UpdateCenter.java:709) at hudson.model.UpdateCenter$ConnectionCheckJob.run(UpdateCenter.java:1030) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source)
Timestamper
Failure -
hudson.util.IOException2: Failed to download from http://updates.jenkins-ci.org/download/plugins/timestamper/1.5.3/timestamper.hpi
at hudson.model.UpdateCenter$UpdateCenterConfiguration.download(UpdateCenter.java:782)
at hudson.model.UpdateCenter$DownloadJob._run(UpdateCenter.java:1123)
at hudson.model.UpdateCenter$InstallationJob._run(UpdateCenter.java:1285)
at hudson.model.UpdateCenter$DownloadJob.run(UpdateCenter.java:1101)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: Server returned HTTP response code: 403 for URL: http://updates.jenkins-ci.org/download/plugins/timestamper/1.5.3/timestamper.hpi
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection$6.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.net.www.protocol.http.HttpURLConnection.getChainedException(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at hudson.model.UpdateCenter$UpdateCenterConfiguration.download(UpdateCenter.java:752)
... 9 more
Caused by: java.io.IOException: Server returned HTTP response code: 403 for URL: http://updates.jenkins-ci.org/download/plugins/timestamper/1.5.3/timestamper.hpi
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getHeaderField(Unknown Source)
at java.net.URLConnection.getHeaderFieldInt(Unknown Source)
at java.net.URLConnection.getContentLength(Unknown Source)
at hudson.model.UpdateCenter$UpdateCenterConfiguration.download(UpdateCenter.java:751)
... 9 more
Since our update center server does not do any authentication and therefore never returns 403, most likely the 403 error is returned by your HTTP proxy. If I were you, I'd check the proxy user name and the password.
We should probably add a connectivity check button in the configuration page where you enter the proxy details. If you'd be so kind to file this as a ticket in https://issues.jenkins-ci.org/, I'd be happy to get to that.
Thanks Kohsuke. Issue was I was using the proxy hostname with http://proxyservername.com.
When I put "proxyservername.com", it worked. I'll open a ticket to get that "Test" Proxy connection button in. Would have been nice if (?) shows an example, but my bad.

jenkins slave on server with custom port

I've installed jenkins on suse 12.1 and changed the port in the config to 8081
/etc/sysconfig/jenkins
JENKINS_PORT="8081"
The webinterface works without any problem on this port, but when I want to start the client with JNLP he gives me the standardport:
javaws http://192.168.1.137:8080/computer/192.168.1.190/slave-agent.jnlp
Now I tried to run it with the right port:
javaws http://192.168.1.137:8081/computer/192.168.1.190/slave-agent.jnlp
But after a short time I get an error:
java.io.FileNotFoundException: http://192.168.1.137:8080/jnlpJars/remoting.jar
at sun.reflect.GeneratedConstructorAccessor1.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection$6.run(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection$6.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.net.www.protocol.http.HttpURLConnection.getChainedException(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at com.sun.deploy.net.BasicHttpRequest.doRequest(Unknown Source)
at com.sun.deploy.net.BasicHttpRequest.doGetRequestEX(Unknown Source)
at com.sun.deploy.net.DownloadEngine.actionDownload(Unknown Source)
at com.sun.deploy.net.DownloadEngine.getCacheEntry(Unknown Source)
at com.sun.deploy.net.DownloadEngine.getCacheEntry(Unknown Source)
at com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(Unknown Source)
at com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(Unknown Source)
at com.sun.deploy.net.DownloadEngine.getResource(Unknown Source)
at com.sun.javaws.LaunchDownload$DownloadTask.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.FileNotFoundException: http://192.168.1.137:8080/jnlpJars/remoting.jar
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at java.net.HttpURLConnection.getResponseCode(Unknown Source)
... 14 more
He tries the wrong port. How can I change the port correctly?
Have you updated the URL via the configuration option under Manage Jenkins → Configure System → Jenkins URL?

Resources