BlazeDS on GAE (Detected duplicate HTTP-based FlexSessions) - java

Is BlazeDS 4 work with Google App Engine. I'm using BlazeDS 3.2.0 and getting an such an error
Detected duplicate HTTP-based FlexSessions, generally due to the remote host disabling session cookies. Session cookies must be enabled to manage the client connection correctly.
Is it possible to point out a place where I can download the compiled blzeds jar files that work with GAE since I'm facing troubles downloading the source code from the site(slow internet connection at a place I work).

If you need messaging do not use BlazeDS on Google App Engine. For remoting, several guys created some patches. One is here.

Related

REST API Deployment for Spring MVC

Currently I'm learning to build a REST API (backend) with the ionic application (frontend), but I'm facing an issue in backend REST API deployment. Thus, I'm asking this question to get some clues and answers related to REST API deployment, since I'm really new and no clue how to deploy a REST API. I had checkout some tutorial on youtube, but it seem like most of the example in videos are not using the technologies or environment that same as the REST API I built. The following shown the technologies I used to built my system frontend and backend:
REST API (BACKEND):
Language: Java, Spring MVC Framework
Database: Hibernate, Oracle SQL Developer
Web App Build Technology: Gradle, Gretty (To app start my application)
Ionic Application (FRONTEND):
Technologies: Angular Framework, HTML, CSS
How the application is working in localhost?
STEP 1: I will app start using Gretty plugin in gradle
STEP 2: I active the command "ng serve" (ionic serve) to run my ionic application
STEP 3: After both frontend and backend is successfully run, now I can access the provided link that generated from ng serve to access my web app and do anything I want.
Everything is working perfectly in local system, but it is different case when I test my ionic web app through my smartphone (Since ionic allows us to build progressive web app). The frontend ionic application will not able to communicate with backend when the operating environment of frontend is not in local system and I know it's really make sense, since my backend REST API haven't deploy which only able to operating on localhost. Therefore, I'm have tried to find solution on youtube and other internet sources to deploy my rest api online, but I don't see any information or deployment video that using the same technologies as I used to built my rest api (Spring MVC, oracle developer, gradle).
Thus, I'm asking this "stupid" question in here to find out whether any solution to deploy my rest api? or any suggestion to change the technologies that I used to built my rest api? or any mistakes I had made which violate the best coding practice in building rest api.
As a new programmer, I really appreciate the answers from all you guys. Thank you.
First, let's explain some concepts:
You backend is the application you coded, deployed on a server that exposes an endpoint for access - e.g. http://localhost:8080/yourApp - where your host/domain is your current computer (localhost) and the port is 8080 or anything you setup.
If you want to access from you smartphone:
1) Since your app is hosted on your pc, you need to be connected to the same wifi network
2) From your host machine, where you deployed your app, look for your ip address.
open your console/terminal
type ipconfig/ifconfig
look for your wifi and copy ipv4 address
3) redeploy your frontend pointing to your host machine ip
It worked before because you where on the same machine (localhost means redirect to your own device). When you switched to your phone it, also, redirects to your own smartphone.

Java Mail Session Resource config in Play Framework Netty Server

I am trying to configure the Java Mail Sessions Resource in the Netty server Play config and loop up this resource using JNDI in my application. I couldnt find this in Play framework documentation nor any articles for this set up. I also looked up on the Play code, but no luck.
https://github.com/playframework/playframework/blob/master/framework/src/play-netty-server/src/main/resources/reference.conf
https://github.com/playframework/playframework/blob/master/framework/src/play-netty-server/src/main/scala/play/core/server/NettyServer.scala
Play Version: 2.4.6
HTTPmail.setMailSessionFromJNDI("java:comp/env/mail/myemailserver");
Could anyone guide me to some articles or share the knowledge?
We are deploying our play applications in tomcat environment and the resources are expected to looked up from server configurations through JNDI. As a first step, I am trying to make the application work in Netty during development and move to TOMCAT later. thank you for the guidence.
If you want to use the sessions in the same way as in Tomcat's HttpSession, you should forget it immediately. Play Framework can store only String instances. In additionally, session data can take only 4kb of data because data is stored in the cookie called PLAY_SESSION. This kind of constraint a little bit logical. If enhances stateless character of the application, so also its scalability. For more complex use of Play sessions (shopping carts), you should think about alternatives as NoSQL, file system or database.
Read this

Unable to use J2ssh library in GWT application server code to make SSH connection

I am writing a GWT application and in that I am trying to make SSH connection to a server using private key. For this I am using J2SSH library. But, while executing this, I am getting the following error:
How can I make SSH connection to a remote server from GWT application server package? Please advice.
It looks like you are getting an Access Control issue with the application environment.
Here it is stated that
The problem occurs if you mistakenly enabled the Google App Engine feature for your project when you created the project, or at a later time during development, and have server-side libraries or classes packaged with your GWT application war folder that violate the Java App Engine sandbox."
You may also want to consider upgrading the J2SSH library, if you want a similar interface to J2SSH use the more recent J2SSH Maverick release from the same author (that is me btw).
This version of the API does not try to set any thread properties and therefore if you do need to run this in the Google App Engine you will have more success.

Creating an application with Google Web Toolkit that interacts with MySQL

I've created a web application in Java with Google Web Toolkit (GWT). On the client side, GWT generates an input box and (using the GWT search api) conducts a web search. I'd like to push some of the information from the web search into a MySQL database so that it can be analysed using a machine learning application (Weka). I've got an RPC running that interacts with server side code. In that server side code, I tried to establish a connection to the MySQL database.
I'm currently running the project locally, so, as far as I can tell, google app engine is hosting it. This is supported by the fact that when I run the application I get the following message:
Initializing AppEngine server
Logging to JettyLogger(null) via com.google.apphosting.utils.jetty.JettyLogger
The server is running at http://localhost:8888/
However, although I'm able to use the search part of the application, it throws an exception when trying to connect with my MySql database.
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server.
Caused by: java.security.AccessControlException: access denied (java.net.SocketPermission mysql.database.location resolve)
I've tested the database connection from a regular (non-web based) Java program and there's no problem connecting to it from outside of the web application. I believe that I'm getting this error because google app engine won't allow connections to outside databases.
In short my questions are:
1. Although I'm using Google App Engine, is it possible to use a server side code to connect to MySQL? (I'm assuming no, but this would be ideal).
2. Is it possible to switch to another server (like Tomcat)? If so, can anyone point me to references about how to do this? I found an old stackoverflow question about how to use tomcat (http://stackoverflow.com/questions/2208181/gwt-app-deploying-on-tomcat-or-any-other-servlet-container) but it no longer directs to a place that has information about using other servers.
Thanks for your help and please feel free to ask follow up questions if you'd like me to provide more info.
GAE disallow any access to other servers. You can use URLFetch service, but it's probably not what you want, and you cant use it for MySQL connection. BTW, you can create your own, http based protocol, for interacting with your other modules, but it's may be too complicated.
GWT compiles to javascript, and it works only on client-side, so it' doesn't matter what you're using on your server side, it could be used any programming language and any webserver (remember that you can use JSON to communicate, instead of default protocol). It's just default implementation of RPC build using java servlets, and you can use it inside any java web container, including tomcat. GWT was developed few years before GAE, it's totally independent projects, and it isn't requires to use GAE for server side.

Server to run java servlet

I'am developing a java servlet application, and tesing it on Eclipse + Apache Tomcat (refer: http://www.vogella.de/articles/EclipseWTP/article.html#overview_wtp).
The application is now tested on the localhost and accesed by any clients on the same LAN.
Now, I need to deploy it into the web server, where everyone from anywhere can access this servlet.
Coud you guide me the way that I've to do to archive this task.
You need to have a computer accessible to everyone - i.e. placed on the internet and not behind a firewall - with the appropriate software installed (and hardened against hacker attacks).
If you do not have such a computer, you can have a look at the Google Application Engine which allows you to deploy Java web applications (with some additional restrictions) to the Google cloud. This is free for low-volume applications.
Yes, you can do it by deploying your application in the Cloud Instance. Since we cannot able to make our server instance or computer to be run always(We may come across internet connection problems, Power Fluctuation, etc.,), We have lot of problems while making our instance public(In Security perspective too). So it is better to use cloud instances.
We have many Cloud Service Providers such as AWS by Amazon, Google Cloud, Microsoft Cloud, etc.,
Take a look on this List of Cloud Services Providers.(You have links for all top 10 providers)

Categories

Resources