Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/oracle/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
为ORACLE创建支持OSGi的jar(用于SpringRoo-OracleDB集成)_Spring_Oracle_Osgi - Fatal编程技术网

为ORACLE创建支持OSGi的jar(用于SpringRoo-OracleDB集成)

为ORACLE创建支持OSGi的jar(用于SpringRoo-OracleDB集成),spring,oracle,osgi,Spring,Oracle,Osgi,我正在讨论SpringRoo/OracleOSGi驱动程序问题,很多其他人都遇到了这个问题,而且似乎已经解决了 “Springsource目前无法承载OSGi包装的Oracle驱动程序”,因此您似乎需要对现有的非OSGi驱动程序进行包装 我一直在遵循Oracle11g驱动程序(版本2的驱动程序)的步骤 完全陷入了第11步 从Felix存储库中删除有故障的OSGI驱动程序: 使用“osgi ps”检索要删除的osgi包的ID 使用“osgi头”获取相应osgi包的包符号名称。可能是com.ora

我正在讨论SpringRoo/OracleOSGi驱动程序问题,很多其他人都遇到了这个问题,而且似乎已经解决了

“Springsource目前无法承载OSGi包装的Oracle驱动程序”,因此您似乎需要对现有的非OSGi驱动程序进行包装

我一直在遵循Oracle11g驱动程序(版本2的驱动程序)的步骤

完全陷入了第11步

  • 从Felix存储库中删除有故障的OSGI驱动程序:
    • 使用“osgi ps”检索要删除的osgi包的ID
    • 使用“osgi头”获取相应osgi包的包符号名称。可能是
      com.oracle.roo.jdbc.ojdbc5
      com.oracle.roo.jdbc.ojdbc6
    • 使用
      osgi卸载–bundleSymbolicName com.oracle.roo.jdbc.ojdbcx
  • 我对osgi没有任何背景知识,尽管运行时得到了
    com.sun.security.auth.module
    缺少的依赖项:

    roo> database reverse engineer --shema xxx
    
    无法通过osgi阶段从osgi卸载这些依赖项

    任何人都可以通过控制台转储命令来实现这一点,但是noddy

    非常受欢迎-Roo允许快速构建一个基本的应用程序,但是Roo oracle与其他所有应用程序的易用性和速度相比只是一个悬崖上的一滴水

    NOTE: "CMD>" indicates from the command prompt, "roo>" indicates from within the roo shell, which can be accessed from the command prompt, by typeing "roo", provided the roo binary in on the environment path.     
    
    为了解决这个问题,我做了: 在包含oracle jar文件的目录中:

    [1] CMD> mvn install:install-file -Dfile=ojdbc5-11.2.0.2.jar -DgroupId=com.oracle -DartifactId=ojdbc5 -Dversion=11.2.0.2 -Dpackaging=jar
    
    [2] start roo, and run:
    roo> addon create wrapper --topLevelPackage com.oracle.roo.JDBC --groupId com.oracle --artifactId ojdbc5 --version 11.2.0.2 --vendorName Oracle --licenseUrl http://www.oracle.com
    
    [3] need to remove some dependencies from the generated file (com.oracle.roo.jdbc.ojdbc5-11.2.0.2.0001.jar in this case), open jar in 7zip or other and edit manifest.MF file and remove from the "Import-Package:" bit in MINIFEST.MF:
    com.sun.security.auth.module
    oracle.i18n.text,
    oracle.i18n.text.converter
    oracle.ons,oracle.security.pki
    
    [4] install the following dependencies (get from http://ebr.springsource.com/repository/app/, search on this site for the groupIds below) into mvn:
    
    CMD> mvn install:install-file -Dfile=com.springsource.javax.resource-1.5.0.jar -DgroupId=javax.resource -DartifactId=com.springsource.javax.resource -Dversion=1.5.0 -Dpackaging=jar
    
    CMD> mvn install:install-file -Dfile=com.springsource.javax.transaction-1.1.0.jar -DgroupId=javax.transaction -DartifactId=com.springsource.javax.transaction -Dversion=1.1.0 -Dpackaging=jar
    
    CMD> mvn install:install-file -Dfile=ojdbc5.jar -DgroupId=com.oracle -DartifactId=ojdbc5 -Dversion=11.2.0.2 -Dpackaging=jar
    
    [5] in roo, run
    
    roo> osgi install --url file:///c:\users\alex\com.springsource.javax.transaction-1.1.0.jar
    roo> osgi install --url file:///c:\users\alex\com.springsource.javax.resource-1.5.0.jar
    roo> osgi install --url file:///c:\path\to\current\dir\oracle\file_generated_by_wrapper.jar
    
    
    [6] to check these files have made it ok type 
    
    roo> osgi ps
    
    gives:
    
    [  62] [Active     ] [    1] Spring Roo - Wrapping - jline (0.9.94.0010)
    [  63] [Active     ] [    1] Spring Roo - Wrapping - json-simple (1.1.0.0010)
    [  64] [Active     ] [    1] Spring Roo - Wrapping - protobuf-java-lite (2.3.0.0001)
    [  65] [Active     ] [    1] Spring User Agent Analysis - Client (1.0.2.RELEASE)
    [  69] [Active     ] [    1] Java Resource API (1.5.0)
    [  70] [Active     ] [    1] com-oracle-roo-jdbc (11.2.0.2_0001)
    [  72] [Installed  ] [    1] Java Transaction API (1.1.0)
    
    basically 'Active' is what you want - 
    
    run:
    
    roo> osgi start --url file:///c:\users\alex\com.springsource.javax.transaction-1.1.0.jar
    
    to change 'Installed' to 'Active'
    
    [7] in roo, run:
    roo> database reverse engineer --schema <schema>
    
    if you get a 'Framework error' then you need to open up the manifest of your jar and delete more oracle imports (the above list *should* be sufficient) - only remove from the imports section tho.
    
    once you've changed the jar, reload into OSGi with:
    
    roo> osgi uninstall --bundleSymbolicName com.oracle.roo.jdbc.ojdbc5
    roo> osgi start --url  file:///c:\users\alex\com.oracle.roo.jdbc.ojdbc5-11.2.0.2.0001.jar
    
    re-run:
    
    roo> database reverse engineer --schema <schema> 
    
    to verify. Add a table into the schema and get DBA to grant access to get stuff to actually be generated. 
    
    mvn安装:安装文件-Dfile=ojdbc5-11.2.0.2.jar-DgroupId=com.oracle-DartifactId=ojdbc5-Dversion=11.2.0.2-dpackage=jar [2] 启动roo,然后运行: roo>addon创建包装器--topLevelPackage com.oracle.roo.JDBC--groupId com.oracle--artifactId ojdbc5--11.2.0.2版--vendorName oracle--licenseUrlhttp://www.oracle.com [3] 需要从生成的文件(本例中为com.oracle.roo.jdbc.ojdbc5-11.2.0.2.0001.jar)中删除一些依赖项,在7zip或其他中打开jar,编辑manifest.MF文件并从MINIFEST.MF中的“导入包:”位中删除: com.sun.security.auth.module oracle.i18n.text, oracle.i18n.text.converter oracle.ons、oracle.security.pki [4] 安装以下依赖项(从http://ebr.springsource.com/repository/app/,在此网站上搜索以下组ID)到mvn: CMD>mvn安装:安装文件-Dfile=com.springsource.javax.resource-1.5.0.jar-DgroupId=javax.resource-DartifactId=com.springsource.javax.resource-Dversion=1.5.0-dpackage=jar CMD>mvn安装:安装文件-Dfile=com.springsource.javax.transaction-1.1.0.jar-DgroupId=javax.transaction-DartifactId=com.springsource.javax.transaction-Dversion=1.1.0-dpackage=jar CMD>mvn安装:安装文件-Dfile=ojdbc5.jar-DgroupId=com.oracle-DartifactId=ojdbc5-Dversion=11.2.0.2-dpackage=jar [5] 在roo,快跑 roo>osgi安装——urlfile:///c:\users\alex\com.springsource.javax.transaction-1.1.0.jar roo>osgi安装——urlfile:///c:\users\alex\com.springsource.javax.resource-1.5.0.jar roo>osgi安装——urlfile:///c:\path\to\current\dir\oracle\file\u由\u wrapper.jar生成 [6] 要检查这些文件是否正常,请键入 roo>osgips 给予: [62][Active][1]Spring Roo-包装-jline(0.9.94.0010) [63][Active][1]springroo-Wrapping-json-simple(1.1.0.0010) [64][Active][1]Spring Roo-包装-protobuf java lite(2.3.0.0001) [65][Active][1]Spring用户代理分析-客户端(1.0.2.版本) [69][Active][1]Java资源API(1.5.0) [70][Active][1]com oracle roo jdbc(11.2.0.2_0001) [72][已安装][1]Java事务API(1.1.0) 基本上,“主动”就是你想要的- 运行: roo>osgi开始——urlfile:///c:\users\alex\com.springsource.javax.transaction-1.1.0.jar 将“已安装”更改为“活动” [7] 在roo中,运行: roo>数据库反向工程--模式 如果出现“框架错误”,则需要打开jar清单并删除更多oracle导入(上面的列表*应该*足够了)-仅从导入部分删除。 更改jar后,使用以下命令重新加载到OSGi: roo>osgi卸载——bundleSymbolicName com.oracle.roo.jdbc.ojdbc5 roo>osgi开始——urlfile:///c:\users\alex\com.oracle.roo.jdbc.ojdbc5-11.2.0.2.0001.jar 重新运行: roo>数据库反向工程--模式 核实。在模式中添加一个表,并让DBA授予访问权,以获取实际生成的内容。
    我的帖子中提到的命令(http://nidget.wordpress.com/2011/07/21/how-to-osgify-an-oracle-jdbc-driver-with-spring-roo/)是roo命令

    roo> osgi ps
    START LEVEL 99
    ID State Level Name
    [ 0] [Active ] [ 0] System Bundle (3.0.7)
    [ 1] [Active ] [ 1] jansi (1.5)
    …
    [ 68] [Resolved ] [ 1] com-oracle-roo-jdbc (11.2.0.2_0001)
    
    这显示了com oracle roo jdbc包的id:68

    roo> osgi headers
    
    …
    com-oracle-roo-jdbc (68)
    ————————
    Bnd-LastModified = 1309962402810
    Build-Jdk = 1.6.0_07
    Built-By = jplandrain
    Bundle-Description = This bundle wraps the standard Maven artifact: ojdbc5-11.2.0.2.
    Bundle-License = http://www.oracle.com
    Bundle-ManifestVersion = 2
    Bundle-Name = com-oracle-roo-jdbc
    Bundle-SymbolicName = com.oracle.roo.jdbc.ojdbc5
    Bundle-Vendor = Oracle (wrapped into an OSGi bundle by the Spring Roo project build system)
    Bundle-Version = 11.2.0.2_0001
    Created-By = Apache Maven Bundle Plugin
    Export-Package = …
    
    检查捆绑包com oracle roo jdbc(68)的详细信息,特别是“捆绑包SYMBOLCNAME”值

    roo> osgi uninstall com.oracle.roo.jdbc.ojdbc5
    
    就这样。已删除。

    从2016年开始(Spring Roo 1.3.2),对于曾经搜索过如何卸载OSGi的用户来说,下面是对我有用的内容

    roo>osgi卸载--bundleSymbolicName“com.oracle.roo.jdbc.ojdbc6”

    捆绑包'com.oracle.roo.jdbc.ojdbc6':已卸载


    我注意到我目前的问题是Roo一直在拉10g而不是11g库的导入—目前正努力找到Roo是如何做到这一点的。在执行'roo>field string--fieldName transactionId--notNull'时,还要获取'java.lang.IllegalStateException:java.lang.IllegalArgumentException:无法获取类型的物理类型元数据',因此roo oracle integration not home和DryGet roo与oracle协同工作需要导入资源和事务(匹配上面的mvn导入)一个用于oracle ojdbc5 jar,一个用于新生成的osgi jar,确保DBA已授予对象创建权限(在用户表上?),并且Roo应开始工作。(我将修改帖子以包含所需的pom.xml导入-周一)我还必须删除
    oracle.xdb
    的导入。但在那之后,它起了作用。我不得不移走更多的,我失去了方向,又移走了几个甲骨文和太阳罐。它还显示javax.transaction依赖项