ActiveMQ KahaDB compatibility - activemq

We want to upgrade ActiveMQ 5.3 to 5.6 and also keep the connections information.
Here is what we do,
Backup files under data\kahadb\ and uninstall AcitveMQ 5.3
Install ActiveMQ 5.6
Overwrite the files under data\kahadb with previous backup files
if the count of my clients is about 20, it works well.
if the count of my clients is more than 100, i can't connect to my broker again.
here are the logs in wrapper.log
Failed to load: class path resource [activemq.xml], reason: Error creating bean with name 'org.apache.activemq.xbean.XBeanBrokerService#0' defined in class path resource [activemq.xml]: Invocation of init method failed; nested exception is org.apache.kahadb.page.Transaction$InvalidPageIOException: Page id is not valid
we got some exception when we created a consumer:
Apache.NMS.ActiveMQ.BrokerException: java.io.EOFException :
Apache.NMS.ActiveMQ.Connection.SyncRequest(Command command, TimeSpan requestTimeout)
Apache.NMS.ActiveMQ.Session.CreateConsumer(IDestination destination, String selector, Boolean noLocal)
Apache.NMS.ActiveMQ.Session.CreateConsumer(IDestination destination)
Is the db compatible issue? or how to keep the connection data after upgrading MQ?

According to this thread : http://activemq.2283324.n4.nabble.com/Migrate-existing-kahaDB-to-a-new-version-of-ActiveMQ-possible-td4486455.html, if overwriting the DB is not working, you could simply create a Camel route that consumes msgs from the old broker instances and loads them onto the new broker. Some properties like timestamps or message ids will be changed however.

Related

Camel AWSS3 Component with Idempotent Consumer EIP throws software.amazon.awssdk.services.s3.model.NoSuchKeyException:The specified key does not exist

I am trying to use Camel AWS2 S3 component to retrieve objects from AWS S3 service.
Since more than one instance of this route will be running, I am using Idempotent
Consumer EIP in the route to filter out duplicates. I am using hazel cast idempotent repository in the route.
When I am running one instance of the application, everything works fine.
When I am running two instances of the application, I am seeing **software.amazon.awssdk.services.s3.model.NoSuchKeyException: The specified key does not exist.**
The file consumption is not a problem and it's working fine.
If application instance 1 is consuming a file from s3, sometimes I am seeing the error in application instance 2.
If application instance 2 is consuming a file from s3, sometimes I am seeing the error in application instance 1.
My route:
`from("aws2-s3://test-bucket?prefix=mypoc&moveAfterRead=true)
.routeId("myRoute") .idempotentConsumer(simple("${header.CamelAwsS3BucketName}-${header.CamelAwsS3Key}"),repository)
.skipDuplicate(true)
.log(LoggingLevel.INFO, "Message recieved{}",String.valueOf(simple("${header.CamelAwsS3Key}")));`
Exception:
Caused by: \[software.amazon.awssdk.services.s3.model.NoSuchKeyException - The specified key does not exist. (Service: S3, Status Code: 404, Request ID: WNVX1YQWZQWAFNMB, Extended Request ID: Vm1pTrjSbM71R9h/f7+ypr60/Gn4j5pzgCZDsAhtVzd9QZBGBbrq8U14DMPWf0GOmy5/pmJvbno=)\] software.amazon.awssdk.services.s3.model.NoSuchKeyException: The specified key does not exist. (Service: S3, Status Code: 404, Request ID: WNVX1YQWZQWAFNMB, Extended Request ID: Vm1pTrjSbM71R9h/f7+ypr60/Gn4j5pzgCZDsAhtVzd9QZBGBbrq8U14DMPWf0GOmy5/pmJvbno=)at software.amazon.awssdk.core.internal.http.CombinedResponseHandler.handleErrorResponse(CombinedResponseHandler.java:125) \~\[sdk-core-2.17.247.jar:na\]
But I am wondering why I am seeing the exception.Looks like both the instances are trying to consume the file and one of the instance is throwing the error.
Any insights on why we are seeing the exception?

EJB Timer Service is not available, undeployment failed for context

I have the following code:
package ejbs;
import javax.annotation.Resource;
import javax.ejb.Singleton;
import javax.ejb.Timeout;
import javax.ejb.Timer;
import javax.ejb.TimerConfig;
import javax.ejb.TimerService;
#Singleton
public class timerbackup {
#Resource
private TimerService timerservice;
#Timeout
public void methodTimeout(Timer timer)
{
System.out.println("timeout");
}
public void settimer(long in)
{
Timer timer=timerservice.createSingleActionTimer(in,new TimerConfig());
}
}
After deploying the application appeared the error message "EJB Timer Service is not available".
To solve the problem i followed these steps:
Access the glash fish admin console (http://localhost:4848)
Go to Configurations->server-config->EJB Container
Select the tab EJB Timer Service
Then fill out Timer Datasource: with your JDBC Resource (i used "jdbc/projecto_final")
Restart the server
As suggested in Set/configure the EJB Timer Service’s DataSource.
This resulted but after sometime the TimerService stopped working. After deploying the application appears the following error messages:
Severe: Exception while loading the app
Severe: Undeployment failed for context /ProjetoEE1
Info: /file:/E:/formacaoJAVA/2moduloJEE/pratica/projecto_final /projfinal2/ProjetoEE1/build/web/WEB-INF/classes/_DEFAULT_PU logout successful
Warning: EJB Timer Service is not available. Timers for application with id 96332697224871936 will not be deleted
The Set/configure the EJB Timer Service’s DataSource also mention this problem, and present a solution in Glassfish DeploymentException: Error in linking security policy for.
The solutions presented in Glassfish DeploymentException: Error in linking security policy for consists basically in delete some files. The answer more voted suggests basically the following:
Stoped the Glassfish server
Deleted all the content from glassfishhome/glassfish/domains/ yourdomainname/generated
Started Glassfish
I have installed the "GlassFish Server 4.1.1", and this doesn´t work.
The second answer more voted suggests the basically the following:
1.All that's needed to fix this problem is delete the entire OSGi cache under $GLASSFISH_HOME/glassfish/domains//osgi-cache
This also doesn´t work.
What i can do? Any help will be very appreciate
Best regards,
Rafael Costa
I have solved the "same" problem in
deleting glassfish/domains/domain-name/generated folder completely
building application again
restarting glassfish application
In my case, I have installed a new version of my application after a Pull/Push operation with GIT and my application has stopped to work. So I know that before this new build my application worked well and that nothing has been changed on Glassfish.
I have found some explanation on another following site
https://dzone.com/articles/solving-ejb-timer-service-not-available-error-in-g-1
The Glassfish application server uses its embedded JAVADB to persist the state of its available EJB timers. Not setting the data resource for the timer service correctly prevents the EJB timers from being restored and eventually from functioning properly. In this case, normally the “EJB timer service not available” error message is returned. This problem prevents any application that uses an EJB timer service from being started or deployed.
There are two procedures available to overcome such blocking situations:
The first solution is to go to JDBC connection pools and double check the health of the Timerpool connection pool by pinging it. If the ping fails then the connection pool needs to be checked or to be redefined.
If pinging the connection pool is successful, then the problem could be the presence of the EJB timer marker file. A marker file is created whenever a problem occurs during the EJB timer service start-up or restore.
Deleting the marker will solve the problem. The marker file "ejb-timer-service-app" located under as-install-parent/glassfish/domains/domain-name/generated/ejb/. Dont forget to restart Glassfish !
Replace
import javax.ejb.Singleton;
With
import javax.inject.Singleton;
It worked for me. I'm using Derby database is it the case for you?
I solved the problem. If i remenber, i created a new JDBC resource and a new JDBC Connection Pool.
The following link explains how to create a JDBC resource and a JDBC Connection Pool.
General Steps for Creating a JDBC Resource
The JDBC resource and the JDBC Connection Pool can be created using the admin console or the asadmin utility.
The following link explains how to use the asadmin utility.Using the asadmin Utility
(I used this utility because in the admin console when i tried to create a JDBC resource and a JDBC Connection Pool appeared an error)
In the admin console, in the created JDBC Resource the field "Pool Name" should equals the name of the created JDBC Connection Pool.
After that i followed these steps:
Configurations->server-config->EJB Container
Select the tab EJB Timer Service
Fill the field Timer Datasource with the name of the JDBC resource.
Restart the server
Any question please feel free.
Best Regards Rafael Santos Costa
Hello I met the same problem if you have glassfish 4.1.1 there is probably an instability in the server with respect to timer.
Solution: update glassfish 4.1 to glassfish 5 and deploy the web application in this new server

Could not connect to ActiveMQ Server - activemq for mcollective failing

We are continuously getting this error:
2014-11-06 07:05:34,460 [main ] INFO SharedFileLocker - Database activemq-data/localhost/KahaDB/lock is locked... waiting 10 seconds for the database to be unlocked. Reason: java.io.IOException: Failed to create directory 'activemq-data/localhost/KahaDB'
We have verified that activemq is running as activemq, we have verified that the owner of the directories are activemq. It will not create the directories automatically, and if we create them ourselves, it still gives the same error. The service starts fine, but it will just continuously spit out the same error. There is no lock file as it will not generate any files or directories.
Another way to fix this problem, in one step, is to create the missing symbolic link in /usr/share/activemq/. The permissions are already set properly on /var/cache/activemq/data/, but it seems the activemq RPM is not creating the symbolic link to that location as it should. The symbolic link should be as follows: /usr/share/activemq/activemq-data -> /var/cache/activemq/data/. After creating the symbolic link, restart the activemq service and the issue will be resolved.
I was able to resolve this by the following:
ensure activemq is owner and has access to /var/log/activemq and all sub dirs.
ensure /etc/init.d/activemq has: ACTIVEMQ_CONFIGS="/etc/sysconfig/activemq"
create file activemq in /etc/sysconfig if it doesnt exist.
add this line: ACTIVEMQ_DATA="/var/log/activemq/activemq-data/localhost/KahaDB"
The problem was that activeMQ 5.9.x was using /usr/share/activemq as its KahaDB location.

Listing and adding JMS Physical Destinations to GlassFish v3.1

After adding a destination(Queue) to Destination Resources from Admin Console at Resources/JMS Resources/Destination Resources, no physical destinations are displayed at server(Admin Server)/JMS Physical Destinations .Instead, the following error message is displayed below the heading:
An error has occured
Unable to list JMS Destinations
Also, on trying to add a new Physical Destination at server(Admin Server)/JMS Physical Destinations, of type 'Queue', following error message is displayed:
An error has occured
Unable to create JMS Destination
On trying to add a Physical Destination using asadmin in command-line as:
asadmin> create-jmsdest -T queue DemoQueue
the following error is displayed:
remote failure: Unable to create JMS Destination.
Command create-jmsdest failed.
Here, GlassFish Server Open Source Edition 3.1-b24 is run on Ubuntu with kernel 2.6.28-11-server.
Any help is appreciated.
I don't think that you should create physical destinations manually. All you need to do to set up JMS resources in GlassFish is defining a connection factory and destinations - all under Resources - JMS resources branch in admin interface. When your destinations are used physical destinations will be created automatically.
confused me to no end first time so I sympathise
For GFv2.1.1 (and I suspect for v3) a physical destination - mq.sys.dmq - is already created and configured and queues are created here. The messaging server is SunMQ and if it is your intention to use this out-of-the-box then you don't need to create another physical destination.
if you do indeed need to create another physical destination launch [path-to-glassfish]/imq/bin/imqadmin.exe (or ubuntu equiv) and do it there.

OSB WLS Initialisation issue

facing some strange behavior in OSB, i have configured WLS with MQ in client mode, i am doing some minor test to check the connection, i have created a proxy service to read the message from Q1 and a Business Service(BS) to route it to Q2. The issue is the proxy is able to read the message but the BS is throwing this:
JMSPool BEA-169807 There was an error while making the initial connection to the JMS resource named ALSB_JMS_SessionPool_491704821 from within an EJB or a servlet. The server will attempt the connection again later. The error was javax.jms.JMSException: [JMSPool:169803]JNDI lookup of the JMS connection factory AKBConnFact failed: javax.naming.NoInitialContextException: Cannot instantiate class: com.sun.jndi.fscontext.RefFSContextFactory [Root exception is java.lang.ClassNotFoundException: com.sun.jndi.fscontext.RefFSContextFactory
Note: The classpath or the domain/lib folder contains the RefFSContextFactory class
Any ideas gang..? TIA
The answer is this is a bug in OSB which needs to be reported.
As a workaround you need to individually set the jars in the weblogic classpath in your domain/server/bin folder. just go through the link below for more details:
http://forums.oracle.com/forums/thread.jspa?threadID=2135523&start=0&tstart=0