JBoss Teiid both source model table preview and VDB test failed - java

Sorry, I'm no Java person. Currently I'm playing with JBoss Teiid hoping that the tool can provide us a data virtualization layer among multiple data sources. I managed to install Teiid 10.2.1 on Wildfly 11. I started to set up various source models from multiple flavor of data sources.
First I created a flat file source model. I can preview the table fine. Next I created a MySQL source model. When I tried to preview the table, it gave me
Error deploying "PREVIEW-9b7b127a-cc80-4751-be77-2053c495daa8" - please check the server log for more details
By looking into the log, the problem seems to be
2018-08-19 19:38:53,878 WARN [org.teiid.RUNTIME] (Worker1_async-teiid-threads2) TEIID50036 VDB PREVIEW-9b7b127a-cc80-4751-be77-2053c495daa8.1.0.0 model "MySQLSourceModel" metadata failed to load. Reason:TEIID31259 In the statement ending with token teiid_mysql5 on line 2 column 61 the ddl is not valid: TEIID60017 Invalid prefix teiid_mysql5, teiid_ is reserved for Teiid use.: org.teiid.metadata.ParseException: TEIID31259 In the statement ending with token teiid_mysql5 on line 2 column 61 the ddl is not valid: TEIID60017 Invalid prefix teiid_mysql5, teiid_ is reserved for Teiid use.
I exported the model into Teiid DDL, it appears containing the fol,lowing
SET NAMESPACE 'http://www.teiid.org/ext/relational/2012' AS teiid_mysql5
But I can't find anywhere that allows me to change the namespace setting. Then I create an VDB from the model hoping that I can preview the table by executing the VDB. But I still got an error stating
19:53:09,906 WARN [org.teiid.SECURITY] (NIO3) TEIID40011 Processing exception 'TEIID50072 The username "user" and/or password and/or payload token could not be authenticated by security domain teiid-security.' for session null. Exception type org.teiid.client.security.LogonException thrown from org.teiid.jboss.JBossSecurityHelper.authenticate(JBossSecurityHelper.java:152). Enable more detailed logging to see the entire stacktrace.
19:53:09,945 WARN [org.teiid.SECURITY] (NIO0) TEIID40011 Processing exception 'TEIID50072 The username "user" and/or password and/or payload token could not be authenticated by security domain teiid-security.' for session null. Exception type org.teiid.client.security.LogonException thrown from org.teiid.jboss.JBossSecurityHelper.authenticate(JBossSecurityHelper.java:152). Enable more detailed logging to see the entire stacktrace.
How can I add org.teiid.jboss.JBossSecurityHelper.java into eclipse? Thank you very much in advance for any help.

Related

How to get instanceid from cloud_run?

The logs from cloud run spit out some good json with resource.labels.revision_name = my_name-00046-kip.
The json path labels.instanceId is more like this though
00bf4bf02d71261c0c1f55a601331b336a5d90d365cca1b28330dcf3e456fb7c07d5b72f1d3c9a971e391b5edc3512aea8559d172b24e639
per this document I was able to get revision_name
https://cloud.google.com/run/docs/reference/container-contract#env-vars
but I can't get the instance id and metrics must be reported per instance or two instances reporting in the same minute will be rejected. how do I get instance id (preferably through DockerFile and if not through api call). If cloud run boots up 10 instances under one revision name, I have to make sure to uniquely report metrics to Generic Task resource where I plan on filling in job_id with the instance id.
thanks,
Dean
Please try using the metadata server to get the instance ID using the url:
http://metadata.google.internal/computeMetadata/v1/instance/id
Note that "Metadata-Flavor: Google" header is also required.
If you're using Java (as indicated by the tags), the easiest way to get the instance ID from the "internal metadata server" programmatically is probably to include the dependency com.google.cloud:google-cloud-core:1.93.5 (or newer) through Gradle/Maven and then call the following method:
import com.google.cloud.MetadataConfig;
String instanceId = MetadataConfig.getInstanceId();
The entries in the logging in Stackdriver is as follows
labels: {
instanceId: "00bf4bf02d4b374e91dda64bc4c4241a218302c4bcc73a01ecf85e582127e8c8076fcbe18b3cc934f5ed33e5dc1348c58cfd40cbecc0c9ae2a0b6d2356"
}
labels: {
configuration_name: "cloudrunservice"
location: "us-central1"
project_id: "xxxx-xxxx-000"
revision_name: "cloudrunservice-00002-leq"
service_name: "cloudrunservice"
}
type: "cloud_run_revision"
As you mentioned, each one has the instance Id, Revision name, and Service name. In this way, you do not have to worry about rejected entries in the logging by the same instance / time.
I could no see something related with the instances ID in the UI, managing Revisions. Handling this JSON from logging you could get the InsanceID.

ALTER DATABASE failed because a lock could not be placed on database on Rest call

Hello i got a program that restores databases from .bak files and it works fine when there is no database with that name but when i try it when there already is an database with the same name i get this error
Could not send response error 500: javax.servlet.ServletException: javax.servlet.ServletException: java.lang.RuntimeException: java.lang.IllegalStateException: org.springframework.dao.TransientDataAccessResourceException: StatementCallback; SQL [IF EXISTS (SELECT name FROM sys.databases WHERE name = N'utv_johan')
BEGIN
ALTER DATABASE utv_johan SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
drop database utv_johan;
END
]; ALTER DATABASE failed because a lock could not be placed on database 'utv_johan'.
I am doing a new version of an old app and on the old one it works fine with the statement and all. and i use the same code for this but with a new React GUI. Anyone know how this error occurs and how to fix it? If you need more info feel free to ask! i saw someone here with same error when he were trying to take down his sql server. But i have done nothing with the database same calls as the old version.
Its seem as after some more testing that it sometimes works and throws no error at all.
It looks like your DEADLOCK_PRIORITY is equal to or less than another session and thus, you aren't able to ROLLBACK their transaction. You can explicitly set your priority and see if this resolves it.
USE [MASTER]
SET DEADLOCK_PRIORITY 10
ALTER DATABASE utv_johan SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
DROP DATABASE utv_johan;

Using WOLA in Liberty WebApp to access CICS

Trying to use WOLA direct from a webapp in Liberty to CICS. Using same CICS region successfully with z/OS Connect V2 (zCEE). With Liberty, I have configured:
<featureManager>
<feature>servlet-3.1</feature>
<feature>jndi-1.0</feature>
<feature>jaxrs-1.1</feature>
<feature>zosLocalAdapters-1.0</feature>
</featureManager>
and
<!-- WOLA group to which others register -->
<zosLocalAdapters wolaGroup="GROUP" wolaName2="LIBRTOLA" wolaName3="WOLA3" />
<connectionFactory id="wolaCF" jndiName="eis/ola">
<properties.ola RegisterName=CICSMLAW/>
</connectionFactory>
<resourceAdapter location="/usr/lpp/IBM/zosconnect/v2r0/wlp/lib/ola.rar"/>
In the messages.log, I see good and bad items there:
CWWKB0103I: Authorized service group WOLA is available The WebSphere Optimized Local Adapter channel registered with the Liberty profile server using the following name: GROUP LIBRTOLA WOLA3
and the bad:
com.ibm.ws.app.manager.AppMessageHelper E CWWKZ0013E: It is not possible to start two applications called ola.
So the failure on registration: Requestlgth: 97
Requestparms data 1: BBOC START_SRVR RGN=CICSMLA DGN=GROUP NDN=LIBRTOLA
Requestparms data 2: SVN=WOLA3 SVC= MNC=1 MXC=10 TXN=N SEC=N REU=N
Requestparms data 3:
Processing a START SERVER request.
Starting WAS adapters Server task ...
Server transaction id will be: BBO$
Link transaction defaults to: BBO#
Service name will be:
Trace TDQ: BBOQ
Processing a REGISTER API request.
Register name: CICSMLA string len: 7
WAS Daemon: GROUP WAS Node: LIBRTOLA WAS Server: WOLA3
Min. connections: 1
Max. connections: 10
Transactional: N string len: 1
Security propagation: N string len: 1
Invoking OLA Register API for CICSMLA .
on with the Liberty profile server was not successful. The return code is 8, and the reason code 8.
And the failure in the JNDI call:
Context ctx = new InitialContext();
ConnectionFactory cf = (com.ibm.ws390.ola.jca.ConnectionFactoryImpl)ctx.lookup("java:comp/env/eis/ola");
Results in error:
[err] javax.naming.NameNotFoundException: javax.naming.NameNotFoundException: java:comp/env/eis/ola
[err] at com.ibm.ws.jndi.url.contexts.javacolon.internal.JavaURLContext.lookup(JavaURLContext.java:356) [err] at [internal classes]
[err] at javax.naming.InitialContext.lookup(InitialContext.java:428)
[err] at com.ibm.ctl.bank.impls.CTLBankWolaImpl.(CTLBankWolaImpl.java:51)
[err] at com.ibm.ctl.bank.web.OLTPBankRest.setImpl(OLTPBankRest.java:235)
Thanks
You have a lot going on here.
I'm not sure why you're starting ola.rar from the z/OS Connect v2 product, inside of a Liberty server. The zosLocalAdapters-1.0 feature already loads the ola.rar that ships with Liberty. You should remove the configuration from server.xml. That should resolve the CWWKZ0013E error.
You should see two CWWKB0103I messages in messages.log, one for WOLA (which you included) and one for CLIENT.WOLA. Please be sure you see both. It's possible you're on a very old version of Liberty that doesn't print the second CWWKB0103I message, so if this is true, please disregard that part.
I don't think you would have gotten this far without finding the WOLA configuration instructions for the Liberty server in the knowledge center, but here they are for other's benefits:
https://www.ibm.com/support/knowledgecenter/en/was_beta_liberty/com.ibm.websphere.wlp.nd.multiplatform.doc/ae/twlp_dat_enableconnector.html
OK next, I can't see your application to know whether you've got a resource-reference to a connection factory configured. I assume you do because you're doing a java:comp/env lookup. You do not need to cast to com.ibm.ws390.ola.jca.ConnectionFactoryImpl, and actually I highly recommend removing that since that is an internal class and subject to change at any time. It may be that the application class loader doesn't have access to that class, and that may be part of the problem.
Finally, you have a problem in CICS starting the link server. You are getting RC=8 RSN=8. A list of services and return/reason codes can be found here:
https://www.ibm.com/support/knowledgecenter/en/was_beta_liberty/com.ibm.websphere.wlp.nd.multiplatform.doc/ae/rwlp_dat_olaapis.html
An 8/8 on BBOA1REG (register) indicates the register token is already in use. Basically, the RGN= name you picked is already in use. Are you sure there isn't a PLTPI transaction or something else in the CICS region that is already registered with that name? Perhaps try a different name just to see if it works, and if it does, maybe try BBOC LIST_SRVR to see what it is? It's difficult to say how it's getting started without knowing more about your system.
I hope this helps. Take care!

connection error with db2 jdbc

Can anyone offer a clue on how to diagnose the error listed below? Note, I CAN connect to this DB2 instance via DB2 connect, but not thru jdbc.
org.apache.openjpa.persistence.PersistenceException: Unable to open a test
connection to the given database. JDBC url = jdbc:db2://dxxx_xxx.xxx.com:5000/XXXXX:deferPrepares=false, username = NNNNN. Terminating connection pool. Original Exception: ------
com.ibm.db2.jcc.am.SqlSyntaxErrorException: [jcc][10165][10051][3.63.75] Invalid database URL syntax: jdbc:db2:/dxxx_xxx.xxx.com:5000/XXXXX:deferPrepares=false. ERRORCODE=-4461, SQLSTATE=42815
at com.ibm.db2.jcc.am.fd.a(fd.java:679)
at com.ibm.db2.jcc.am.fd.a(fd.java:60)
at com.ibm.db2.jcc.am.fd.a(fd.java:85)
at com.ibm.db2.jcc.DB2Driver.tokenizeURLProperties(DB2Driver.java:911)
at com.ibm.db2.jcc.DB2Driver.connect(DB2Driver.java:408)
at java.sql.DriverManager.getConnection(DriverManager.java:571)
at java.sql.DriverManager.getConnection(DriverManager.java:215)
at com.jolbox.bonecp.BoneCP.obtainRawInternalConnection(BoneCP.java:256)
at com.jolbox.bonecp.BoneCP.<init>(BoneCP.java:305)
at com.jolbox.bonecp.BoneCPDataSource.maybeInit(BoneCPDataSource.java:150)
The error message is pretty self-explanatory:
Invalid database URL syntax
You must not have any spaces in the URL, and key-value pairs are separated with semicolons, not commas. Note that you must put a semicolon after the last value too.
jdbc:db2://dxxx_xxx.xxx.com:5000/XXXXX:deferPrepares=false;username=NNNNN;
Details can be found in the manual.
Take a look at this information taken from the DB2 documentation (added link of the reference below).
Message text: text-from-getMessage
Explanation: The specified value is invalid or out of range.
User response: Call SQLException.getMessage to retrieve specific information about the problem.
SQLSTATE: 42815
Reference: https://www.ibm.com/support/knowledgecenter/SSEPGG_9.7.0/com.ibm.db2.luw.apdv.java.doc/src/tpc/imjcc_rjvjcsqc.html

Spring Data + MySql - Referencing non-existant record. Phantom records?

I have a Java Spring application backed by MySql. I have Users (UserEntity) and Lawfirms (LawfirmEntity). I also have a bunch of APIs to access my data. Because I use Spring Data, loading one entity may lead to related entities being loaded.
When I hit my API that's supposed to fetch all lawfirms (i.e. GET /v1/lawfirms), I get the following error:
Unable to find UserEntity with id 108; nested exception is javax.persistence.EntityNotFoundException
Well no kidding, I don't have a User with ID 108 in my Users table! So I figured there was another record somewhere referencing a user with ID 108, but as it turns out, I do not. Where is Spring picking up this user Id 108 from?? Does MySql sometimes cache deleted records?
Would appreciate any help.

Categories

Resources