Apache Derby nature cannot be added [duplicate] - derby

Edit: According to the Derby community the Eclipse plug-in won't be maintained nor built automatically along the Derby project.
But is there anybody still using this plug-in? Because if so, is there a place he/she publishes the actual builds - which (hopefully) would run under Eclipse Juno?
Or, if this is a real dead end, what are the alternatives?
The original problem
Using
jdk1.7.0_03
Eclipse IDE for Java EE Developers (Win32) version Juno (build from 2012/06/14)
derby-core-plugin 10.8.2 and -ui-plugin 1.1.3 (as there is no eclipse plugin for the latest version 10.9.1.0)
Problem
When trying to add a new derby nature (right-click on the java project -> "Apache Derby" -> "Add Apache Derby nature") I only get the following message:
Apache Derby Ui Plug-in
Error adding Derby jars to the project:
org.eclipse.ui.internal.WorkbenchWindow cannot be cast to
org.eclipse.jface.window.ApplicationWindow
Any ideas?

Apache Derby db-derby-10.9.1.0-src / Eclipse 4.2.1 (Juno) / Java 7
Some kind of fix. Needs more research but this will work.
References:
db-derby-10.9.1.0-src/BUILDING.html
db-derby-10.8.1.2-src/plugins/eclipse/Readme.txt
Download the Apache Derby source zip.
Extract the zip.
Change to the source directory.
db-derby-10.9.1.0-src
Perform the following ant targets.
ant -quiet clobber
ant -quiet buildsource
ant -quiet buildjars
Build the core plugin.
ant plugin
You should now have a derby_core_plugin_10.9.1.zip file in the db-derby-10.9.1.0-src/jars/sane directory.
Note: Your Eclipse IDE should not be running.
Extract the derby core plugin created by the ant plugin task above and copy the contents to your Eclipse plugins directory.
Run Eclipse.
Import the org.apache.derby.ui from the source tree.
(Import > General > Existing Projects into Workspace)
Open the plugin.xml file
On the Overview tab, bump up the version number to let's say 1.1.4.
Save the file.
The bug(s) are in ...
1.)package org.apache.derby.ui.popup.actions.AddDerbyNature.java
2.)package org.apache.derby.ui.popup.actions.RemoveDerbyNature.java
Where the .setStatus method are called in these two units.
Note: ( from the javadoc of ApplicationWindow )
void org.eclipse.jface.window.ApplicationWindow.setStatus(String message)
Sets or clears the message displayed in this window's status line (if it has >one). This method has no effect if the window does not have a status line.
Parameters:
message the status message, or null to clear it
So let's assume the IDE doesn't have a status line, so this call has no effect according to the Java doc.
Commenting out these method calls from:
AddDerbyNature.java
//((ApplicationWindow) window).setStatus(Messages.ADDING_NATURE);
//((ApplicationWindow) window).setStatus(Messages.DERBY_NATURE_ADDED);
RemoveDerbyNature.java
//((ApplicationWindow)window).setStatus(Messages.REMOVING_NATURE);
//((ApplicationWindow)window).setStatus(Messages.DERBY_NATURE_REMOVED);
Test(s):
Run As Eclipse Application.
Create a project. Maybe call it “org.apache.derby.ui.test”.
Right Click on project / Select Add Apache Derby nature
No error.
Right Click on project / Select Remove Apache Derby nature
No error.
Add the nature again to test the other menu items.
Right Click on project / Select Add Apache Derby nature
Right Click on project / Select Start Derby Network Server
No error, server was started.
From the console log ...
Sun Jan 27 17:51:29 EST 2013 : Security manager installed using the Basic server security policy.
Sun Jan 27 17:51:29 EST 2013 : Apache Derby Network Server - 10.9.1.0 - (Unversioned directory) started and ready to accept connections on port 1527
Note: Not sure what the Unversioned directory message means
Right Click on project / Select Stop Derby Network Server
No error, server was stopped.
Sun Jan 27 17:53:32 EST 2013 : Apache Derby Network Server - 10.9.1.0 - (Unversioned directory) shutdown
Start the server back up …
Right Click on project / Select Start Derby Network Server
create a sql folder.
create a test.sql file
my test sql file.
connect 'jdbc:derby://localhost:1527/TESTDB;create=true;user=test;password=test;';
-- drop User Indexes - ignore error if first time creating
drop index UserNameIdx1;
-- drop the table if it exists - ignore error if first time creating
drop table TEST_USER;
-- create the table
create table TEST_USER (
ID integer generated by default as identity,
USER_NAME varchar(255) not null,
FIRST_NAME varchar(255),
LAST_NAME varchar(255),
PASSWORD varchar(255),
ENABLED integer,
CREATED_STAMP timestamp,
CREATED_TX_STAMP timestamp,
LAST_UPDATED_STAMP timestamp,
LAST_UPDATED_TX_STAMP timestamp,
constraint TEST_USER_PK primary key (ID)
);
-- insert some data -- oops --- will mess with the ID generator, see the alter table restart line below.
insert into TEST_USER values(0, 'admin','admin','admin','admin',1,'2013-01-18 12:00:00.000','2013-01-18 12:00:00.000','2013-01-18 12:00:00.000','2013-01-18 12:00:00.000');
-- make the USER_NAME unique
create unique index UserNameIdx1 on TEST_USER(USER_NAME);
-- reset the generator
alter table TEST_USER alter column ID restart with 1;
Right click on file > Apache Derby > Run SQL Script using 'ij'
Refesh the projects workspace, now there should be a TESTDB folder.
Database was created. Ok.
Create a zip.
Right click on project > Export
Click on Plug-in Development > Deplyable plug-ins and fragments.
Destination Tab
Archive file
/derby_ui_plugin_1.1.4-fix.zip
Options Tab
Unselect Package plugins as individual JAR archives
Click finish.
Close / Exit the test instance.
Exit Eclipse.
Extract the zip that you just created from above.
Copy it's contents to the plugins directory to your Eclipse (Juno) plugins directory.
Restart Eclipse. Create a new project.
You should be able to install an Apache Derby (10.9.1) nature onto your projects.
Note: if you built this with Java 7, don't expect it to work for any lesser JVM version.

The Derby UI plugin for Eclipse has not been maintained for several years, I believe, as none of the regular Derby committers uses that plugin, and there have not been any volunteers from the community to maintain it. So I think it only works with older versions of Eclipse.
I suspect that it is not very much work to bring it up to date to make it work with current Eclipse. If you are interested in that functionality, I'm sure the Derby community would love to hear from you!
See also: Is it possible to use derby from apache in Eclipse now that they stopped developing the derby plugin for Eclipse?

Related

Removing the proxy and host from Netbeans

I know this questions is not related to programming but I can't find the root problem of my proxy/host.
Ok, let me explain, I am in China, so I have to make use of a VPN. The software is called SSTap and because of that reason I called the host in the same way.
For the project I am trying to make I am using LibGDX and gradle ofc.
After not being able to settle a proxy I removed it, as shown in the picture it is selected as "no proxy" and there are no proxy settings, and down in the output I am getting the warning.
Is there another place to totally remove the host?
I am using "Product Version: Apache NetBeans IDE 12.3"
Thanks in advance I will write down more questions
ReEdit part:
Sorry I thought it was loaded
The warning is: Warning: Failed to parse host SSTap
The way I configure the host/proxy was in a pop-up window that have not appeared anymore and I am unable to find it after setting the host again, the only way that I know to see the host is by Tools -> Options -> General Tab, the picture is not complete but that is the path to get there
I am having difficulties to load the picture, I am in China and I am using a VPN, so it is quite hard to visualize it, since I created the account yesterday I am unable to post pictures and instead they are added by links automatically
picture/warning
enter image description here
enter image description here
I went into my gradle.properties file found in C:\Users\User. gradle inside looks like this:
## For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
#
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx1024m -XX:MaxPermSize=256m
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
#
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
#Sat Dec 25 18:51:22 CST 2021
systemProp.http.proxyHost=SSTap
systemProp.https.proxyHost=SSTap
systemProp.https.proxyPort=25378
systemProp.http.proxyPort=25378
systemProp.https.nonProxyHosts=127.0.0.1
systemProp.http.nonProxyHosts=127.0.0.1
I removed the last 6 rows,created a new project using Desktop, Android, IOs, HTML in LibGDX , trusted all the projects with gradle, classes have no packages when created, if I create them or import them by myself (in desktop project). And even if it says "cannot find symbol"(class) within the core path e.g. import com.pokedemon.game.Hello;
the code runs
A problem that I had before when trying to resolve problems was: com.android.tools.lint:lint-gradle:26.5.4
Still no packages I closed Netbeans and open it again but again no packages but the proxy and host are fixed now

Error creating driver 'Hadoop / Apache Drill' instance in DBeaver 5.3.4

I am getting below error while trying to connect to a drillbit instance running on my RHEL box from DBeaver installed on my windows machine .
Can't create driver instance
Error creating driver 'Hadoop / Apache Drill' instance.
Most likely required jar files are missing.
You should configure jars in driver settings.
Reason: can't load driver class 'org.apache.drill.jdbc.Driver'
Error creating driver 'Hadoop / Apache Drill' instance.
Most likely required jar files are missing.
You should configure jars in driver settings.
Reason: can't load driver class 'org.apache.drill.jdbc.Driver'
org.apache.drill.jdbc.Driver
org.apache.drill.jdbc.Driver
I had previous downloaded file drill-jdbc-all-1.17.0.jar and in Edit Driver setting in libraries tab added this file and it had worked for me. I had also kept drill-jdbc-all-1.17.0.jar inside installation path of DBeaver DBeaver/plugins directory. Strangely this is not working now.
I had Clicked "Add File" in Edit Connection ( Libraries tab ) to add single jar file drill-jdbc-all-.jar. Depending on situation people can "Add Folder" to add folder with Java classes/resources and "Add Artifact" to add Maven artifact (see below).
After I added jar files I was able to find all JDBC driver classes which present in these jars. Just click on the "Find Class" button and DBeaver will show all of them. In most cases there is just one driver class in the driver. Then i clicked ok and Entered port number on the other page and tried to reconnect and was able to connect fine. Also this link could be helpful.
https://dbeaver.com/docs/wiki/Database-drivers/
One thing to add...
If you're having difficulty connecting, try the following connection string with your hostname:
jdbc:drill:drillbit=localhost

VSTS and LocalDB: Failed to update database XXX because the database is read-only

We're using VSTS and we've started getting an error during the integration tests run during the continuous build process. We're using localdb in order to run the tests agains a predefined mdb file that is copied to the output folder of the unit test project.
We're using a powershell script to ensure that localdb is executing. IT has a single line:
SqlLocalDB.exe create "MSSQLLocalDB" -s
The connection string used for running the integration tests is built dynamically like this:
$"Data Source=(LocalDB)\\MSSQLLocalDB;AttachDbFilename={Path.GetDirectoryName(new Uri(Assembly.GetExecutingAssembly().CodeBase).AbsolutePath)}\\db.mdf;Integrated Security=True;MultipleActiveResultSets=True";
The only thing we've changed recently is that we've started building against .NET 4.7.1, but I think that shouldn't have any influence in these problems...
Any clues on why we've started getting these errors?
The solution to this is to ensure that the .mdf you're restoring is located in the Build agent users temp directory.
The temp directory location can be retrieved using the %TEMP% environment variable. In c#
Environment.GetEnvironmentVariable("TEMP")
You can restore using sp_attach_db
EXEC sp_attach_db #dbname = N'YourDbName', #filename1 = 'TEMPFOLDER\YourDbName.mdf'
Where TEMPFOLDER in the above line has been replace however you see fit to be the value of the TEMP environment variable.

Application Issues in Migrating Websphere from 8.0.0.10 to Liberty profile

i'm trying to migrate WAS server 8.0.0.10 to Liberty Profile. So I downloaded the Migration Tool using the "Install New Software" option in the "Help" Menu just a week ago. I selected the "Migration Tools" -> "Websphere Application Server Migration" -> "Configuration Manager" -> "Websphere Configuration Migration Toolkit for Websphere". Followed below link steps http://www.ibm.com/developerworks/websphere/library/techarticles/1404_vines2/1404_vines2.html . But while executing comments in command prompt:
wsadmin -lang jython -c "AdminTask.extractConfigProperties(['-propertiesFileName my.props'])"
Getting Below error message :
C:\Users\DSIVARAM\WAS-profiles\8.0\SFQ\bin>wsadmin(.sh/.bat) -lang jython -c "AdminTask.extractConfigProperties(['-propertiesFileName my.props'])"
WASX7209I: Connected to process "SFQ" on node SFQNode using SOAP connector; The type of process is: UnManagedProcess
WASX7411W: Ignoring the following provided option: [(.sh/.bat)]
WASX7015E: Exception running command: "AdminTask.extractConfigProperties(['-propertiesFileName my.props'])"; exception information:
com.ibm.ws.management.wasresource.common.WASResourceException: com.ibm.ws.management.wasresource.common.WASResourceException: com.ibm.ws.management.wasresource.common.WASResourceException: com.ibm.websphere.management.exception.AdminException:
ADMA0144E: Application SourcingForQuality20031104 is installed with the zero binary copy option. Applications are installed using this option in a Rational unit test environment or using AppManagement MBean API.
When an application is installed using this option it is not possible to perform any operation on this application using wsadmin or administrative console that involves accessing the application metadata or EAR file.
Such operations include view/edit application information, export, export DDL etc. The only possible operations using wsadmin or admin console are start, stop and uninstall.
If this application is installed using WSAD unit test environment then use WSAD to view/edit application information.
Please help me to sort out the issue.
If you are running your server from development tool (Eclipse/Rad), change your server publishing settings from run resources from workspace to run from server , restart and redeploy application. You should be able to export then.
You won't be able to extract application information with extractConfigProperties if you have a zero-binary installed application. I think you can limit the extent of the extract using the -filterMechanism or -configData options to just extract the configuration needed by the application without extracting the application information itself.
See http://www.ibm.com/support/knowledgecenter/SSAW57_8.5.5/com.ibm.websphere.nd.doc/ae/txml_7extractprops.html for examples.

How to set up roo to use derby client driver with DBRE addon?

How can one set up roo so that it uses derby client driver to reverse engineer existing database objects?
First, try DBRE command and see what errors do you get. Command:
> database reverse engineering --schema <your_schema_name> --package ~.domain
Then you will see what are the errors...
I needed to install addons for Derby like this:
> addon install bundle --bundleSymbolicName org.springframework.roo.wrapping.derby
> addon install bundle --bundleSymbolicName org.springframework.roo.wrapping.derbyclient
Then called:
> persistence setup --provider HIBERNATE --database DERBY
Then you would probably need to change your database.properties file in your project to contain correct location of your database. Mine settings are:
// database.password=
// database.url=jdbc\:derby\:roo_crm;
// database.username=
// database.driverClassName=org.apache.derby.jdbc.EmbeddedDriver
Again, different database (other than Derby) might have another driver and database.url.
Then I was able to generate code using DBRE Spring Roo feature like this:
> database reverse engineer --schema APP --package ~.domain
Then I have opened my project in springroo tool suite and I was able to see code in java and aspectJ.

Resources