Apache Derby Eclipse插件去了哪里? [英] Where did the Apache Derby Eclipse plug-in go?

查看:241
本文介绍了Apache Derby Eclipse插件去了哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

编辑:根据德比社区 Eclipse插件将不会沿着德比项目自动维护和修复。



但是有没有人还在使用这个插件?因为如果是这样,他/她发布实际版本的地方(希望)会在Eclipse Juno下运行吗?



或者,如果这是一个真正的死胡同,还有什么选择?






原始问题



使用




  • jdk1.7.0_03

  • Eclipse IDE for Java EE开发者(Win32)版本Juno(从2012/06/14构建)

  • derby-core-plugin 10.8.2和-ui-plugin 1.1.3(因为没有eclipse插件最新版本10.9.1.0)



问题

尝试添加一个新的德比性质(右键单击java项目 - >Apache Derby - >添加Apache Derby性质)我只收到以下消息:

  Apache Derby Ui插件
向项目添加Derby jar时出错:
org.eclipse.ui.internal.WorkbenchWindow不能转换为
org.eclipse .jface.window.ApplicationWindow

任何想法?

解决方案

Apache Derby db-derby-10.9.1.0-src / Eclipse 4.2.1(Juno)/ Java 7 >

某种修复。需要更多的研究,但这将工作。



参考:

db-derby-10.9.1.0-src / BUILDING.html

db-derby-10.8。 1.2-src / plugins / eclipse / Readme.txt



下载Apache Derby源zip。

提取zip。

更改到源目录。

db-derby-10.9.1.0-src



执行以下ant目标。

ant -quiet clobber

ant -quiet buildsource

ant -quiet buildjars



构建核心插件。

ant plugin



您现在应该在db-derby-10.9.1.0-src / jars / sane目录中有一个derby_core_plugin_10.9.1.zip文件。



注意:您的Eclipse IDE不应该运行。
提取上述ant plugin任务创建的derby核心插件,并将内容复制到Eclipse plugins目录中。



运行Eclipse。



从源代码树导入org.apache.derby.ui。

(导入>常规>现有项目进入工作区)



打开plugin.xml文件



在概览选项卡上,放大版本号,就是说1.1.4。



保存文件。



错误在...

1.)包org.apache.derby.ui.popup.actions.AddDerbyNature。 java

2.)package org.apache.derby.ui.popup.actions.RemoveDerbyNature.java



其中调用了.setStatus方法这两个单位。注意:(从ApplicationWindow的javadoc)




void org.eclipse.jface.window.ApplicationWindow.setStatus(String message)



设置或清除此窗口状态行中显示的消息(如果它有> 1)。如果窗口没有状态行,则此方法不起作用。



参数:

消息状态消息,或为空清除


所以让我们假设IDE没有状态行,所以这个调用根据Java文档没有影响。

 从以下方式注释这些方法调用:
AddDerbyNature.java
//((ApplicationWindow)窗口) .setStatus(Messages.ADDING_NATURE);
//((ApplicationWindow)窗口).setStatus(Messages.DERBY_NATURE_ADDED);

RemoveDerbyNature.java
//((ApplicationWindow )window).setStatus(Messages.REMOVING_NATURE);
//((ApplicationWindow)window).setStatus(Messages.DERBY_NATURE_REMOVED);

测试:

运行为Eclipse应用程序。



创建一个项目。也许称之为org.apache.derby.ui.test。



右键单击项目/选择添加Apache Derby性质

无错误。



右键单击项目/选择删除Apache Derby性质

无错误。



再次添加性质来测试其他菜单项。

右键单击项目/选择添加Apache Derby自然



右键单击项目/选择启动Derby网络服务器

没有错误,服务器已启动。



从控制台日志...
Sun Jan 27 17:51:29 EST 2013:使用基本服务器安全策略安装的安全管理员。
Sun Jan 27 17:51:29 EST 2013:Apache Derby网络服务器 - 10.9.1.0 - (Unversioned目录)启动并准备好接收端口1527上的连接



注意:不知道Unversioned目录消息是什么意思



右键单击项目/选择停止Derby网络服务器

无错误,服务器已停止。

Sun Jan 27 17:53:32 EST 2013:Apache Derby Network Server - 10.9.1.0 - (Unversioned directory)shutdown



启动服务器备份...

右键单击项目/选择启动Derby网络服务器



创建一个sql文件夹。

创建一个test.sql文件



我的测试sql文件。

  connect'jdbc:derby:// localhost:1527 / TESTDB; create = true; user = test; password = ; 
- 删除用户索引 - 如果首次创建
,则忽略错误b drop index UserNameIdx1;
- 删除表如果存在 - 忽略错误如果第一次创建
下拉表TEST_USER;
- 创建表
创建表TEST_USER(
ID默认生成的ID整数,
USER_NAME varchar(255)不为空,
FIRST_NAME varchar(255) ,
LAST_NAME varchar(255),
PASSWORD varchar(255),
ENABLED整数,
CREATED_STAMP时间戳,
CREATED_TX_STAMP时间戳,
LAST_UPDATED_STAMP时间戳,
LAST_UPDATED_TX_STAMP时间戳,
约束TEST_USER_PK主键(ID)
);
- 插入一些数据 - oops ---会混淆ID生成器,请参见下面的alter table restart行。
插入TEST_USER值(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');
- 使USER_NAME唯一
在TEST_USER(USER_NAME)上创建唯一索引UserNameIdx1;
- 重置生成器
alter table TEST_USER alter column ID restart with 1;

右键单击文件> Apache Derby>使用'ij'运行SQL脚本



Refesh项目工作区,现在应该有一个TESTDB文件夹。



数据库已创建。好。



创建一个zip。



右键单击项目>导出



点击插件开发>可靠的插件和片段。

目标选项卡

存档文件

/derby_ui_plugin_1.1.4-fix.zip

选项选项卡

取消选择程序包插件作为单独的JAR存档



单击完成。



关闭/退出测试实例。

退出Eclipse。



从上方提取刚刚创建的zip。



将其内容复制到plugins目录到Eclipse(Juno)plugins目录。



重新启动Eclipse。创建一个新的项目。



您应该可以将Apache Derby(10.9.1)的性质安装到项目中。注意:如果您使用Java 7构建了这一点,不要指望它适用于任何更小的JVM版本。


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.

这篇关于Apache Derby Eclipse插件去了哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆