CloudBees Runtime Classpath - java

I just read the CloudBees whitepaper "CloudBees Advantages: A Guide for Java Developers". In it there is a sentence that reads:
The database is simply available as a JNDI resource as soon as it is deployed – there is no need to chase down JDBC drivers, connection strings and configure JNDI.
So I assume that means I don't need to include a MySQL JDBC driver in my WAR's WEB-INF/lib directory, as apparently CloudBees provides it to the classpath at run time, yes.
This also prompts a few other questions:
What version of the MySQL JDBC driver (and which type) is provided by CloudBees?
Does the same apply for the Cloudant CouchDB service, or drivers/dependencies used by other service partners?
Are there any other libs that CloudBees makes available to the runtime classpath for its clients?
Thanks in advance!

Cloudbees currently provided version 5.1.16 of the MySQL JDBC driver with the jboss stack, and 5.1.15 with tomcat6 and any other stacks. Unfortunately, this information isn't documented anywhere publicly. Caleb Tennis, one of their developers, informed me of this via their IRC channel, #cloudbees.
Regarding Cloudant, it's more or less just CouchDB, so to connect you can use these libraries from the CouchDB wiki.
Alternatively, CouchDB amounts to a REST API, so it might be easier to use a straight HTTP library to make requests and parse responses. Whatever you're most comfortable with, really :D
As for what other libraries Cloudbees makes available to the runtime path, more from Caleb Tennis:
Other than mysql, there are no "guaranteed" runtime libraries - you will need to put them into your war or other package for deployment.

Related

How to connect to MaprDB (Hbase) from Java program without mapr client

I know how to talk to MaprDB from Java program with Mapr client installed. But, want to know how can I connect to MaprDB without Mapr client installed? Is there a pure Java API (i.e. without needing to install any other software, just using some jars) for my requirement?
Please note - these are binary tables (and not JSON tables).
There is an approach that you can use.
The so-called DAG (data access gateway) is a gRPC-based gateway that you can use. There is a pure Java client for this. Performance impact is significant, but not massive and the API is the same OJAI API as when you access the database using the thick client.
See the following links for more information:
https://mapr.com/docs/61/MapROverview/MapRDataAccessGateway.html
https://mapr.com/docs/61/AdvancedInstallation/InstallingDataAccessGateway.html
https://mapr.com/docs/61/AdministratorGuide/AdminMapRDataAccessGateway.html
https://mapr.com/docs/61/EcosystemRN/MapR_Data_Access_Gateway_2.0_release_notes.html
Depends upon your definition of "without needing to install any other software".
You don't need to install the mapr-client package to access the MapR Cluster from a Java application - the MapR jars can be installed to your preferred location on the classpath or even shaded into an "uber" jar.
But you do need to be running on a supported client platform (Linux x86-64, MacOS x86-64, Windows i386 or x86-64), because the maprfs jar does contain JNI libraries packaged within it that it unpacks at initialisation time.

After installing a HAPI FHIR server, what database to use?

I'm new to HAPI FHIR, I created a google cloud compute engine VM, installed java and maven, cloned the hapi-fhir-jpaserver-starter and installed it with :
mvn install
Then runned it to test in my server with :
mvn jetty:run
Now I access it using : http://IP:8080/hapi-fhir-jpaserver
and I get this page :
Now all the resources are empty (patients etc..) , I need to know :
Is this a good server for production ?
What Database the server is actually using and how to access it ?
What type of Database I must set up and how ?
Thanks
EDIT :
I tried to install the hapi server using docker compose, I built the app with mvn clean install and ran the command docker-compose up -d --build but when the installation was finished I get the basic HAPI SERVER (the fresh one) not the version I edited and built.
Any ideas why ?
This s a question of opinion and isn't really an appropriate question to ask on this site. However, there certainly are many systems that do use HAPI in production.
It depends on which server. As per the documentation here, you can either use the 'plain' server and provide your own persistence layer or use the JPA server which uses JPA 2.0 with Derby as the default data store. Details about the database and its structure are defined in the aforementioned documentation
If you're not sure what to do and don't have an existing database you must use, it's probably simplest/wisest to stick with the JPA database as it's already properly configured and works pretty well.
This is an opinion question, so there is not a true right answer.
Having said that, I would stick with "known" setups.
https://smilecdr.com/docs/database_administration/database_design.html
Relationship between smilecdr and hapi
https://smilecdr.com/open-source.html
I am partial to Sql Server or Postgres.
I would not go with Oracle, unless my company is already heavily invested. See image later in this post.
https://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_6014.htm
The command “Create Schema” ‘does not actually create a schema’. #makesPerfectSense But you automatically get a schema when you create a user.
Do what?? I am not a fan of Oracle. Some of it is historical, which is why I think MySql may be the ripped off bandaid.
=========================
2022 UPDATE.
SmileCDR has "discouraged" MySql.
https://smilecdr.com/docs/database_administration/setting_up_mysql.html
Note that as of 2021.11.R01, MySQL is discouraged for production use
due to performance limitations of the database. SmileCDR will continue
to support customers on this database, but if serious performance
issues arise, we will suggest migrating to a more performant database.

Webservice for TLS 1.2 testing

Our enterprise datawarehouse (EDW) sources data from many interanal & external sources. We use Oracle data integrator (ODI) as teh ETL tool to extract data from the sources. ETL jobs are executed using an ODI agent which is nothing but a Java process. One of the external sources for the warehouse is a webservice. Data is extracted from this webserice using Jython (wrapped within ODI). Jython as you might know is a Python variant which runs within JVM. The Jython job runs under the ODI agent (java) process and extracts data from the webservice.
Coming to the problem we are facing now- The external webservice provider has indicated that soon they will support only TLS 1.2 and will remove support for older TLS connections. The ODI agent is currently on JDK1.6 Update 33 and support TLS 1.1. We are planning to upgrade the ODI agent to Java 7 (which supports TLS 1.2) so that we will be able to connect to this webservice. The Java upgrade involves lot of work mainly to ensure that it does not break existing ETL jobs. If there are any impacts, we might not be able to upgrade. An alternate option is it create a separate Java process (outside of ODI) running under its own JDK (which can be even Java 8) to connect to this web service.
Are there any risks in the above options? It is going to take a while for the provider to give the webservice which supports only TLS 1.2. Are there any public webservices which support only TLS 1.2 that can be used by for our testing? Can you please share them?
Maybe not entirely what you're looking for, but it might be wise to have two seperate development projects for both the old and the future ODI agent to keep things transparent. Especially when testing the new version. It's also advisable to set up a dedicated testing/QA environment for this.
Be sure to keep your production ODI repository safe, you could use a testing repository with some exported projects for this. Maybe this link below might be useful: https://www.redbridgesoftware.com/products/life-cycle-management-for-odi.html

How do you access SQL database from GWT?

I've read some articles on the Internet that this is not possible. To communicate own SQL database that is located on other server from GWT application. Jetty doesn't allow it.
I found a way how to perform it but it's not very cosy. I have client and server part inside GWT. The server has to communicate with MySQL database on localhost. So I've written an ant script to build a war that I can launch on Apache Tomcat server. It works perfectly there but I'm not able to debug the code effectively.
Do you have some advices how to perform this task? I was thinking of writing the clienty only in GWT and find some waz how to communicate my own server written outside the GWT. I've found Apache Thrift for GWT but this edited library of thrift seem not to work properly.
Thank you very much for your answers:)
It is possible to communicate with a database from a GWT application. The client side has to call the methods of the server via GWT-RPC, which can communicate with any database.
Maybe Jetty does not support it (have not tested it personally) but you can develop your web application using Apache too. There you can access the database the same way as from any web application:
You will need the mysql-connector-java-5.1.20-bin.jar file (downloadable from: http://dev.mysql.com/downloads/connector/j/ ), and restart the server added to the $CATALINA_HOME/common/lib directory.
OR added to the WEB-INF/lib folder of your web application.
You can find tutorials online of how to develop an application using Tomcat instead of Jetty. For example: https://wiki.auckland.ac.nz/display/BeSTGRID/Deploying+GWT+to+Tomcat+in+Eclipse
Reshi, stop and think about how applications really work. Nobody provides web pages with javascript to read/write databases, that would be crazy and unsecure. Servers are always in themiddle of all communication in this case. You need to create services that run inside your server, one of these services will be a database layer.
Javascript cant create network connections and read/write binary data, thus it would be insane to attempt to get the gwt compiler to compile any jdbc drvier and more.
Jetty does NOT stop us from connecting to a database. All you have to do is to follow the MVP model way. Although MVP is better bet against all hurdles, at a minimal point, you would have to try not having SQL code on the client package.

Should I implement source control for j2ee application server configuration files?

For a typical J2EE web application, the datasource connection settings are stored as part of the application server configuration.
Is there a way to version control these configuration details? I want more control on the datasource and other application server config changes.
What is the standard practice for doing this?
Tracking configuration changes to your application server through version control is a good thing to ask for. However, It does imply that all changes are done via scripting, instead of the administrative web interface. I recommend
http://www.ibm.com/developerworks/java/library/j-ap01139/index.html?ca=drs-
as a good background information article on this topic.
Update: Just recently, part 2 has been published here: http://www.ibm.com/developerworks/java/library/j-ap02109/index.html?ca=drs-
When working with WebSphere we found the best approach was to script the deployment and place the script under version control plus the response files for each of the target environments.
Websphere canbe tricky as the directory structure is a mess of files - often there appears to be duplicates and it's hard to figure which is the magic file you need to backup / restore . The question of how to go about this should not detract from the need to do it. - which is a definite yes.
Our (Spring) apps have a hardcoded jndi name in the spring config file. That way, the same ear can be deployed to dev, qa and prod environments, and you don't have to worry about database connection details.
The app server admins ensure that a datasource is registered against that jndi name, with the connection details as appropriate on each environment.
But how does this let me manage changes to datasource configurations in the application servers. Here's a scenario:
DBAs change the connection password of the database server.
Webspehere/Weblogic administrator makes corresponding changes to server configuration through administrator console.
The above change is not version controlled so there is no clean way of knowing the history of such changes.
The problem is not about how the application should be configured but about how the configuration changes should be version controlled. Perhaps it sounds like an overkill for simple projects but for some projects, controlling changes like these really becomes a problem.
Any time you ask yourself "should X be in version control" the default answer is "yes".
For a more refined answer, ask yourself this: is the file created by a person (like a source file or a document) or is it generated by another program (like an object file or a distribution PDF)?
File that are created, and/or maintained, by a human should be under configuration control.
We are always using version control for our app server settings. It's a tool called WLST (weblogic scripting tool) which is part of the weblogic server distribution. The domain configuration is stored within a Jython script, which can easily be executed via command line and therefore integrates superb with our build tool maven.
Creating a preconfigured running weblogic domain only needs to execute a maven goal. All those annoying problems of misconfigured jdbc connections or wrong jms destination parameters are gone. You will always have a appserver configuration which matches the source code at a given time. You will never need to remember which app server setting must be applied for this specific version of the project you are working on.
I really recommend this.
I also would like to know, if there are similar solutions for other application server available. As far as i know there is a way for glassfish via ant. How this can be achieved for JBoss?

Categories