cassandra 3.5 fails to load trigger class - java

I am trying to get started with Cassandra triggers, but I cannot get Cassandra to load them. I have built jar files from here and here, and put them under C:\Program Files\DataStax-DDC\apache-cassandra\conf\triggers. I have restarted the DataStax_DDC_Server service (on Windows) and reopened the CQLSH command line, but trying to use the trigger class in a create trigger command gives me only:
ConfigurationException: <ErrorMessage code=2300 [Query invalid because of configuration issue] message="Trigger class 'org.apache.cassandra.triggers.InvertedIndex' doesn't exist">
I checked the jar files, and they include the class files.
The only thing I could find in the log files of cassandra is Trigger directory doesn't exist, please create it and try again. But I don't know if that is relevant.
EDIT: Following the last line shown here, I edited the cassandra.bat file. Now if I stop the DataStax_DDC_Server service and run the bat file directly, the create trigger command succeeds. Nevertheless, the service seems to be independent of this bat file. The question now is how to apply the same config to the service?

After googling creatively, I found a solution. As mentioned here you need to explicitly set the cassandra.triggers_dir variable, but for the service to pick it up, as explained here, you must configure it in the registry. So the answer is to update the registry key
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Apache Software Foundation\Procrun 2.0\DataStax_CDC_Server\Parameters\Java\Options
and add the line
-Dcassandra.triggers_dir=C:\Program Files\DataStax-DDC\apache-cassandra\conf\triggers
Note that the path should not be enclosed in quotations, or it won't work.
Don't forget to restart the service.

Above solution is working for window. it's difficult in window to find registry option. so to find registry option go to start menu and type "regedit" it will open registry window then you can do above settings.

Related

How does Spring create the base URL for a Maven project

I'm using Eclipse and I'm learning Spring MVC/Rest/Security.
I created a Maven project from scratch but for some reason unknown to me, it refuses to connect to the database.
Then I used a sample project I have from somewhere, but replaced basically every file in it with the ones of the new project. For some miraculous reason this one DOES work even though it's comparably the same as the first one.
But I do have a problem with it: Whenever I try to run this project, under the "Run on server" window, Eclipse shows me the project as
Configured:
new-project-name(original-project-name)
When it manages to run (because it takes forever to load and it sometimes times out), the url given is:
localhost:8080/original-project-name/
instead of the new name I have given. I have replace the original project name in every file I could think of. In the folders that contain it, in "pom.xml" of course, "pom.properties", ".project", ".classpath" and even a eclipse config file called "org.eclipse.wst.common.component", to no avail.
I cannot find what file is it reading it from and I have checked every single one. I think.
Update properties file
/src/main/resources/application.properties
server.port=8080
server.contextPath=/original-project-name/
/src/main/resources/application.yml
server:
port: 8080
contextPath: /original-project-name/

Missing a “Permissions” manifest attribute in Java

I have some problems with opening a SAN switch in Webtools (Java version 8 Update 31).
The first problem was a failed to validate certificate
This was fixed by following the instructions on this site
However, then I got following error:
Which was solved by adding these 3 entries to the site to the exception site list (the last one is the only one necessary I think)
http://i.p.address/*
http://i.p.address/switchExplorer.html
http://i.p.address/
But now I get following error:
your security settings have blocked an application from running due to missing a “permissions” manifest attribute in the main jar web tools
The solution seems to be adding the URL to the exceptions but I have already done that in the previous step..
Open the "Mission Control Panel" of java.
If you cannot find it, have a look in the bin folder of your jdk installation, the executable should be called jcontrol.
Run it, open tab "Security", Button "Edit Site List" and add your URL to the Exception Site List. I.e. https://10.0.0.1 is all you need.
Use oracle java if you use linux and somehow miss jcontrol from the openjdk package.
Afterwards you should be able to start the .jnlp (or however you want to start the applet) of your desire.

Avoid Cassandra 2.1 Warning trigger directory does not exist

Creating a new Cassandra and do a simple insert results in the unexpected warning:
SharedPool-Worker-1] WARN o.apache.cassandra.utils.FBUtilities - Trigger directory doesn't exist, please create it and try again.
Checking the source it seams that Cassandra is expecting a trigger directory (default name 'triggers') to exist.
Since I start a fresh Cassandra every time, I would like to know how I can advice Cassandra to create the triggers directory itself. I do not want to artificially fumble with it.
[update] The Cassandra uses the default main method and is started in the user space. Since during the cassandra.yaml definition the directories for cache, data and third one are created I wonder where to specify the trigger directory or how else it is going to be created.
#close screamers
Having an annoying warning in the logs that should not exist after all is what I consider a bug so please allow this question... . (no offense, just plain stackoverflow begging)
As I learned from the code of the FBUtilities.cassandraTriggerDir method, the property "cassandra.triggers_dir" is read before trying the default trigger directory "triggers". By setting the property to the correct directory (after creation) solved the issue.
The main reason for the problem was first, the triggers directory did not exist at all and second the Cassandra directory is not part of the class path. So there was no way Cassandra could not detect the trigger directory correctly.
So to summaries a cassandra.yaml entry is missing for this issue.
PS: Thanks Bryce for your help!
Do you have a trigger defined on the table you are inserting into, or in your schema? Or did you upgrade Cassandra from a pre 2.0 version?
In any case, the /triggers directory for 2.1 depends on your install type.
For a tarball install, it should be: {install_location}/conf/triggers
For a packaged install, it should be: /etc/cassandra/triggers

Not found exception while doing svn update

I'm having the following situation:
A configuration file (config.cfg) that gets accessed a lot by
different processes.
Config.cfg is under version control - SVN.
I develop and test on a staging environment, when everything is working I go to the server and execute svn up on the config.cfg.
The problem is: During svn up I get an exception by the processes accessing config.cfg: "config.cfg" not found.
It seems that svn causes a short period where the file is beeing replaced and therefore not accessible for my processes.
Any input on how to solve this issue is very much appreciated.
As suggested by ThisSuitIsBlackNot the way to go is to use a semaphor file.
Another solution which just came to my mind is to cache the config file in the process. If it is not there the cached version of the config file is used. As "svn update" doesn't take very long the process will work with cached version until it needs to use the config file the next time.

Is there a way to delete meta-data on Eclipse run configurations?

I may have a corruption problem in Eclipse run configurations. This happened after I dragged (or copy-pasted, I don't remember) a Java class called MyClass from project1 to project2. Then I deleted project1. When I create a new run configuration the name given is MyClass (1). In other words, it thinks there is already a run configuration called MyClass, so the new one will have to have a number appended. (Edit: There is no existing MyClass run configuration so there is no apparent reason for the appended number. In fact, I deleted all of my run configurations.)
How can I easily clean up meta-data and be able to build again with minimal manual effort?
If there is a meta-data deletion recommendation that gets rid of more than just run configurations, that probably would still be a good solution, if it does not create a lot of manual work to get set up to work again.
Edit: The problem might be caused by the fact that there is a launch configuration named MyClass - project1 visible in the export dialogue. project1 no longer exists, but this remnant lives on, tying up the class name MyClass. I am not sure if there is a difference between a run configuration and a launch configuration.
AFAIK launch configurations are stored on:
${WORKSPACE}/.metadata/.plugins/org.eclipse.debug.core/.launches
Take a look to the existent configurations and remove those that are not interesting to you.
And restart Eclipse
Open Eclipse. Follow Run => Run Configurations. You will see options on the left hand side. Under the Java Applications option, you will see the list of runnable classes (the ones have a main method). These class nodes on that list are right clickable. By right clicking on your running configuration, you will see New, Duplicate and Delete options. You can delete your old running configuration via delete option. To create a new running configuration, right click on Java Applications option and click on New and then configure it.
You could try starting eclipse with the -clean command line option.
On windows the easiest way to do that is to copy your shortcut to eclipse and add the option to the arguments list, then start using the new shortcut.

Categories