Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Oracle config error #676

Open
trfeldmann opened this Issue Feb 26, 2014 · 30 comments

Comments

Projects
None yet
@trfeldmann
Copy link

commented Feb 26, 2014

After configuring the oracle rdb connection, the server fails to create tables with this error:

ERROR hbm2ddl.SchemaUpdate - ORA-01754: a table may contain only one column of type LONG

Here is oracle's explanation of this:
http://stackoverflow.com/questions/13582213/why-oracle-allows-only-one-long-column-per-table

@gschueler

This comment has been minimized.

Copy link
Member

commented Feb 26, 2014

can you identify what table, field is causing the error?

@trfeldmann

This comment has been minimized.

Copy link
Author

commented Feb 26, 2014

Here is the data from the log:

http://pastebin.com/LRf050sq

On Wed, Feb 26, 2014 at 11:10 AM, Greg Schueler notifications@github.comwrote:

can you identify what table, field is causing the error?

Reply to this email directly or view it on GitHubhttps://github.com//issues/676#issuecomment-36149550
.

@gschueler

This comment has been minimized.

Copy link
Member

commented Feb 26, 2014

thanks

(pasting mailing list message here to track the fix):

Currently "message" and "title" are mapped as grails type "text".

I found this bug filed for Grails: http://jira.grails.org/browse/GRAILS-6652

the solution posted was to change the mapping to "clob".

@trfeldmann

This comment has been minimized.

Copy link
Author

commented Feb 27, 2014

So do you know where that can be modified, or will this be pushed as an update? If an update, any idea on a time table for that?

@gschueler

This comment has been minimized.

Copy link
Member

commented Feb 27, 2014

We do publish snapshots and staged versions of Rundeck that pass functional testing on bintray, so once there is a fix committed you should be able to get the snapshot build.

However I don't have a timetable for this fix, I'm sorry.  

Greg Schueler

On February 27, 2014 at 7:06:19 AM, trfeldmann (notifications@github.com) wrote:

So do you know where that can be modified, or will this be pushed as an update? If an update, any idea on a time table for that?


Reply to this email directly or view it on GitHub.

@gschueler gschueler added this to the 2.x milestone Feb 27, 2014

@gschueler gschueler added the bug label Feb 27, 2014

@trfeldmann

This comment has been minimized.

Copy link
Author

commented Jul 17, 2014

Is there any update on this? We are getting a lot of request to put operations into rundeck, but are hesitant due to the local db we are running.

@jquick

This comment has been minimized.

Copy link

commented Feb 26, 2015

I recently did a quick work around by just manually creating the tables with a script. I just changed the "long" -> "clob" and "long raw" -> "blob". There may be a better way but its working fine.

Here is the script I used to create them incase anyone else has the same issue:
http://pastebin.com/NDYt518T

@trfeldmann

This comment has been minimized.

Copy link
Author

commented Feb 27, 2015

Thank you very much Greg. Will using this option be supported under our
Rundeck Pro contract?

On Wed, Feb 25, 2015 at 7:41 PM, jquick notifications@github.com wrote:

I recently did a quick work around by just manually creating the tables
with a script. I just changed the "long" -> "clob" and "long raw" ->
"blob". There may be a better way but its working fine.

Here is the script I used to create them incase anyone else has the same
issue:
http://pastebin.com/NDYt518T


Reply to this email directly or view it on GitHub
#676 (comment).

@hipslu

This comment has been minimized.

Copy link

commented May 20, 2015

version 2.5 seems to add new tables - is there an updated version available? thank you very much!

@jquick

This comment has been minimized.

Copy link

commented May 28, 2015

It looks like they added 2 new tables in 2.5. They should both work with Oracle out of the box:

desc PROJECT
Name         Null     Type               
------------ -------- ------------------ 
ID           NOT NULL NUMBER(19)         
VERSION      NOT NULL NUMBER(19)         
DATE_CREATED NOT NULL TIMESTAMP(6)       
DESCRIPTION           VARCHAR2(255 CHAR) 
LAST_UPDATED NOT NULL TIMESTAMP(6)       
NAME         NOT NULL VARCHAR2(255 CHAR) 

desc ORCHESTRATOR
Name    Null     Type               
------- -------- ------------------ 
ID      NOT NULL NUMBER(19)         
VERSION NOT NULL NUMBER(19)         
CONTENT          LONG()             
TYPE    NOT NULL VARCHAR2(255 CHAR) 

If you want peak performance you can alter ORCHESTRATOR and set "CONTENT" to clob after.

@ikogan

This comment has been minimized.

Copy link

commented Feb 2, 2016

In an effort to be a bit more forward-proof, we setup a custom hibernate dialect:

package edu.ohio.ais.hibernate.dialect;

import org.hibernate.dialect.Oracle10gDialect;

import java.sql.Types;

/**
 * Custom Oracle dialect that fixes various issues with
 * Oracle support in Hibernate.
 */
public class OhioOracleDialect extends Oracle10gDialect {
    protected void registerLargeObjectTypeMappings() {
        registerColumnType( Types.BINARY, 2000, "raw($l)" );
        registerColumnType( Types.BINARY, "long raw" );

        registerColumnType( Types.VARBINARY, 2000, "raw($l)" );
        registerColumnType( Types.VARBINARY, "long raw" );

        registerColumnType( Types.BLOB, "blob" );
        registerColumnType( Types.CLOB, "clob" );

        registerColumnType( Types.LONGVARCHAR, "clob" );
        registerColumnType( Types.LONGVARBINARY, "long raw" );
    }
}

The major change is the Types.LONGVARCHAR registration. The original dialect simply does long.

@predatorx

This comment has been minimized.

Copy link

commented Apr 20, 2016

Is this issue still present? I am getting the same error when I try to use rundeck with Oracle 11g DB. Rundeck version is 2.6.6-1. Is there a easy location from which we can get the SQLs so that we can fix and run? I tried to find them but could not find the SQL files.

@ikogan

This comment has been minimized.

Copy link

commented Apr 20, 2016

There isn't SQL that'll fix this. You need to create a custom jar file that contains something like the above class and reference that class as your Hibernate dialect.

@predatorx

This comment has been minimized.

Copy link

commented Apr 28, 2016

Thanks iKogan. For now I have used the SQL queries from the http://pastebin.com/NDYt518T. Will check the custom jar approach.

@lamxung55

This comment has been minimized.

Copy link

commented Jul 9, 2016

Where can I change type from LONG to CLOB????
I'm using rundeck-launcher-2.6.8.jar

@jquick

This comment has been minimized.

Copy link

commented Aug 26, 2016

@ikogan do you mind stating how you got this to work. I created a jar file based on your template above, and I am able to include it in another test java file without issue. I dropped the jar file into the rundeck bootstrap so it gets picked up in the paths and loaded. I then updated the config file accordingly and it /tries/ to load the new dialect but complains about not finding the "org.hibernate.dialect.Oracle10gDialect". I am pretty sure this is included already since we can use it by default so I am not sure if I'm loading my stuff to early or what. I even tried including the hibernate jar as well but ran into more issues. Thanks for your help!

@ikogan

This comment has been minimized.

Copy link

commented Aug 26, 2016

We didn't put it in bootstrap. In a standard install based on the Rundeck RPM, we have it in /var/lib/rundeck/exp/webapp/WEB-INF/lib/ohio-commons-hibernate-oracle-1.0.0.jar.

It's been a while since I had to set this up but I believe that I tried several places, and the one we settled on is the only one that would get picked up.

@jquick

This comment has been minimized.

Copy link

commented Aug 26, 2016

@ikogan you are amazing! Dropping it in there worked like a charm. If anyone else is having issues I created a generic jar you can use and also steps to take here:
https://github.com/jquick/rundeck_oracle_dialect

@silverfisk

This comment has been minimized.

Copy link

commented Sep 1, 2016

great, thanks @ikogan! 👍

@jdesmet

This comment has been minimized.

Copy link

commented Sep 8, 2016

This issue deserves a proper fix: the use of Oracle is documented. Looking at the logfiles eyeballing the tables that are attempted to be created, the fields affected should neither be CLOB or LONG anyhow. By simply avoiding both cases we can have a better implementation. It seems to me that a sufficiently big sized VARCHAR will cover.

CLOB and LONG are treated very differently on databases - in the case of Oracle it can cause the field to be stored on dedicated table separate from the original. This will negatively affect the database.
I think it is ok, to xxx on a field-size of VARCHAR2(50) for something like a node_include_os_version, or VARCHAR2(2000) for something like adhoc_filepath.

There were just poor design choices made causing a poor schema to be created (or in the case of Oracle an invalid one). Anyone attempting just to replace LONG with CLOB will just trade one bad for another.

Maybe these design choices are not as bad for MySQL or HSQLDB. Maybe 'support' for Oracle should be simply dropped?

@admun

This comment has been minimized.

Copy link

commented Feb 17, 2017

any update on this? I just got hit by this issue.

@admun

This comment has been minimized.

Copy link

commented Feb 17, 2017

@jquick I tried your rundeck dialect on 2.7.2 and it's failed with

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManagerPostProcessor': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is org.hibernate.boot.registry.selector.spi.StrategySelectionException: Unable to resolve name [com.rundeck.hibernate.RundeckOracleDialect] as strategy [org.hibernate.dialect.Dialect]

@ikogan

This comment has been minimized.

Copy link

commented Feb 17, 2017

Where did you put the jar file?

@admun

This comment has been minimized.

Copy link

commented Feb 18, 2017

The same lib/ directory where the rest of things are:

javax.servlet-3.0.0.v201112011016.jar jetty-security-9.0.7.v20131107.jar log4j-1.2.16.jar
jetty-all-9.0.7.v20131107.jar jetty-server-9.0.7.v20131107.jar not-yet-commons-ssl-0.3.11.jar
jetty-http-9.0.7.v20131107.jar jetty-util-9.0.7.v20131107.jar ojdbc6.jar
jetty-io-9.0.7.v20131107.jar jna-3.2.2.jar rundeck-jetty-server-2.7.2.jar
jetty-jaas-9.0.7.v20131107.jar libpam4j-1.5.jar rundeck-oracle-dialect.jar

@jquick

This comment has been minimized.

Copy link

commented Feb 18, 2017

on my install those look to be the bootstrap jars:
/var/lib/rundeck/bootstrap/
You have to put it deeper here:
/var/lib/rundeck/exp/webapp/WEB-INF/lib

ones around it should look like:

-rw-r--r-- 1 root root 1211862 Aug  3  2016 rundeck-core-2.6.9.jar
-rw-r--r-- 1 root root     956 Oct  6 16:51 rundeck-oracle-dialect.jar
-rw-r--r-- 1 root root   20432 Aug  3  2016 rundeck-storage-api-2.6.9.jar
-rw-r--r-- 1 root root   15689 Aug  3  2016 rundeck-storage-conf-2.6.9.jar
-rw-r--r-- 1 root root   10311 Aug  3  2016 rundeck-storage-data-2.6.9.jar
-rw-r--r-- 1 root root   13602 Aug  3  2016 rundeck-storage-filesys-2.6.9.jar
@admun

This comment has been minimized.

Copy link

commented Feb 20, 2017

hum... I am still seeing the error after I put the rundeck-oracle-dialect.jar in rundeck/exp/webapp/WEB-INF/lib.

weird thing is I saw that jar disappeared after I start rundeck....

Note, I am running 2.7.2.

org.hibernate.boot.registry.selector.spi.StrategySelectionException: Unable to resolve name [com.rundeck.hibernate.RundeckOracleDialect] as strategy [org.hibernate.dialect.Dialect]

@jquick

This comment has been minimized.

Copy link

commented Feb 21, 2017

Very odd, I recently upgraded our test boxes to 2.7.2 and they are working as expected. Can you change the ownership to root? I think this is the default for the deb package and make it so the rundeck process cant redo them. I suspect you are using the jar version or something else which may flash this folder on boot.

@admun

This comment has been minimized.

Copy link

commented Feb 21, 2017

ah!

That might explain it.

I am using the rundeck-launcher-2.7.2.jar. So, all the other jars are not used at all in that case?

So, is that a way to run this w/ rundeck-launcher?

Another error I am seeing is (when not seeing the dialect class to test loading)

2017-02-22 09:41:36,218 ERROR JarPluginProviderLoader - /somepath/Current/rundeck/libext/rundeck-oracle-dialect.jar: Jar plugin manifest attribute missing: Rundeck-Plugin-Archive

Thanks for the help

@jquick

This comment has been minimized.

Copy link

commented Feb 23, 2017

yeah i dont think it will work in libext thats for like plugins. I am not sure how to configure this with the jar version having never used it myself. My only guess would be to mess with the permissions so it cant remove it.

@kishorej

This comment has been minimized.

Copy link

commented Oct 13, 2017

I am trying to install Rundeck 2.9.3 with Oracle DB and using starting with java -jar run*.jar and gettting the below error. Could you please anyone help to resolve this issue.

2017-10-13 03:24:02,197 [main] ERROR context.GrailsContextLoaderListener - Error initializing the application: Error creating bean with name 'transactionManagerPostProcessor': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is java.lang.NullPointerException
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManagerPostProcessor': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is java.lang.NullPointerException
at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:788)
at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:434)
at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:780)
at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:284)
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1322)
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:732)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:490)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:69)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:118)
at org.eclipse.jetty.server.Server.start(Server.java:342)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:100)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:60)
at org.eclipse.jetty.server.Server.doStart(Server.java:290)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:69)
at com.dtolabs.rundeck.RunServer.run(RunServer.java:119)
at com.dtolabs.rundeck.RunServer.main(RunServer.java:79)
at com.dtolabs.rundeck.ExpandRunServer.invokeMain(ExpandRunServer.java:752)
at com.dtolabs.rundeck.ExpandRunServer.execute(ExpandRunServer.java:709)
at com.dtolabs.rundeck.ExpandRunServer.run(ExpandRunServer.java:309)
at com.dtolabs.rundeck.ExpandRunServer.main(ExpandRunServer.java:113)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is java.lang.NullPointerException
... 20 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is java.lang.NullPointerException
... 20 more
Caused by: java.lang.NullPointerException
... 20 more

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.