Невозможно открыть файл rpt из-за этой ошибки: Ошибка входа: ORA-01017: неверное имя пользователя / пароль;вход запрещен - PullRequest
0 голосов
/ 08 апреля 2019

Каждый раз, когда я запускаю приложение java, ошибка всегда показывает, что я не могу открыть файл rpt из-за этой ошибки:

    java.lang.IllegalStateException: Failed to execute CommandLineRunner
    at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:735) [spring-boot-1.5.19.RELEASE.jar:1.5.19.RELEASE]
    at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:716) [spring-boot-1.5.19.RELEASE.jar:1.5.19.RELEASE]
    at org.springframework.boot.SpringApplication.afterRefresh(SpringApplication.java:703) [spring-boot-1.5.19.RELEASE.jar:1.5.19.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:304) [spring-boot-1.5.19.RELEASE.jar:1.5.19.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118) [spring-boot-1.5.19.RELEASE.jar:1.5.19.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107) [spring-boot-1.5.19.RELEASE.jar:1.5.19.RELEASE]
    at com.pnb.allianz.Application.main(Application.java:12) [classes/:na]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_181]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_181]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_181]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.8.0_181]
    at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) [spring-boot-devtools-1.5.19.RELEASE.jar:1.5.19.RELEASE]
Caused by: com.crystaldecisions.sdk.occa.report.lib.ReportSDKLogonException: Logon Error: ORA-01017: invalid username/password; logon denied

    at com.businessobjects.reports.sdk.JRCCommunicationAdapter.a(SourceFile:2267) ~[CrystalReportsRuntime.jar:12.2.217.2158]
    at com.businessobjects.reports.sdk.JRCCommunicationAdapter.a(SourceFile:2304) ~[CrystalReportsRuntime.jar:12.2.217.2158]
    at com.businessobjects.reports.sdk.JRCCommunicationAdapter.if(SourceFile:736) ~[CrystalReportsRuntime.jar:12.2.217.2158]
    at com.businessobjects.reports.sdk.JRCCommunicationAdapter.a(SourceFile:166) ~[CrystalReportsRuntime.jar:12.2.217.2158]
    at com.businessobjects.reports.sdk.JRCCommunicationAdapter$2.a(SourceFile:528) ~[CrystalReportsRuntime.jar:12.2.217.2158]
    at com.businessobjects.reports.sdk.JRCCommunicationAdapter$2.call(SourceFile:526) ~[CrystalReportsRuntime.jar:12.2.217.2158]
    at com.crystaldecisions.reports.common.ThreadGuard.syncExecute(SourceFile:102) ~[CrystalReportsRuntime.jar:12.2.217.2158]
    at com.businessobjects.reports.sdk.JRCCommunicationAdapter.for(SourceFile:524) ~[CrystalReportsRuntime.jar:12.2.217.2158]
    at com.businessobjects.reports.sdk.JRCCommunicationAdapter.int(SourceFile:423) ~[CrystalReportsRuntime.jar:12.2.217.2158]
    at com.businessobjects.reports.sdk.JRCCommunicationAdapter.request(SourceFile:351) ~[CrystalReportsRuntime.jar:12.2.217.2158]
    at com.businessobjects.sdk.erom.jrc.a.a(SourceFile:54) ~[CrystalReportsRuntime.jar:12.2.217.2158]
    at com.businessobjects.sdk.erom.jrc.a.execute(SourceFile:67) ~[CrystalReportsRuntime.jar:12.2.217.2158]
    at com.crystaldecisions.proxy.remoteagent.RemoteAgent$a.execute(SourceFile:716) ~[CrystalReportsRuntime.jar:12.2.217.2158]
    at com.crystaldecisions.proxy.remoteagent.CommunicationChannel.a(SourceFile:125) ~[CrystalReportsRuntime.jar:12.2.217.2158]
    at com.crystaldecisions.proxy.remoteagent.RemoteAgent.a(SourceFile:537) ~[CrystalReportsRuntime.jar:12.2.217.2158]
    at com.crystaldecisions.sdk.occa.report.application.ds.a(SourceFile:186) ~[CrystalReportsRuntime.jar:12.2.217.2158]
    at com.crystaldecisions.sdk.occa.report.application.an.a(SourceFile:108) ~[CrystalReportsRuntime.jar:12.2.217.2158]
    at com.crystaldecisions.sdk.occa.report.application.b0.if(SourceFile:148) ~[CrystalReportsRuntime.jar:12.2.217.2158]
    at com.crystaldecisions.sdk.occa.report.application.b0.b(SourceFile:95) ~[CrystalReportsRuntime.jar:12.2.217.2158]
    at com.crystaldecisions.sdk.occa.report.application.bb.int(SourceFile:96) ~[CrystalReportsRuntime.jar:12.2.217.2158]
    at com.crystaldecisions.proxy.remoteagent.UndoUnitBase.performDo(SourceFile:151) ~[CrystalReportsRuntime.jar:12.2.217.2158]
    at com.crystaldecisions.proxy.remoteagent.UndoUnitBase.a(SourceFile:106) ~[CrystalReportsRuntime.jar:12.2.217.2158]
    at com.crystaldecisions.sdk.occa.report.application.DatabaseController.a(SourceFile:2159) ~[CrystalReportsRuntime.jar:12.2.217.2158]
    at com.crystaldecisions.sdk.occa.report.application.DatabaseController.a(SourceFile:543) ~[CrystalReportsRuntime.jar:12.2.217.2158]
    at com.crystaldecisions.sdk.occa.report.application.DatabaseController.a(SourceFile:3898) ~[CrystalReportsRuntime.jar:12.2.217.2158]
    at com.crystaldecisions.sdk.occa.report.application.DatabaseController.setTableLocation(SourceFile:2906) ~[CrystalReportsRuntime.jar:12.2.217.2158]
    at com.pnb.allianz.util.CRJavaHelper.changeDataSource(CRJavaHelper.java:169) ~[classes/:na]
    at com.pnb.allianz.util.CRJavaHelper.changeDataSource(CRJavaHelper.java:67) ~[classes/:na]
    at com.pnb.allianz.ProjectInitializer.run(ProjectInitializer.java:77) ~[classes/:na]
    at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:732) [spring-boot-1.5.19.RELEASE.jar:1.5.19.RELEASE]
    ... 11 common frames omitted
Caused by: com.crystaldecisions.reports.common.LogonFailureException: Logon Error: ORA-01017: invalid username/password; logon denied

    at com.crystaldecisions.reports.queryengine.Connection.br(SourceFile:1799) ~[CrystalReportsRuntime.jar:12.2.217.2158]
    at com.crystaldecisions.reports.queryengine.Connection.bs(SourceFile:505) ~[CrystalReportsRuntime.jar:12.2.217.2158]
    at com.crystaldecisions.reports.queryengine.Connection.t4(SourceFile:3020) ~[CrystalReportsRuntime.jar:12.2.217.2158]
    at com.crystaldecisions.reports.queryengine.Table.vc(SourceFile:2417) ~[CrystalReportsRuntime.jar:12.2.217.2158]
    at com.crystaldecisions.reports.dataengine.datafoundation.AddDatabaseTableCommand.new(SourceFile:529) ~[CrystalReportsRuntime.jar:12.2.217.2158]
    at com.crystaldecisions.reports.common.CommandManager.a(SourceFile:71) ~[CrystalReportsRuntime.jar:12.2.217.2158]
    at com.crystaldecisions.reports.common.Document.a(SourceFile:203) ~[CrystalReportsRuntime.jar:12.2.217.2158]
    at com.businessobjects.reports.sdk.requesthandler.f.a(SourceFile:175) ~[CrystalReportsRuntime.jar:12.2.217.2158]
    at com.businessobjects.reports.sdk.requesthandler.DatabaseRequestHandler.byte(SourceFile:1079) ~[CrystalReportsRuntime.jar:12.2.217.2158]
    at com.businessobjects.reports.sdk.JRCCommunicationAdapter.do(SourceFile:1166) ~[CrystalReportsRuntime.jar:12.2.217.2158]
    at com.businessobjects.reports.sdk.JRCCommunicationAdapter.if(SourceFile:660) ~[CrystalReportsRuntime.jar:12.2.217.2158]
    ... 38 common frames omitted
Caused by: java.sql.SQLException: ORA-01017: invalid username/password; logon denied

    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112) ~[ojdbc14-10.2.0.2.0.jar:Oracle JDBC Driver version - "10.2.0.3.0"]
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331) ~[ojdbc14-10.2.0.2.0.jar:Oracle JDBC Driver version - "10.2.0.3.0"]
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:283) ~[ojdbc14-10.2.0.2.0.jar:Oracle JDBC Driver version - "10.2.0.3.0"]
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:278) ~[ojdbc14-10.2.0.2.0.jar:Oracle JDBC Driver version - "10.2.0.3.0"]
    at oracle.jdbc.driver.T4CTTIoauthenticate.receiveOauth(T4CTTIoauthenticate.java:791) ~[ojdbc14-10.2.0.2.0.jar:Oracle JDBC Driver version - "10.2.0.3.0"]
    at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:362) ~[ojdbc14-10.2.0.2.0.jar:Oracle JDBC Driver version - "10.2.0.3.0"]
    at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:439) ~[ojdbc14-10.2.0.2.0.jar:Oracle JDBC Driver version - "10.2.0.3.0"]
    at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165) ~[ojdbc14-10.2.0.2.0.jar:Oracle JDBC Driver version - "10.2.0.3.0"]
    at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35) ~[ojdbc14-10.2.0.2.0.jar:Oracle JDBC Driver version - "10.2.0.3.0"]
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801) ~[ojdbc14-10.2.0.2.0.jar:Oracle JDBC Driver version - "10.2.0.3.0"]
    at com.crystaldecisions.reports.queryengine.driverImpl.jdbc.JDBCConnection.Open(Unknown Source) ~[DatabaseConnectors.jar:12.2.217.2158]
    at com.crystaldecisions.reports.queryengine.JDBConnectionWrapper.Open(SourceFile:123) ~[CrystalReportsRuntime.jar:12.2.217.2158]
    at com.crystaldecisions.reports.queryengine.Connection.br(SourceFile:1786) ~[CrystalReportsRuntime.jar:12.2.217.2158]
    ... 48 common frames omitted

Я уже проверил учетные данные БД, такие как URL, имя пользователя, пароль и имя класса драйвера. Это все правильно.

мой код для чтения отчета выглядит так

for(File f : files) {
                reportName = f.getAbsolutePath();
                String connectString = dataSource.getUrl();
                String driverName = dataSource.getDriverClassName();
                String JNDIName = dataSource.getDataSourceJNDI();
                String userName = dataSource.getUsername(); // TODO: Fill in database user
                String password = dataSource.getPassword(); // TODO: Fill in password
                String EXPORT_LOC = "C:\\CRPT_V1\\" + formattedDate + "\\";
                subject = f.getName().substring(0, f.getName().indexOf("_"));

                File file = new File(EXPORT_LOC);

                if (!file.exists()) {
                    file.mkdirs();
                }

                String EXPORT_FILE = subject + "_" + formattedDate + ".pdf";

                System.out.println("Files:" + f.getName());
                ReportClientDocument reportClientDoc = new ReportClientDocument();
                reportClientDoc.open(reportName, OpenReportOptions._openAsReadOnly);

                CRJavaHelper.changeDataSource(reportClientDoc,userName, password, connectString, driverName, JNDIName);

                CRJavaHelper.logonDataSource(reportClientDoc, userName, password);

                Integer numberValue = new Integer(7); // TODO: Fill in value
                numberValue = Integer.parseInt(YEAR);

                if (!subject.equals("001") && !subject.equals("002")) {
                    CRJavaHelper.addDiscreteParameterValue(reportClientDoc, "", "PROD_MONTH", MONTH);
                }

                CRJavaHelper.addDiscreteParameterValue(reportClientDoc, "", "CURR_YEAR", numberValue);

                ByteArrayInputStream byteArrayInputStream = (ByteArrayInputStream) reportClientDoc
                                                            .getPrintOutputController().export(ReportExportFormat.PDF);

                reportClientDoc.close();

                EXPORT_OUTPUT = EXPORT_LOC + EXPORT_FILE;
                //util.writeToFileSystem(byteArrayInputStream,
                    //    EXPORT_OUTPUT);
                IOUtils.copy(byteArrayInputStream, new FileOutputStream(EXPORT_FILE));
            }

Я уже попробовал некоторые решения, предоставленные другими разработчиками, у которых есть ошибки, но не повезло.

Я бы очень признателен за помощь. Спасибо, ребята!

...