Zookeeper API change from 3.4.6 to 3.5.5 - apache-zookeeper

I am working on Zookeeper upgrade from 3.4.6 to 3.5.5.
Since org.apache.zookeeper.data package is removed from 3.5.5 I am looking for alternative API.
mvn compilation is failing for below two classes
org.apache.zookeeper.data.ACL and org.apache.zookeeper.data.Stat
Thanks in advance!!

If you conclude that those two packages are removed for later versions of ZooKeeper, this is not the case. However, during the documentation generation for later versions, there is no link for those packages because they are now defined using Jute and not pure java. So to find such documentation, check here:
https://zookeeper.apache.org/doc/r3.6.1/apidocs/zookeeper-jute/

Go into 'zookeeper-jute' project and run "maven generate-sources".
Assuming: Your on eclipse and opened project from parent folder.

Related

Missing Jars when switching from Glassfish to Apache Tomcat Webserver on Glassfish using Eclipse

I am developing an Angularjs frontend which talks to a REST backend. I am developing using Eclipse and was using a Glassfish webserver.
I had the need to create htaccess redirect for Angular routes (see here: htaccess redirect for Angular routes) but to do this I need to change my webserver from Glassfish to Apache Tomcat since the htaccess stuff doesn't exist for the Glasshfish webserver.
When I created the new apache tomcat server v8.0, upon starting the log gave multiple errors for missing JAR files. These JARs were:
avalon-framework-4.1.3.jar
batik-css-1.6-1.jar
batik-ext-1.6-1.jar
batik-gui-util-1.6-1.jar
batik-util-1.6-1.jar
commons-configuration-1.5.jar
logkit-1.0.1.jar
nekohtml-1.9.11.jar
xercesImpl-2.8.1.jar
xml-apis-1.3.03.jar
Additionally, it wants the following JAR which doesn't not seem to be around anymore:
antisamy-1.3-SNAPSHOT.jar
A lot of the JARS mentioned above are old versions of the JARS. What can I do about the missing JAR that is not around anymore?
Also, how do I know if these JARs are the most current versions I should be using? (I added all of them I could find manually in the tomcat /lib directory)
Thanks in advance - I'm quite new to all this stuff so go easy on me:)
EDIT 1: I've included the non-snapshot version of the JAR as per unwichtich's answer. However this doesn't fix the error. Why would the Apache Tomcat v8.0 require such old JAR files to work, especially a snapshot jar? Where would one look to see where these JAR's are configured? Is it possible to know which newer versions of the JARs are compatible with my setup?
antisamy-1.3-SNAPSHOT.jar
First, you should NOT depend on SNAPSHOT dependencies, they can change the programs behaviour in the same version....
Second, SNAPSHOT versions might be seen as beta steps to the final release, so you can not expect that these SNAPSHOT versions are still available online when the final version was released.
A quick googling didn't suggest any old link to antisamy-1.3-SNAPSHOT.jar, but you may try this one: https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/owaspantisamy/antisamy-bin.1.3.jar. This should be the final of 1.3 and if you are lucky it contains the same API as the SNAPSHOT version you used before. If not, you may have to update your code so that it works with the final.
There seem to be newer versions of the lib, you also may want to try them.

Configure log4j2 in Eclipse plugin

How can I get Eclipse plugin to recognize log4j2.xml configuration file? File will be bundled into plugin jar so I cannot rely upon it being on file system. With log4j 1.2, I was able to achieve this in Activator.start(BundleContext) method via a call to PropertyConfigurator.configure(getClass().getResource("/log4j.properties")). log4j2 seems to have nuked that method.
Calling System.setProperty(ConfigurationFactory.CONFIGURATION_FILE_PROPERTY, "/log4j2.xml") or using
-Dlog4j.configurationFile=/log4j2.xml runtime param violate constraints outlined above. I need a solution that will work within the context of Eclipse plugin architecture.
The log4j2 team are currently working on OSGi improvements and this and any other feedback will be very valuable. Please consider raising this on the log4j2 issue tracker or the log4j-dev or log4j-user mailing lists.

Trying to connect to Hadoop 2.0.0 Error : server ipc version 7 cannot communicate with client version 3 in eclipse

I need to connect to a unix system having Hadoop 2.0.0 database using Eclipse Juno on a Windows system.I tried adding an eclipse plug-in for an older version of Hadoop but when I add Map-Reduce Location, I get the following error :
server ipc version 7 cannot communicate with client version 3 in eclipse
As per some blog results through google, the version mismatch is causing the issue.
Can anyone help?
Please help me find the correct plugin or lead me to where I am going wrong.
Unless I add this plug-in I would not be able to coonect to the database..is there any workaround?
Thanks,
Hitz
Couple of things, Hadoop is not a database, it's an opensource framework for distributed computing. You can directly run MapReduce programs on Hadoop with out an eclipse plugin. Simply package the classes in to a Jar, copy the jar to the unix system and use the below command to run the jar.
hadoop jar <Jar Name> <Name of Main Class> <Input Dir> <Output Dir>
If the version of eclipse you have is not compatible with the version of Hadoop or your eclipse. Check the Link to build your plugin.

Cannot find OpenPortal Portlet Container 2.x when creating a new server runtime environment in eclipse

I just started learning portlet and got stuck in the first place. I have installed JavaEE 6 SDK, Eclipse Helios and GlassFish Server 3.0.1. I also successfully configured OpenPortal Portlet Container (OPC) for GlassFish by running command:
java -jar portlet-container-configurator.jar
The problem come up when I wanted to create a new server runtime environment of OPC, there was no "OpenPortal Portlet Container 2.x" node like the tutorial said. I googled and found that I needed to install Eclipse Portal Pack but the link was dead.
Any suggestion, please?
Best Regard.
If you want to develop portlets, I strongly recommend downloading Apache Pluto instead of using the open portlet container; you can download a version of Tomcat bundled with Pluto from their site: http://portals.apache.org/pluto
Actually, Pluto has a few quirks that you need to get past (for example, it wants you to run an 'assembly' step to add some entries to your web.xml) but once you do it is probably the best way. You could also try Liferay or JBoss' GateIn for development, but if you are ultimately targeting a vendor supplied platform like WebSphere, you might find that these actually have features that aren't as portable, whereas Pluto is really just a simple implementation of the portlet spec.
I have found the .jar file on Internet. Thanks for watching.

Maven build deployment

I have to manually deploy my servlet war packages on an Apache tomcat instance running on an AWS (Amazon Web Services) machine (remote server).
Also i have Maven setup for dependency management and build packaging in local development environment.
What I want is to setup my maven install/deploy task such that my packaged war files are deployed and configured(i.e executing specific shell scripts) on the remote server automatically.
Is it possible ?
If yes!!
How can it be done? (Please suggest relevant references.)
Thanks in advance
Ashish
Yes it is possible, you can use the cargo plugin to deploy to a server. See the Getting Started page for some examples.
If your scripts aren't catered for by the plugin, perhaps you could post some more details to see what options there are to address them.
If you are talking about Amazon's Elastic Computing Cloud (EC2), maybe you could check out cloudtools and its maven plugin (see the announcement on Chris Richardson's blog). Never tested myself though.
+1 for cargo plugin, I was not aware of that but could use it myself.
In case it helps you or someone else, you can run any script upon launch of an instance. This blog describes how.