Accesing a RESTORED db from Data Studio - db2

I have restored a db from db2 express-c 11.1 version to a db2 developer version. I can access the tables and data from db2 cmd but when I'm getting the following error message when trying to access tables/view/... in IBM DATA Studio.
com.ibm.db2.jcc.am.SqlException: DB2 SQL Error: SQLCODE=-20249, SQLSTATE= , SQLERRMC=NULLID.SYSSH200, DRIVER=3.69.56
at com.ibm.db2.jcc.am.gd.a(Unknown Source)
at com.ibm.db2.jcc.am.gd.a(Unknown Source)
at com.ibm.db2.jcc.am.gd.a(Unknown Source)
at com.ibm.db2.jcc.am.yo.c(Unknown Source)
at com.ibm.db2.jcc.t4.bb.p(Unknown Source)
at com.ibm.db2.jcc.t4.bb.h(Unknown Source)
at com.ibm.db2.jcc.t4.bb.b(Unknown Source)
at com.ibm.db2.jcc.t4.p.a(Unknown Source)
at com.ibm.db2.jcc.t4.vb.i(Unknown Source)
at com.ibm.db2.jcc.am.yo.ib(Unknown Source)
at com.ibm.db2.jcc.am.yo.a(Unknown Source)
at com.ibm.db2.jcc.am.yo.a(Unknown Source)
at com.ibm.db2.jcc.am.yo.executeQuery(Unknown Source)
at org.eclipse.datatools.connectivity.sqm.internal.core.connection.StatementAdapter.executeQuery(Unknown Source)
at com.ibm.datatools.internal.core.prs.PRSDatabaseLoader.processQuery(Unknown Source)
at com.ibm.datatools.internal.core.prs.PRSDatabaseLoader.initiateQuery(Unknown Source)
at com.ibm.datatools.internal.core.prs.PRSQueryInfo.getSlice(Unknown Source)
at com.ibm.datatools.internal.core.util.PersistentQueryCache.getSlice(Unknown Source)
at com.ibm.datatools.internal.core.util.PersistentResultSet.createSlice(Unknown Source)
at com.ibm.datatools.internal.core.util.PersistentResultSet.isClosed(Unknown Source)
at com.ibm.datatools.internal.core.util.PersistentResultSet.checkNotClosed(Unknown Source)
at com.ibm.datatools.internal.core.util.PersistentResultSet.absolute(Unknown Source)
at com.ibm.datatools.internal.core.util.PersistentResultSet.relative(Unknown Source)
at com.ibm.datatools.internal.core.util.PersistentResultSetAdapter.next(Unknown Source)
at com.ibm.datatools.core.db2.luw.load.catalog.LUWCatalogDatabase.loadSchemas(Unknown Source)
at com.ibm.datatools.core.db2.luw.load.catalog.LUWCatalogDatabase.getSchemas(Unknown Source)
at com.ibm.datatools.uom.internal.content.loadmgr.LoadUtility$9.basicLoad(Unknown Source)
at com.ibm.datatools.uom.internal.content.loadmgr.ChildrenLoader.load(Unknown Source)
at com.ibm.datatools.uom.internal.content.loadmgr.LoadManager$LevelLoader.load(Unknown Source)
at com.ibm.datatools.uom.internal.content.loadmgr.LoadManager$LevelLoader.doWork(Unknown Source)
at com.ibm.datatools.uom.internal.content.loadmgr.LoadManager$LevelLoader.access$0(Unknown Source)
at com.ibm.datatools.uom.internal.content.loadmgr.LoadManager$LevelLoader$1.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

I followed the answer written by mao here but it didn't help.
What helped is rebinding all packages and then re-validating them.
One can use below commands to rebind all packages:
db2 connect to SAMPLE
db2 -x "select 'REBIND PACKAGE ' || rtrim(pkgschema) || '.' || rtrim(pkgname) || ';' as command from syscat.packages" > rebind.sql
db2 -tvf rebind.sql
Post rebinding, re-validate all objects using below system store procedure:
CALL SYSPROC.ADMIN_REVALIDATE_DB_OBJECTS()

After you successfully restore a Db2-LUW database to a new Db2-instance it is wise to ensure that you rebind all of the IBM supplied bindfiles to the database.
The CLI bindfiles are part of your Db2-client, and it's wise to ensure that your Db2-client version/fixpack matches that of the Db2-server.
Rebinding CLI utilities is essential if the Db2-version or Db2-fixpack of the restore-database differs from the original database.
To rebind CLI utilities, follow IBM's instructions for rebinding the CLI packages here.
Another useful activity is to revalidate database objects if the Db2 version or fixpack has changed. There's a stored procedure for that, see details here.
Note: if your database contains SQL PL stored procedures or static-SQL packages then you may also need to rebind those packages to take advantage of any Db2 version differences. There are different ways to do this, but one way is to use db2rbind , and this should only be done on development/testing environments where you can validate the results.

Related

PostgreSQL jsonb testing using in-memory db

I am using postgres in production and have tables that have jsonb type columns. I am trying to test these queries using junits and an in-memory embedded database.
In the past, I have used H2 and HSQL for testing queries that run on MySql or Sybase. However, I am facing trouble using these for postgres as jsonb type is not supported by H2/HSQL.
Caused by: org.hsqldb.HsqlException: type not found or user lacks privilege: JSONB
at org.hsqldb.error.Error.error(Unknown Source)
at org.hsqldb.error.Error.error(Unknown Source)
at org.hsqldb.ParserDQL.readTypeDefinition(Unknown Source)
at org.hsqldb.ParserTable.readColumnDefinitionOrNull(Unknown Source)
at org.hsqldb.ParserTable.readTableContentsSource(Unknown Source)
at org.hsqldb.ParserTable.compileCreateTableBody(Unknown Source)
at org.hsqldb.ParserTable.compileCreateTable(Unknown Source)
at org.hsqldb.ParserDDL.compileCreate(Unknown Source)
at org.hsqldb.ParserCommand.compilePart(Unknown Source)
at org.hsqldb.ParserCommand.compileStatements(Unknown Source)
at org.hsqldb.Session.executeDirectStatement(Unknown Source)
at org.hsqldb.Session.execute(Unknown Source)
... 18 more
Is there any alternate approach available or if there is any trick that I am missing that could make jsonb work with H2/HSQL?
H2 does not support JSONB column type,found this workaround,
create test db in postgres, and use this in your integration tests
#RunWith(SpringJUnit4ClassRunner.class)
#SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
#ActiveProfiles({"test"})
define db properties in application-test.yml
For h2 version up to 2.1.212 you can create a custom type jsonb as json (which is supported by h2), by adding the next script in schema.sql file (from resources folder)
CREATE TYPE JSONB AS json;
P.S. Thanks #Sarajog. I've updated my post accordingly

Install4j silent updater process hangs in case of incorrect proxy settings

The install4j silent update check process seems to hang in case Windows is configured with a "proxy script" that no longer exist. For example: when it is set to http://127.0.0.1:50000/proxy.pac, IE gives a "connection refused error", but install4j will wait indefintely while attempting to download the script.
This also prevents our own application from starting, because it is configured to start after the silent update check.
The installer and updater was created in Install4j 6.1.2. I don't see anything in the change log of 6.1.3 that would fix this issue. Can you have a look or provide us with a work around?
"main" #1 prio=5 os_prio=0 tid=0x0000000001f7f000 nid=0x1440 runnable [0x000000000028c000]
java.lang.Thread.State: RUNNABLE
at java.io.FileOutputStream.writeBytes(Native Method)
at java.io.FileOutputStream.write(Unknown Source)
at java.io.BufferedOutputStream.flushBuffer(Unknown Source)
at java.io.BufferedOutputStream.flush(Unknown Source)
- locked <0x00000000d7c99bd0> (a java.io.BufferedOutputStream)
at java.io.PrintStream.write(Unknown Source)
- locked <0x00000000d7c99bb0> (a java.io.PrintStream)
at sun.nio.cs.StreamEncoder.writeBytes(Unknown Source)
at sun.nio.cs.StreamEncoder.implFlushBuffer(Unknown Source)
at sun.nio.cs.StreamEncoder.flushBuffer(Unknown Source)
- locked <0x00000000d7c99cf8> (a java.io.OutputStreamWriter)
at java.io.OutputStreamWriter.flushBuffer(Unknown Source)
at java.io.PrintStream.write(Unknown Source)
- locked <0x00000000d7c99bb0> (a java.io.PrintStream)
at java.io.PrintStream.print(Unknown Source)
at java.io.PrintStream.println(Unknown Source)
- locked <0x00000000d7c99bb0> (a java.io.PrintStream)
at java.lang.Throwable$WrappedPrintStream.println(Unknown Source)
at java.lang.Throwable.printStackTrace(Unknown Source)
- locked <0x00000000d7c99bb0> (a java.io.PrintStream)
at java.lang.Throwable.printStackTrace(Unknown Source)
at java.lang.Throwable.printStackTrace(Unknown Source)
at com.sun.deploy.net.proxy.ProxyConfigException.<init>(Unknown Source)
at com.sun.deploy.net.proxy.AbstractAutoProxyHandler.getJSFileFromURL(Unknown Source)
at com.sun.deploy.net.proxy.AbstractAutoProxyHandler.retrieveContentOfPACFile(Unknown Source)
at com.sun.deploy.net.proxy.AbstractAutoProxyHandler.contructLegacyPACScript_16(Unknown Source)
at com.sun.deploy.net.proxy.AbstractAutoProxyHandler.init(Unknown Source)
at com.install4j.runtime.installer.helper.content.DeployProxyHelper.getProxyHostInfoWindows(DeployProxyHelper.java:70)
at com.install4j.runtime.installer.helper.content.ProxyHelper.getProxyHostInfoUnguarded(ProxyHelper.java:37)
at com.install4j.runtime.installer.helper.content.ProxyHelper.access$000(ProxyHelper.java:13)
at com.install4j.runtime.installer.helper.content.ProxyHelper$1.fetchValue(ProxyHelper.java:25)
at com.install4j.runtime.installer.helper.content.ProxyHelper$1.fetchValue(ProxyHelper.java:22)
at com.install4j.runtime.installer.helper.comm.actions.FetchObjectAction.execute(FetchObjectAction.java:14)
at com.install4j.runtime.installer.helper.comm.HelperCommunication.exe
The bug is in JRE classes, so we cannot fix that directly. The only option is to pass the VM parameter
-Dinstall4j.noProxyAutoDetect=true
to the installer so proxy auto-detection is switched off.

JasperReports Server - Error generating reports with scheduler

every week on monday we are generating some reports in the morning. We have no problem with the most of them, but 2 are failing sometimes (irregular).
This is the stacktrace of the exception we get with e-mail:
ExceptionConverter: java.io.IOException: No such file or directory
at java.io.UnixFileSystem.createFileExclusively(Native Method)
at java.io.File.checkAndCreate(File.java:1704)
at java.io.File.createTempFile(File.java:1792)
at java.io.File.createTempFile(File.java:1828)
at com.jaspersoft.jasperserver.api.metadata.common.domain.util.FileBufferedOutputStream.ensureFileOutput(FileBufferedOutputStream.java:144)
at com.jaspersoft.jasperserver.api.metadata.common.domain.util.FileBufferedOutputStream.write(FileBufferedOutputStream.java:164)
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
at java.io.BufferedOutputStream.write(BufferedOutputStream.java:109)
at com.lowagie.text.pdf.OutputStreamCounter.write(Unknown Source)
at java.io.ByteArrayOutputStream.writeTo(ByteArrayOutputStream.java:109)
at com.lowagie.text.pdf.PdfStream.toPdf(Unknown Source)
at com.lowagie.text.pdf.PdfIndirectObject.writeTo(Unknown Source)
at com.lowagie.text.pdf.PdfWriter$PdfBody.add(Unknown Source)
at com.lowagie.text.pdf.PdfWriter$PdfBody.add(Unknown Source)
at com.lowagie.text.pdf.PdfWriter$PdfBody.add(Unknown Source)
at com.lowagie.text.pdf.PdfWriter.addToBody(Unknown Source)
at com.lowagie.text.pdf.PdfWriter.add(Unknown Source)
at com.lowagie.text.pdf.PdfDocument.newPage(Unknown Source)
at com.lowagie.text.Document.newPage(Unknown Source)
at net.sf.jasperreports.engine.export.JRPdfExporter.exportReportToStream(JRPdfExporter.java:686)
at net.sf.jasperreports.engine.export.JRPdfExporter.exportReport(JRPdfExporter.java:396)
at com.jaspersoft.jasperserver.api.engine.jasperreports.service.impl.EngineServiceImpl.exportToPdf(EngineServiceImpl.java:548)
at com.jaspersoft.jasperserver.api.engine.scheduling.quartz.PdfReportOutput.getOutput(PdfReportOutput.java:95)
at com.jaspersoft.jasperserver.api.engine.scheduling.quartz.ReportExecutionJob.executeAndSendReport(ReportExecutionJob.java:485)
at com.jaspersoft.jasperserver.api.engine.scheduling.quartz.ReportExecutionJob.execute(ReportExecutionJob.java:217)
at org.quartz.core.JobRunShell.run(JobRunShell.java:213)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:557)
Have someone an idea why some are failing and the most of them not?
We are using JasperReports Server 4.7 on a Linuxserver (Debian) with a Tomcat.
I see the error 'No such file or directory' which makes me wonder where you are saving the output? Is it being emailed, saved to the repository, or saved somewhere on the file system?

MDB creation In WAS 7

I am trying to create a local queue and a mdb that listens this local queue in my WAS 7.0 server. I reffered this URL and followed all the steps given. When i tried to run it am getting the below exception.
AnnotativeMetadataManagerImpl merge Caught exception while merging
com.ibm.wsspi.amm.merge.MergeException: expected reference with name jms/messageQueue to be a message destination reference
at com.ibm.ws.amm.merge.ejb.ResourceMergeAction.getMessageDestinationRefData(ResourceMergeAction.java:245)
at com.ibm.ws.amm.merge.ejb.ResourceMergeAction.getResourceData(ResourceMergeAction.java:407)
at com.ibm.ws.amm.merge.ejb.ResourceMergeAction.mergeFieldTarget(ResourceMergeAction.java:174)
at com.ibm.wsspi.amm.merge.AbstractMergeAction.merge(AbstractMergeAction.java:338)
at com.ibm.ws.amm.AnnotativeMetadataManagerImpl.merge(AnnotativeMetadataManagerImpl.java:159)
at com.ibm.ws.amm.commonarchive.AnnotationsProcessorImpl.merge(AnnotationsProcessorImpl.java:115)
at org.eclipse.jst.j2ee.commonarchivecore.internal.impl.WARFileImpl.processAnnotations(WARFileImpl.java:302)
at org.eclipse.jst.j2ee.commonarchivecore.internal.impl.WARFileImpl.getDeploymentDescriptor(WARFileImpl.java:248)
at org.eclipse.jst.j2ee.commonarchivecore.internal.impl.WARFileImpl.getStandardDeploymentDescriptor(WARFileImpl.java:703)
at org.eclipse.jst.j2ee.commonarchivecore.internal.impl.EARFileImpl.getDeploymentDescriptor(EARFileImpl.java:676)
at org.eclipse.jst.j2ee.commonarchivecore.internal.impl.ModuleRefImpl.getDeploymentDescriptor(ModuleRefImpl.java:230)
at org.eclipse.jst.j2ee.commonarchivecore.internal.impl.ModuleRefImpl.getDeploymentDescriptor(ModuleRefImpl.java:223)
at com.ibm.ws.runtime.component.DeployedModuleImpl.open(DeployedModuleImpl.java:249)
at com.ibm.ws.runtime.component.DeployedModuleImpl.initialize(DeployedModuleImpl.java:474)
at com.ibm.ws.runtime.component.DeployedApplicationImpl.initializeModule(DeployedApplicationImpl.java:1274)
at com.ibm.ws.runtime.component.DeployedApplicationImpl.initialize(DeployedApplicationImpl.java:608)
at com.ibm.ws.runtime.component.DeployedApplicationImpl.initialize(DeployedApplicationImpl.java:419)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.initializeApplication(ApplicationMgrImpl.java:379)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:2045)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:385)
at com.ibm.ws.runtime.component.CompositionUnitImpl.start(CompositionUnitImpl.java:123)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:328)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.startCompositionUnit(CompositionUnitMgrImpl.java:599)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.startCompositionUnit(CompositionUnitMgrImpl.java:561)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:1184)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:611)
at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:49)
at sun.reflect.GeneratedMethodAccessor19.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:611)
at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:256)
at javax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1085)
at javax.management.modelmbean.RequiredModelMBean.invoke(RequiredModelMBean.java:966)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:848)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:773)
at com.ibm.ws.management.AdminServiceImpl$1.run(AdminServiceImpl.java:1333)
at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118)
at com.ibm.ws.management.AdminServiceImpl.invoke(AdminServiceImpl.java:1226)
at com.ibm.ws.management.commands.AdminServiceCommands$InvokeCmd.execute(AdminServiceCommands.java:251)
at com.ibm.ws.console.core.mbean.MBeanHelper.invoke(MBeanHelper.java:239)
at com.ibm.ws.console.appdeployment.ApplicationDeploymentCollectionAction.execute(ApplicationDeploymentCollectionAction.java:564)
at org.apache.struts.action.RequestProcessor.processActionPerform(Unknown Source)
at org.apache.struts.action.RequestProcessor.process(Unknown Source)
at org.apache.struts.action.ActionServlet.process(Unknown Source)
at org.apache.struts.action.ActionServlet.doPost(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:738)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1657)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1597)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:104)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:77)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:908)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:934)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:502)
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:179)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:354)
at org.apache.struts.action.RequestProcessor.doForward(Unknown Source)
at org.apache.struts.tiles.TilesRequestProcessor.doForward(Unknown Source)
at org.apache.struts.action.RequestProcessor.processForwardConfig(Unknown Source)
at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(Unknown Source)
at com.ibm.isclite.container.controller.InformationController.processForwardConfig(InformationController.java:217)
at org.apache.struts.action.RequestProcessor.process(Unknown Source)
at org.apache.struts.action.ActionServlet.process(Unknown Source)
at org.apache.struts.action.ActionServlet.doPost(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:738)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1657)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1597)
When i searched in google it's ask me run a fix pack 29 from IBM, Please guide me is this really require to run this fix pack or we can solve this issue using server config change or please give me a procedure to create a MDB that uses local queue to post and listen a message.Below are my RSA info:
RAS 7.5.5
WAS 7.0
To me it looks like your application server (or application) is misconfigured - jms/messageQueue is not message destination reference. This name is probably encountered when parsing annotations on your classes.
When configuring the server you should configure Connection factory, Queue and Activation spec to match the annotations in your code. Additionally don't forget to set proper resource references in your deployment descriptors.

Importing OpenStreetMap data into PostgreSQL database

I'm trying to import one of the following OpenStreetMap maps 1, 2, 3 into a PostgreSQL database using calls like call osmosis.bat --read-xml file="map.osm" --write-pgsimp user="ccp-web-user" database="ccp-web2" password="ccp-web-password", but I always following error message.
SCHWERWIEGEND: Thread for task 1-read-xml failed
org.openstreetmap.osmosis.core.OsmosisRuntimeException: Unable to read the schema version from the schema info table.
at org.openstreetmap.osmosis.pgsimple.common.SchemaVersionValidator.validateDBVersion(SchemaVersionValidator.java:90)
at org.openstreetmap.osmosis.pgsimple.common.SchemaVersionValidator.validateVersion(SchemaVersionValidator.java:50)
at org.openstreetmap.osmosis.pgsimple.v0_6.PostgreSqlWriter.initialize(PostgreSqlWriter.java:183)
at org.openstreetmap.osmosis.pgsimple.v0_6.PostgreSqlWriter.process(PostgreSqlWriter.java:773)
at org.openstreetmap.osmosis.xml.v0_6.impl.BoundsElementProcessor.end(BoundsElementProcessor.java:84)
at org.openstreetmap.osmosis.xml.v0_6.impl.OsmHandler.endElement(OsmHandler.java:107)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at org.openstreetmap.osmosis.xml.v0_6.XmlReader.run(XmlReader.java:111)
at java.lang.Thread.run(Unknown Source)
Caused by: org.postgresql.util.PSQLException: FEHLER: Relation ╗schema_info½ existiert nicht Position: 21
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2102)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1835)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:500)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:374)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:254)
at org.openstreetmap.osmosis.pgsimple.common.SchemaVersionValidator.validateDBVersion(SchemaVersionValidator.java:71)
... 19 more
30.10.2012 23:06:56 org.openstreetmap.osmosis.core.Osmosis main
SCHWERWIEGEND: Execution aborted.
org.openstreetmap.osmosis.core.OsmosisRuntimeException: One or more tasks failed
.
at org.openstreetmap.osmosis.core.pipeline.common.Pipeline.waitForCompletion(Pipeline.java:146)
at org.openstreetmap.osmosis.core.Osmosis.run(Osmosis.java:92)
at org.openstreetmap.osmosis.core.Osmosis.main(Osmosis.java:37)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:329)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
at org.codehaus.classworlds.Launcher.main(Launcher.java:47)
How can I fix this?
You need initialize PostGIS simple schema as described here.
The schema creation scripts can be found in the scripts directory within the osmosis distribution.
These scripts are:
pgsimple_schema_0.6.sql - Builds the minimal schema.
pgsimple_schema_0.6_action.sql - Adds the optional "action" table which allows derivative tables to be kept up to date when diffs are applied.
pgsimple_schema_0.6_bbox.sql - Adds the optional bbox column to the way table.
pgsimple_schema_0.6_linestring.sql - Adds the optional linestring column to the way table.
pgsimple_load_0.6.sql - A sample data load script suitable for loading the COPY files created by the --write-pgsimp-dump task.
If you are using PgAdmin3 open this files and execute them. Or use psql command. Of course PostGIS should be installed in your database.
I just had this issue, and found a solution for myself on Ubuntu.
If you think you have already followed the steps on https://wiki.openstreetmap.org/wiki/Osmosis/PostGIS_Setup through psql commands, but still encounter errors, then there is possibility that there can be some issue with user permissions when executing psql commands on Linux terminal, such as when creating postgis and hstore extensions, and when executing pgsnapshot schema.
What I did:
- After creating a database on the terminal
- I used PgAdmin, go to the database (e.g. pgsnapshot) and execute the step of creating extension postgis and hstore. Then execute one of the schema creation scripts (e.g. pgsnapshot_schema_0.6.sql) inside that PgAdmin query tool.
- After that, return to the terminal to execute commands (e.g.: osmosis --read-pbf ....)
These steps solved my issue.