Play framework weblogic 10.3.3.0 deployment - deployment

I built a Play app and tried to deploy on weblogic using the following commands:
play war -o myApp myApp
Later I just deployed the exploded war directory to weblogic, everything worked fine but everytime I try to access a route. I get the following error:
Not found
GET /myApp/params
This is a rest service not an application with UI's. I tried to deploy on tomcat and everything worked fine but I had to make the application context root to be /. I tried the same thing with weblogic but it did not work.
Here is my route file:
GET / Application.index
GET /sectorinformer/{telephone} Application.show
GET /sectorinformer/public/ staticDir:public
* /{controller}/{action} {controller}.{action}
And here is my controller code:
package controllers;
import models.InstalAddress;
import models.SectorInfo;
import play.Logger;
import play.mvc.Controller;
public class Application extends Controller {
public static void index() {
render();
}
public static void show(String telephone) {
Logger.debug("Starting request");
Logger.debug("domain: '%s'", request.domain);
String instalAddressId = InstalAddress.getInstalAddressId(telephone);
SectorInfo si = new SectorInfo();
si.initializeSectorInfo(instalAddressId);
renderXml(si.generateXmlResponse());
}
}
Thanks in advance for any help.

Weblogic 10 is a fully compliant J2EE 5 application server, as a consequence it is bundled with JPA 1.0.
There are two little issues to get Play running on weblogic.
Applying an Oracle patch to have weblogic support JPA 2.0
Adding a deployment descriptor property to prioritize class resolution from web-inf
Both are trivial and the Play documentation should probably mark weblogic 10 as a working deployment target.
To fix #1, open to following oracle link.
For the lazy readers, add this declaration at the top of wlserver/common/bin/commEnv.sh
export PRE_CLASSPATH=$MW_HOME/modules/javax.persistence_1.0.0.0_2-0-0.jar:$MW_HOME/modules/com.oracle.jpa2support_1.0.0.0_2-0.jar
for windows, the file is wlserver/common/bin/commEnv.bat
set PRE_CLASSPATH=%MW_HOME%/modules/javax.persistence_1.0.0.0_2-0-0.jar;%MW_HOME%/modules/com.oracle.jpa2support_1.0.0.0_2-0.jar
To fix #2, create the file weblogic.xml at the following location myplayapp/war/WEB-INF/weblogic.xml
<?xml version="1.0" encoding="UTF-8"?>
<weblogic-web-app>
<container-descriptor>
<prefer-web-inf-classes>true</prefer-web-inf-classes>
</container-descriptor>
</weblogic-web-app>
The war folder is automatically picked up by play war when the web archive is built.
That's it!
I personally believe Play should create weblogic.xml itself, but that's not how it works as of 1.2.1

Unfortunately I don't have either weblogic know nor time to investigate in you interesting problem. I can only can give you some hints what I would do:
Try to connect the app with a debugger or if this doesn't work checkout the Code and build your own version, with a lot of log-statements.
As far as I know every request will handled by ActionInvoker. invoke. Look how the argument comes in. The other point is the Router, which has still a lot of trace-logs. So perhaps you start first and let the whole stuff run on trace-level. Perhaps that give you some hint's where to look in more detail.
To do this start with a clean app and make no configuration tricks, specially don't run it in ROOT-Context. Just create play war myapp -o myapp.war --zip and deploy it (Don't forget --zip). Then analyze the log.
Good look.
Niels

I deployed my Play app (play 1.1.1) to Websphere 6.1 and I encountered some issues. Not sure you have the same issues but here there are (hope it can help you):
1- JDK version: My "play war xxxx --zip" use a JDK 1.6, and Websphere 6.1 uses a JDK 1.5. When I tried to launch my webapp an UnsupportedClassVersionException was thrown. I regenerated my war file using the correct JDK et voilĂ  !
2- When you deploy a war aplication to Websphere, you can specify the context's name. I don't know how to do it with Weblogic, but did you set the correct value ?
As Niels said, analyze logs files: you should find what happens !

Unfortunately, Play! doesn't support Weblogic.
See: http://www.playframework.org/documentation/1.2/deployment

Related

Missing NamedQueries annotation in WAS Liberty environment

I'm using WAS Liberty 8.5.5.5 under Java 7 (tried under Oracle java 7-8 and IBM java 7 as well).
When I create one NamedQuery, the code compiles, deployes, and runs fine.
However, If I try to use the NamedQueries annotation I get the following excpetion:
java.lang.ArrayStoreException: com.sun.proxy.$Proxy29
at sun.reflect.annotation.AnnotationParser.parseAnnotationArray(AnnotationParser.java:765)
at sun.reflect.annotation.AnnotationParser.parseArray(AnnotationParser.java:537)
at sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:355)
at sun.reflect.annotation.AnnotationParser.parseAnnotation2(AnnotationParser.java:286)
at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:120)
at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:72)
at java.lang.Class.createAnnotationData(Class.java:3521)
at java.lang.Class.annotationData(Class.java:3510)
at java.lang.Class.getAnnotation(Class.java:3415)
After some investigation, I found the following two bugs:
ArrayStoreException in Jboss: https://issues.jboss.org/browse/JBAS-9392
ArrayStoreException when annotation declaring class missing: http://bugs.java.com/view_bug.do?bug_id=7183985
It seems that the javax.persistence.NamedQueries inteface is missing in the enviroment (stangely the javax.persinstence.NameQuery is present ...)
I use Eclipse Kepler for development, the deployment is also handled by the IDE.
On more thing; other developers using the same code base can successfully deploy and run the application with the afformentioned settings - so I suspect the deployment might be responsible for this issue.
Is there a way to "tell" the WAS to include the missing class runtime?
It took some time, but I found the solution.
We are using Ecliselink as a JPA provider, and load it accordingly:
<classloader commonLibraryRef="EclipseLinkLib" delegation="parentLast"/>
It seems that Eclipselink (version 2.5.2) contains the javax.persistence.NamedQuery interface, but not the javax.persistence.NamedQueries interface - this way WAS does not load the missing interface.
By changing delegation="parentFirst" the app works fine.

WildFly 8.2, after every change in html file I need to perform full publish to see the changes, why?

After every change in HTML(XHTML) page of a web project, either it is JSF or a simple WAR I need to perform a Full Publish to see the changes. After some googling I found the solution to change in Management Console - Publishing settings to Automatically publishing when resources change and set publishing interval to 0, but it doesns't help. What can I do more to resolve this issue?
I'm using WildFly 8.2 on Mac Maverick.
Thank you in advance.
you can deploy exploded war file instead of war archive. Only make sure that folder name has .war in its name e.g myApp.war.
After that you can configure wildfly deployment-scanner to auto deploy exploded content. This can be done in your config file e.g. standalone.xml.
See https://docs.jboss.org/author/display/WFLY8/Deployment+Scanner+configuration
Config example:
<deployment-scanner scan-interval="5000" relative-to="jboss.server.base.dir" path="deployments" auto-deploy-zipped="true" auto-deploy-exploded="true"/>
Had the same problem. In standalone.xml i added the attribute
auto-deploy-exploded="true"
and the problem started. After removing the attribute it returned to the same behaviour as before.
There was a bug in JBoss 7 which was about processing this attribute not properly (or at all) but its status is resolved and it should work now. Obviously it doesn't or i am doing something wrong.
After setting auto-deploy-exploded="true" I was't able to deploy application. Deployment copies stuff in "deployment" and then scanner triggers and starts another deployment of the same app witch results in error

How to deploy EJB application as an Exe file

I'm sorry if this question annoys you. I've written an EJB-based application and now I want to deploy it as a single Exe file (not a War file). That means if that Exe file's executed, all related things such as the web server, the database server, ... will be automatically installed to enable my application run smoothly. The JIRA installer's a typical example (http://www.atlassian.com/try).
I've googled a lot but I can't find the right answer. Would you please tell me how I can achieve that?
Glassfish has a embedded Java ee container: http://embedded-glassfish.java.net That will allow you to embedd a Webserver and database into your app (infact a complete Java EE container).
The next step would be to embedd a a java-runtime and bundle it with above as an exe. I havnt tried that. But start with the above step and see if it is enough, then start by reading about this: Embed a JRE in a Windows executable?

Gwt Tomcat Deploy : Just Does Nothing

if I deploy my project to the Tomcat server which uses just client side code , it works perfectly.
But if my project has a server side code , for example, a button which uses RPC , when i clicked the button, project does nothing at all. No Warnings, no errors etc. Just does nothing at all.
And also, when I deploy "the default GWT example ( greetings project )" to the Tomcat server, it doesn't work.
( I mean my problem is not related with my project's code )
p.s. : My project works perfectly in the Dev Mode.
Could you help me please?
Let us say, wWhen you run on dev mode, your URL was
localhost:port#/page1.
And that the war file name is happy.
Therefore, when you deploy to Tomcat, the server no longer serves it as localhost:port#/page1.
Your app would now be served as
localhost:port#/happy/page1
In your rpc remote service interface file you would have specified the relative path as "/page1".
However, you have to check your web.xml and make sure the servlets are specified in relative paths as well. Check your web.xml to ensure the servlet paths are not hard-coded to
localhost:port#/page1.

need to know steps to do hot deployment in Tomcat 6.X

I want to deploy the files (class files) without stopping the tomcat services. problem for me is as follows
I have one project with different domain names. which are running in one tomcat server. but if I deploy a class i need to stop tomcat each time this will effect for other domains.
So please suggest a solution to this problem.
Hi Romani,
Thanks for your reply
I'm using Tomcat manager to Stop the multiple application
I need,
1) Example "myapp" is application in tomcat
C:\tomcat6.0\webapps\myapp\
2) I'm now deploying class files in "myapp" but not stopping "myapp" tomcat service
C:\tomcat6.0\webapps\myapp\WEB-INF\classes\**test.clas**s
3) Now "test.class" file has replaced in myapp
4) I'm opening http://localhost:8080/myapp
5) I need the changes of test.class file with no downtime of myapp application
Is there any possibilities that deploying class files "without stop" "myapp" "Tomcat service" in the Tomcat manager to reflect class file
No down time with the application
I don't know if you found the solution but I had the same issue and maybe this will help others. This is only recommended for development environments.
If you edit your context.xml file (for me that is located in [tomcat-root]/conf and add an attribute to the Context element: reloadable="true" like this:
<Context reloadable="true">
Then restart the server. You now have hot deployment on classes and libs as described here (without the need for manually restarting the application)
http://tomcat.apache.org/tomcat-6.0-doc/config/context.html#Common_Attributes
Hope this helps you or someone else.
Try out following solution. this way you will stop and start only your application.
Do u have access to 'Tomcat web application manager'?
1) Go to http://localhost:8080
2) click on Tomcat manager
3) Then stop your deployed application
4) Then replace the class file/s in tomcat deployment directory
for e.g. C:\tomcat6.0\webapps\yourapp\WEB-INF\classes\....
5) Then again come back to tomcat manager and start your application.