I have installed Weblogic 12.2.1 and the latest Logstash 7.5.2 version as well as the JMS plugin v3.1.2. I am struggling with the JMS plugin, and I have already set the .conf and .yml, but it doesn't work!
In the destination field the documentation and the examples suggest no JNDI name, just the queue or topic name!
The input of the jms.conf:
input {
jms {
pub_sub => false
include_header => false
include_properties => false
include_body => true
use_jms_timestamp => false
yaml_file => "/home/chris/Downloads/logstash-7.5.2/config/jms.yml"
yaml_section => "weblogic"
destination => "DemoQ"
}
}
The jms.yml:
weblogic:
:jndi_name: jms/DemoCF
:jndi_context:
java.naming.factory.initial: weblogic.jndi.WLInitialContextFactory
java.naming.provider.url: t3://localhost:7001
java.naming.factory.url.pkgs: javax.naming:javax.jms
java.naming.security.principal: weblogic
java.naming.security.credentials: *****!
:require_jars:
- /home/chris/Downloads/wlogic/fmw_12.2.1.0.0_wls_quick_Disk1_1of1/wls12210/wlserver/server/lib/wlthint3client.jar
- /home/chris/Downloads/wlogic/fmw_12.2.1.0.0_wls_quick_Disk1_1of1/wls12210/wlserver/server/lib/wljmsclient.jar
- /home/chris/Downloads/wlogic/fmw_12.2.1.0.0_wls_quick_Disk1_1of1/wls12210/wlserver/server/lib/wlclient.jar
and the ouput of the Logstash:
[2020-01-31T14:50:10,284][WARN ][logstash.inputs.jms ][main] JMS Consumer Died {:exception=>"Java::WeblogicJmsCommon::JMSException", :exception_message=>"[JMSExceptions:045101]The destination name passed to the createTopic or createQueue "DemoQ" is invalid. If the destination name does not contain a "/" character, then it must be the name of a distributed destination that is available in the cluster to which the client is attached. If it does contain a "/" character, then the string before the "/" must be the name of a JMS server or a ".". The string after the "/" is the name of a the desired destination. If the "./" version of the string is used then any destination with the given name on the local WebLogic Server instance
After days I figured this out! In the field of destination use:
jmsmodulename!destinationname (from docs of Oracle ) ,
for a clustered environment!!
Neither "/" nor "./"
Logstash doesn't use JNDI to lookup the destination but instead simply uses the JMS API to call javax.jms.Session.createQueue() (if pubsub is false) or javax.jms.Session.createTopic() (if pubsub is true).
Although I'm not very familiar with WebLogic it seems the error message that it is returning is pretty clear:
The destination name passed to the createTopic or createQueue "DemoQ" is invalid. If the destination name does not contain a "/" character, then it must be the name of a distributed destination that is available in the cluster to which the client is attached. If it does contain a "/" character, then the string before the "/" must be the name of a JMS server or a ".". The string after the "/" is the name of a the desired destination. If the "./" version of the string is used then any destination with the given name on the local WebLogic Server instance
It indicates that your configuration is invalid, specifically this bit:
destination => "DemoQ"
It also appears to be recommending that you use this instead:
destination => "./DemoQ"
Related
Trying to set ConnectorClientConfigOverridePolicy, by adding CONNECTOR_CLIENT_CONFIG_OVERRIDE_POLICY=All. During start up debezium connector fails with matches all=All. Seems, CONNECTOR_CLIENT_CONFIG_OVERRIDE_POLICY duplicates value, instead "All", value is "all=All"
Stopping due to error [org.apache.kafka.connect.cli.ConnectDistributed]
org.apache.kafka.connect.errors.ConnectException: Failed to find any class that implements interface org.apache.kafka.connect.connector.policy.ConnectorClientConfigOverridePolicy and which name matches all=All
Is it bug or I am doing something wrong?
Using debezium docker 1.5
this is partly bug and partly misconfiguration.
The env var should be named CONNECT_CONNECTOR_CLIENT_CONFIG_OVERRIDE_POLICY=All
But at the same time the start script that processes all env vars named CONNECT_ does not check for the underscore so CONNECTOR... matches too which breaks the further logic.
I've special characters such as " (doublequotes), #, ~, !, %, &, }, ] in the datasource password field. When I run my springboot app and when it attempts to connect to the database I run into -
com.microsoft.sqlserver.jdbc.SQLServerException: The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: "problem accessing trust store"
Caused by: java.security.KeyStoreException: problem accessing trust store
Caused by: java.io.IOException: Keystore was tampered with, or password was incorrect
Caused by: java.security.UnrecoverableKeyException: Password verification failed
My questions are :
(1) Is there a way to view what password is Spring using to attempt the connection?
(2) Do I need to escape any of the special characters in the password in the application.properties?
I was able to connect to the database using a standalone java program but I had to escape the double quotes in the password. I'm using Springboot-2.0.4, Flyway-5.2.4, jdk 1.8 and MS-SQL server on the backend.
Thanks.
application.properties: No escaping is required for your specified characters.
If you use e.g. a backslash, you'd need to escape it with another backslash, like so: C:\\Development\\mydir
application.yml: Surround value with " and escape embedded " like this \"
Note: application.yml is outside question from OP. Use either application.properties or application.yml, not both.
Tested and verified with this entry in application.properties
myapp.entry-with-special-characters=#~!%&=""
And tested again with this entry in application.yml
myapp:
entry-with-special-characters: "#~!%&=\"\""
Output value to console like this (put code inside e.g. class annotated with #SpringBootApplication, will run when application starts)
#Bean
public CommandLineRunner propertiesTest(#Value("${myapp.entry-with-special-characters}") String myVal) {
return args -> System.out.printf("Test-output for StackOverflow: %s\n", myVal);
}
With Flyway, try this instead
/**
* Override default flyway initializer to do nothing
*/
#Bean
FlywayMigrationInitializer flywayInitializer(Flyway flyway, #Value("${myapp.entry-with-special-characters}") String myVal) {
System.out.printf("Test-output for StackOverflow: %s\n", myVal);
return new FlywayMigrationInitializer(flyway, (f) ->{} );
}
Spring Boot: Hibernate and Flyway boot order
Answer to the question
Is there a way to view what password is Spring using to attempt the
connection?
can be to replace the key myapp.entry-with-special-characters in the above bean with relevant key from application.properties. Please keep in mind that passwords are secrets.
Environment used during testing:
Spring Boot 2.4.1
JDK 14.0.2
Windows 10 Home
I want to run a jmeter test, which listens to a port on a given ip, and prints the messages which are being sent to that port. I have tried using this:
SocketAddress inetSocketAddress = new InetSocketAddress(InetAddress.getByName("<client ipAddress>"),<port number>);
def server = new ServerSocket();
server.bind(inetSocketAddress);
while(true) {
server.accept { socket ->
log.info('Someone is connected')
socket.withStreams { input, output ->
def line = input.newReader().readLine()
log.info('Received message: ' + line)
}
log.info("Connection processed")
}
}
But this is giving me error - "Cannot assign requested address: JVM_Bind
"
Is there any alternate way to approach this? Or what changes do i need to do for the current approach to work?
You copied and pasted this code from the right place and it should work just fine. Evidence:
as per the BindException documentation
Signals that an error occurred while attempting to bind a socket to a local address and port. Typically, the port is in use, or the requested local address could not be assigned.
So I can think of 2 options:
Your <client ipAddress> is not correct and cannot be resolved.
Something is already running on the <port number>, you cannot have 2 applications listening to the same port, the first one will be successful and another one will fail
More information:
Fixing java.net.BindException: Cannot assign requested address: JVM_Bind in Tomcat, Jetty
Apache Groovy - Why and How You Should Use It
I'm using Spark1.3.1 trying to read data from HDFS as:
val sc = new SparkContext(sparkConf)
val lines = sc.textFile("hdfs://192.168.0.104:9000/cur/part-r-02554")
I met the following excepton:
Exception in thread "main" java.io.IOException: Failed on local exception:
com.google.protobuf.InvalidProtocolBufferException: Protocol message end-group
tag did not match expected tag.; Host Details : local host is:
"hadoop104/192.1168.1.104"; destination host is: "hadoop104":9000;
Try looking for property fs.defaultFS or fs.default.name in your core-site.xml. Check if 192.168.0.104 is configured as value, and not a hostname.
If a hostname is configured as a value, this is bound to give you an error - as this is very strictly followed. Either, use whatever is configured in core-site.xml or do not use an IP/hostname and just go ahead with hdfs:/cur/part-r-02554
I have this exception when I am trying to connect my oracle database to my application on Play! Framework 2.1.5 (the problem concerns the ebean.default="models.*" line) :
Configuration error
path parameter: Invalid path ' - could not find datasource for default': Token not allowed in path expression: '-' (Invalid number: '-') (you can double-quote this token if you really want it here)
In C:\MyApps\oracleCrud2\conf\application.conf at line 54.
51# You can declare as many Ebean servers as you want.
52# By convention, the default server is named `default`
53#
54 ebean.default="models.*"
55
56# Logger
57# ~~~~~
58# You can also configure logback (http://logback.qos.ch/), by providing a logger.xml file in the conf directory .
Some help would be appreciated :)
I am answering my own question. Here is the working part of the application.conf that deals with Oracle connection with Play! :
db.default.driver=oracle.jdbc.driver.OracleDriver
db.default.url="jdbc:oracle:thin:#//127.0.0.1:1521/xe"
db.default.user=play
db.default.password=play
Hope that I helped, have a good one !
-Ramzi