Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id B381E2009F4 for ; Thu, 26 May 2016 11:26:01 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id B1D2F160A10; Thu, 26 May 2016 09:26:01 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id AADD8160939 for ; Thu, 26 May 2016 11:26:00 +0200 (CEST) Received: (qmail 81513 invoked by uid 500); 26 May 2016 09:25:59 -0000 Mailing-List: contact dev-help@openmeetings.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openmeetings.apache.org Delivered-To: mailing list dev@openmeetings.apache.org Received: (qmail 81501 invoked by uid 99); 26 May 2016 09:25:59 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 May 2016 09:25:59 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 34CCCC1252 for ; Thu, 26 May 2016 09:25:59 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.449 X-Spam-Level: ** X-Spam-Status: No, score=2.449 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_REPLY=1, HTML_MESSAGE=2, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001, WEIRD_PORT=0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx2-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id YN0FIDb9XFcK for ; Thu, 26 May 2016 09:25:56 +0000 (UTC) Received: from mail-pa0-f51.google.com (mail-pa0-f51.google.com [209.85.220.51]) by mx2-lw-eu.apache.org (ASF Mail Server at mx2-lw-eu.apache.org) with ESMTPS id 572535F263 for ; Thu, 26 May 2016 09:25:55 +0000 (UTC) Received: by mail-pa0-f51.google.com with SMTP id xk12so28051148pac.0 for ; Thu, 26 May 2016 02:25:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to; bh=2TN7xdZbLZayVoyKfrirvT5Tgp3jD9+ULNsWapu3P9Q=; b=HVTigWB7WJJrAKU7Gjhfv7BHTNqGG+ry5w4WTADkd3+bM+2D3U07Jd0sT2aKyGk7gc 8wCdMTfgxIBQ9hmqR2VJRm2qoHOuKJG2dChR+dN3g2MU3TJbwpwx00BwsBe0fA4Yv5hQ 4/F8KAP66ktS6cczan3tsKOsfGDHTO5D2kPWdULb5fXFd0fwo2C0B/sRVhXUNnxoYI72 RSS4L7b/lBpboJ8nXbbZZm/7pdjTyMaT7OwVv9tJxYWscpIJ9bvE9u4ZFKCdF8UK0YGK 9RlfZJ/+0zZoghj7OVCLTcbYwCGxJUbJ6+0o+N3UX6vKgcVXRsZaBdnJ31+fMRoVCuHY JjUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to; bh=2TN7xdZbLZayVoyKfrirvT5Tgp3jD9+ULNsWapu3P9Q=; b=VvlVHfXg8Wl4KE4dO0fEb5AG4O9Ag18Twfh1OOqziDuG98RSEpgJUcTmACsMBqCnB3 tUdHdgKkhbo1OXTpHZxfro0OHB+aJGSe2Xn4canFqbe1TuiMiN++gek99IfgAIBgQSj/ CEhFVKrfhvwSbqPcR4bWfVl5mebub9KYmU5tv6SxRaLWJToK++TzzP33qFSpHZo0H6Cx Rje9I8C+9Tjq1fiemeboXW7iP1bh4uOQmpJj9hJxfVWj9GGmvxDlIxg95iacewvpBsGu 4ZyGPrjMBs/6fysLm3toNj/mjEnD38dUtm5xqQ1rsQyHOduyiMN1+K1yYUMKiuCdy4Nr lNDw== X-Gm-Message-State: ALyK8tJCerNGSGVTlaikbGOJLRy9ljRtQ06uSs6b9todUh85yoHfRL4Wye3rnZnc1ZYJ9bsOTghL7adgw0BThA== MIME-Version: 1.0 X-Received: by 10.67.30.6 with SMTP id ka6mr1722134pad.120.1464254753921; Thu, 26 May 2016 02:25:53 -0700 (PDT) Received: by 10.66.252.105 with HTTP; Thu, 26 May 2016 02:25:53 -0700 (PDT) In-Reply-To: References: Date: Thu, 26 May 2016 15:25:53 +0600 Message-ID: Subject: Re: Connect to Oracle DB with Service name instead of SID From: Maxim Solodovnik To: dev Content-Type: multipart/alternative; boundary=001a1133143e77e4d70533bb6016 archived-at: Thu, 26 May 2016 09:26:01 -0000 --001a1133143e77e4d70533bb6016 Content-Type: text/plain; charset=UTF-8 I moved discussion to user list, let's continue there On Thu, May 26, 2016 at 2:57 PM, Ioannis Vlachos wrote: > This is a big email, sorry: > I was able to connect to the DB through the command line admin. I just had > to remove all parameters that had to do with the database (e.g. --db-type) > and then the script uses the persistence.xml as it is, so it can read the > /SERVICE_NAME at the end. I used the command: admin -i -v -tz Europe/Athens > -email ioannis.vlachos@gmail.com -group gspr -user admin --password admin > --system-email-address noreply@gsis.gr > > Then I had this exception: > Caused by: org.apache.openjpa.persistence.PersistenceException: ORA-00904: > : invalid identifier > {stmnt 251155815 CREATE TABLE appointment (id NUMBER NOT NULL, > is_connected_event NUMBER, deleted NUMBER, description CLOB, end TIMESTAMP, > icalId VARCHAR2(255), inserted TIMESTAMP, isdaily NUMBER, ismonthly NUMBER, > isweekly NUMBER, isyearly NUMBER, language_id NUMBER, location > VARCHAR2(255), password VARCHAR2(255), is_password_protected NUMBER, > reminder VARCHAR2(20), is_reminder_email_send NUMBER, start TIMESTAMP, > appointmentname VARCHAR2(255), updated TIMESTAMP, user_id NUMBER, room_id > NUMBER, PRIMARY KEY (id))} [code=904, state=42000] > ... > > I tried to run the create command on sql developer (directly on oracle) and > I had the same error. It turns out that the error was caused by the *start > TIMESTAMP* column. The word "start" is reserved by oracle and needs > special treatment. So I ran the command through sql developer using > *"START" > TIMESTAMP* (with the ") and the table was created. I ran again the admin > command line and it seemed to have created the DB. > > Unfortunately, it crashes later on with the stacktrace shown at the end of > the mail. It seems to have something to do with the Naviglobal entity. Any > ideas would be appreciated. I will send a mail to the users mailing list > also, in case someone has come across the same errors . > > 2016-05-26 10:56:04,134 [main] ERROR org.apache.openmeetings.cli.Admin - > Install failed > org.springframework.orm.jpa.JpaSystemException: 10; nested exception is > > org.apache.openjpa.persistence.PersistenceException: 10 > at > > org.springframework.orm.jpa.EntityManagerFactoryUtils.convertJpaAccessExceptionIfPossible(EntityManagerFactoryUtils.java:418) > at > > org.springframework.orm.jpa.DefaultJpaDialect.translateExceptionIfPossible(DefaultJpaDialect.java:122) > at > > org.springframework.orm.jpa.JpaTransactionManager.doCommit(JpaTransactionManager.java:521) > at > > org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:761) > at > > org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:730) > at > > org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:485) > at > > org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:291) > at > > org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) > at > > org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) > at > > org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:655) > at > > org.apache.openmeetings.db.dao.basic.NavigationDao$$EnhancerBySpringCGLIB$$b65241b9.addGlobalStructure() > at > > org.apache.openmeetings.installation.ImportInitvalues.loadMainMenu(ImportInitvalues.java:118) > at > > org.apache.openmeetings.installation.ImportInitvalues.loadSystem(ImportInitvalues.java:517) > at > > org.apache.openmeetings.installation.ImportInitvalues.loadAll(ImportInitvalues.java:533) > at org.apache.openmeetings.cli.Admin.process(Admin.java:278) > at org.apache.openmeetings.cli.Admin.main(Admin.java:528) > Caused by: org.apache.openjpa.persistence.PersistenceException: 10 > at > org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:2029) > at > > org.apache.openjpa.kernel.LocalManagedRuntime.commit(LocalManagedRuntime.java:81) > at org.apache.openjpa.kernel.BrokerImpl.commit(BrokerImpl.java:1526) > at > > org.apache.openjpa.kernel.DelegatingBroker.commit(DelegatingBroker.java:932) > at > > org.apache.openjpa.persistence.EntityManagerImpl.commit(EntityManagerImpl.java:571) > at > > org.springframework.orm.jpa.JpaTransactionManager.doCommit(JpaTransactionManager.java:517) > ... 13 common frames omitted > Caused by: java.lang.ArrayIndexOutOfBoundsException: 10 > at oracle.jdbc.driver.OracleSql.computeBasicInfo(OracleSql.java:950) > at oracle.jdbc.driver.OracleSql.getSqlKind(OracleSql.java:623) > at > > oracle.jdbc.driver.OraclePreparedStatement.(OraclePreparedStatement.java:1212) > at > > oracle.jdbc.driver.T4CPreparedStatement.(T4CPreparedStatement.java:28) > at > > oracle.jdbc.driver.T4CDriverExtension.allocatePreparedStatement(T4CDriverExtension.java:68) > at > > oracle.jdbc.driver.PhysicalConnection.prepareStatement(PhysicalConnection.java:3140) > at > > oracle.jdbc.driver.PhysicalConnection.prepareStatement(PhysicalConnection.java:3042) > at > > oracle.jdbc.driver.PhysicalConnection.prepareStatement(PhysicalConnection.java:6022) > at > > org.apache.commons.dbcp2.DelegatingConnection.prepareStatement(DelegatingConnection.java:807) > at > > org.apache.commons.dbcp2.DelegatingConnection.prepareStatement(DelegatingConnection.java:807) > at > > org.apache.openjpa.lib.jdbc.DelegatingConnection.prepareStatement(DelegatingConnection.java:450) > at > > org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnection.prepareStatement(LoggingConnectionDecorator.java:517) > at > > org.apache.openjpa.lib.jdbc.DelegatingConnection.prepareStatement(DelegatingConnection.java:448) > at > > org.apache.openjpa.lib.jdbc.DelegatingConnection.prepareStatement(DelegatingConnection.java:448) > at > > org.apache.openjpa.lib.jdbc.DelegatingConnection.prepareStatement(DelegatingConnection.java:441) > at > > org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.prepareStatement(PreparedStatementManagerImpl.java:288) > at > > org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushAndUpdate(PreparedStatementManagerImpl.java:113) > at > > org.apache.openjpa.jdbc.kernel.BatchingPreparedStatementManagerImpl.flushAndUpdate(BatchingPreparedStatementManagerImpl.java:79) > at > > org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushInternal(PreparedStatementManagerImpl.java:100) > at > > org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flush(PreparedStatementManagerImpl.java:88) > at > > org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:550) > at > > org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:106) > at > > org.apache.openjpa.jdbc.kernel.BatchingConstraintUpdateManager.flush(BatchingConstraintUpdateManager.java:59) > at > > org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:104) > at > > org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:77) > at > > org.apache.openjpa.jdbc.kernel.JDBCStoreManager.flush(JDBCStoreManager.java:731) > at > > org.apache.openjpa.kernel.DelegatingStoreManager.flush(DelegatingStoreManager.java:131) > at > > org.apache.openjpa.datacache.DataCacheStoreManager.flush(DataCacheStoreManager.java:668) > at > > org.apache.openjpa.kernel.DelegatingStoreManager.flush(DelegatingStoreManager.java:131) > at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2205) > at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:2103) > at > org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:2021) > ... 18 common frames omitted > > 2016-05-25 12:08 GMT+03:00 Maxim Solodovnik : > > > according to the stackowerflow connection string should be > > "*jdbc:oracle:thin:@//oracle.hostserver2.mydomain.ca:1522/ABCD > > *" > > OM requires > > host > > port > > db > > > > could you please try the following: > > host = "*//oracle.hostserver2.mydomain.ca > > *" (don't forget "//" in the > > beginning) > > port = 1521 (or other valid port) > > db = "Service Name" > > > > same options are available for command line admin > > > > > > > > On Wed, May 25, 2016 at 1:15 PM, Ioannis Vlachos < > > ioannis.vlachos@gmail.com> > > wrote: > > > > > I've done that and the web installer gives the error I've sent you. > > > Command line admin doesn't work either. There is no way (?) to specify > > > whether you want to use SID or Service name and the persistence.xml > > created > > > uses the SID syntax. > > > > > > 2016-05-25 9:34 GMT+03:00 Maxim Solodovnik : > > > > > > > Can you try to manually copy and modify oracle specific > persistense.xml > > > > And run installer? > > > > In this case db properties should not be patched > > > > > > > > WBR, Maxim > > > > (from mobile, sorry for the typos) > > > > On May 25, 2016 12:27, "Ioannis Vlachos" > > > > wrote: > > > > > > > > > screenshot: > > https://www.dropbox.com/s/k0ocnkwitak7dq3/install.PNG?dl=0 > > > > > > > > > > log: > https://www.dropbox.com/s/xe3jf9791j8h4bb/openmeetings.log?dl=0 > > > > > > > > > > > > > > > > > > > > 2016-05-25 9:14 GMT+03:00 Maxim Solodovnik : > > > > > > > > > > > Mailing list seems to drop your attachment > > > > > > Can you share the image via link? > > > > > > > > > > > > WBR, Maxim > > > > > > (from mobile, sorry for the typos) > > > > > > On May 25, 2016 12:12, "Ioannis Vlachos" < > > ioannis.vlachos@gmail.com> > > > > > > wrote: > > > > > > > > > > > > > I've already tried that (I've searched before I asked). > > > > > > > Unfortunately, openmeetings' web installer does not recognise > > that > > > > > syntax > > > > > > > and shows an error when you try to set the db (see attached > > image). > > > > If > > > > > > you > > > > > > > try to fill out the form, then the connection is made with SID. > > > > > > > > > > > > > > I haven't tried the command line admin though. I'll try it and > > come > > > > > back > > > > > > > with the results. > > > > > > > > > > > > > > > > > > > > > > > > > > > > 2016-05-24 14:41 GMT+03:00 Maxim Solodovnik < > > solomax666@gmail.com > > > >: > > > > > > > > > > > > > >> I believe this is the answer to your question: > > > > > > >> > > > > > > >> > > > > > > > > > > > > > > > > > > > > > http://stackoverflow.com/questions/4832056/java-jdbc-how-to-connect-to-oracle-using-service-name-instead-of-sid > > > > > > >> > > > > > > >> On Tue, May 24, 2016 at 3:34 PM, Ioannis Vlachos < > > > > > > >> ioannis.vlachos@gmail.com> > > > > > > >> wrote: > > > > > > >> > > > > > > >> > Hi. > > > > > > >> > In my organization we use Oracle, but we can only connect > > > through > > > > > > >> Service > > > > > > >> > Name and not SID. > > > > > > >> > Is there any way to specify Service Name instead of SID in > the > > > > > > >> connection > > > > > > >> > configuration? > > > > > > >> > All the efforts I have made result in an ora-12505 error: > tns > > > > > listener > > > > > > >> does > > > > > > >> > not currently know of sid given in connect descriptor. > > > > > > >> > > > > > > > >> > Thanks > > > > > > >> > > > > > > > >> > Ioannis Vlachos > > > > > > >> > > > > > > > >> > > > > > > >> > > > > > > >> > > > > > > >> -- > > > > > > >> WBR > > > > > > >> Maxim aka solomax > > > > > > >> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > WBR > > Maxim aka solomax > > > -- WBR Maxim aka solomax --001a1133143e77e4d70533bb6016--