编辑:根据Derby 社区 Eclipse 插件不会在 Derby 项目中自动维护或构建.
Edit: According to the Derby community the Eclipse plug-in won't be maintained nor built automatically along the Derby project.
但是还有人在使用这个插件吗?因为如果是这样,他/她是否有发布实际构建的地方-(希望)可以在 Eclipse Juno 下运行?
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?
原来的问题
使用
问题
尝试添加新的 derby 特性时(右键单击 java 项目 -> Apache Derby" -> 添加 Apache Derby 特性")我只收到以下消息:
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
有什么想法吗?
Apache Derby db-derby-10.9.1.0-src/Eclipse 4.2.1 (Juno)/Java 7
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.
参考:
db-derby-10.9.1.0-src/BUILDING.html
db-derby-10.8.1.2-src/plugins/eclipse/Readme.txt
References:
db-derby-10.9.1.0-src/BUILDING.html
db-derby-10.8.1.2-src/plugins/eclipse/Readme.txt
下载 Apache Derby 源 zip.
解压压缩包.
切换到源目录.
db-derby-10.9.1.0-src
Download the Apache Derby source zip.
Extract the zip.
Change to the source directory.
db-derby-10.9.1.0-src
执行以下 ant 目标.
蚂蚁 - 安静的破坏者
ant -quiet 构建源
ant -quiet buildjars
Perform the following ant targets.
ant -quiet clobber
ant -quiet buildsource
ant -quiet buildjars
构建核心插件.
蚂蚁插件
Build the core plugin.
ant plugin
您现在应该在 db-derby-10.9.1.0-src/jars/sane 目录中有一个 derby_core_plugin_10.9.1.zip 文件.
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.
注意:您的 Eclipse IDE 不应运行.提取上面 ant 插件任务创建的 derby 核心插件,并将内容复制到您的 Eclipse 插件目录.
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.
运行 Eclipse.
Run Eclipse.
从源代码树中导入 org.apache.derby.ui.
(导入 > 常规 > 现有项目到工作区)
Import the org.apache.derby.ui from the source tree.
(Import > General > Existing Projects into Workspace)
打开plugin.xml文件
Open the plugin.xml file
在概览"选项卡上,将版本号提高到 1.1.4.
On the Overview tab, bump up the version number to let's say 1.1.4.
保存文件.
错误在...
1.) 包 org.apache.derby.ui.popup.actions.AddDerbyNature.java
2.) 包 org.apache.derby.ui.popup.actions.RemoveDerbyNature.java
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
在这两个单元中调用 .setStatus 方法的地方.
Where the .setStatus method are called in these two units.
注意:(来自ApplicationWindow的javadoc)
Note: ( from the javadoc of ApplicationWindow )
void org.eclipse.jface.window.ApplicationWindow.setStatus(字符串消息)
void org.eclipse.jface.window.ApplicationWindow.setStatus(String message)
设置或清除此窗口状态行中显示的消息(如果有 >one).如果窗口没有状态行,则此方法无效.
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.
参数:
message 状态消息,或 null 清除它
Parameters:
message the status message, or null to clear it
假设 IDE 没有状态行,因此根据 Java 文档,此调用无效.
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);
测试:
作为 Eclipse 应用程序运行.
Test(s):
Run As Eclipse Application.
创建一个项目.也许称它为org.apache.derby.ui.test".
Create a project. Maybe call it "org.apache.derby.ui.test".
右键单击项目/选择添加 Apache Derby 性质
没有错误.
Right Click on project / Select Add Apache Derby nature
No error.
右键单击项目/选择删除 Apache Derby 性质
没有错误.
Right Click on project / Select Remove Apache Derby nature
No error.
再次添加性质以测试其他菜单项.
右键单击项目/选择添加 Apache Derby 性质
Add the nature again to test the other menu items.
Right Click on project / Select Add Apache Derby nature
右键单击项目/选择启动 Derby Network Server
没有错误,服务器已启动.
Right Click on project / Select Start Derby Network Server
No error, server was started.
从控制台日志...Sun Jan 27 17:51:29 EST 2013:使用基本服务器安全策略安装的安全管理器.2013 年 1 月 27 日星期日 17:51:29 EST:Apache Derby 网络服务器 - 10.9.1.0 -(未版本控制的目录)已启动并准备好接受端口 1527 上的连接
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
注意:不确定 Unversioned 目录消息的含义
Note: Not sure what the Unversioned directory message means
右键单击项目/选择停止 Derby 网络服务器
没有错误,服务器已停止.
2013 年 1 月 27 日星期日 17:53:32 EST:Apache Derby 网络服务器 - 10.9.1.0 -(未版本化目录)关闭
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 Derby Network Server
Start the server back up …
Right Click on project / Select Start Derby Network Server
创建一个 sql 文件夹.
创建一个 test.sql 文件
create a sql folder.
create a test.sql file
我的测试 sql 文件.
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;
右键单击文件 > Apache Derby > 使用 'ij' 运行 SQL 脚本
Right click on file > Apache Derby > Run SQL Script using 'ij'
刷新项目工作区,现在应该有一个 TESTDB 文件夹.
Refesh the projects workspace, now there should be a TESTDB folder.
数据库已创建.行.
创建一个拉链.
右键项目>导出
点击插件开发 > 可部署的插件和片段.
目的地标签
存档文件
/derby_ui_plugin_1.1.4-fix.zip
选项标签
取消选择包插件作为单独的 JAR 档案
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
点击完成.
关闭/退出测试实例.
退出 Eclipse.
Close / Exit the test instance.
Exit Eclipse.
从上面提取您刚刚创建的 zip.
Extract the zip that you just created from above.
将其内容复制到插件目录到您的 Eclipse (Juno) 插件目录中.
Copy it's contents to the plugins directory to your Eclipse (Juno) plugins directory.
重启 Eclipse.创建一个新项目.
Restart Eclipse. Create a new project.
您应该能够将 Apache Derby (10.9.1) 特性安装到您的项目中.
You should be able to install an Apache Derby (10.9.1) nature onto your projects.
注意:如果您使用 Java 7 构建它,不要期望它适用于任何较小的 JVM 版本.
Note: if you built this with Java 7, don't expect it to work for any lesser JVM version.
这篇关于Apache Derby Eclipse 插件去哪儿了?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!