How to set Archive Version in WLST offline deploy? - weblogic

Is it somehow possible to set Archive Version in the WLST offline deployment?
My current deployment is:
# Create Application
# ==================
cd('/')
app = create(appname, 'AppDeployment')
app.setSourcePath(appdir + '/' + apppkg)
app.setPlanPath(appdir + '/deploymentplan.xml')
# Assign application to AdminServer
# =================================
assign('AppDeployment', appname, 'Target', 'AdminServer')
If the WAR file doesn't contain a version in the MANIFEST, then it works correctly... But when the WAR file is versioned in the MANIFEST, it crashes with:
[Deployer:149268]Static deployment of non-versioned application "<app name>" failed due to a version being defined in its manifest file.
Thanks in advance.

Related

How to change the War file for same project in a Bluemix

I am migrating my mobile first server to bluemix, but I am facing one issue:
Whenever I try to change my War file for same project,Every time i have to create the new container and upload the new image into that.
I am running the script:
initenv.properties
prepareserverdbs.properties
prepareserver.properties
startserver.properties
and In startserver.sh , I am getting the error that container with the same already exists if i am using the same container to change the War file.
Any advice on that how to update the war file for the same project?
The error you see is because the old container with the same name is still running. It needs to be recreated.
The project (.war file) on MobileFirst Platform 7.1 is an artifact that goes into the container. So recreating the image is required.
If there are changes to the project war file, you will have to replace the .war in the ./usr/projects directory (Or if you are using PROJECT_LOC variable in args/prepareserver.properties, make sure it points to the latest project directory) and then run the following:
Recreate the docker image with the new .war file: prepareserver.sh
Stop and then delete your running container: cf ic stop your-container-name and cf ic rm your-container-name. (Verify that old container is deleted using the command: cf ic ps -a)
Start a new MobileFirst container from the updated image: startserver.sh
Step 2 above should fix the error that you see.

How to deploy an web application in netbeans (prod / test)

I have create an web app in Netbeans.
My project contains this architecture:
WebApplication
--web pages
----meta-inf
----web-inf
----index.html
--Source Packages
-----test
-------TestEnv.java
--Librairies
----JDK 1.8
----Apache Tomcat 8.0.27.0
----Configuration files
-------Manifest.mf
-------context.xml
-------web-fragment.xml
-------web-fragment.xml
How can I test if I am in production or test.
If It's a production , I will call a prod.properties
If It's a test, I will call test.properties
I already lookup some post like environment variable in tomcat server.xml but It's not recognized :(
I don't want to use maven also.
I am looking a solution based on a read of xml file.
If in the xml file prod is equal to true so It's in production so I call prod.properties.
Have you got an idea of this xml file .(similar to ant ?)
Thanks

Openshift for Play: The remote end hung up unexpectedly

I am trying to launch a play project in openshift. The first phase which was nearly 15% of the project was successfully completed and uploaded. So, I guess the initial configuration was okay. Now, after I completed nearly the rest of the project, then when I am trying to push the project using ssh, everytime after a certain time the remote server hangs up with the following message.
remote: [info] Done packaging.
remote: model contains 69 documentable templates
Connection to blogofprime-thatsqt.rhcloud.com closed by remote host.
fatal: The remote end hung up unexpectedly
error: error in sideband demultiplexer
To ssh://5455ef32e0b8cd379e000293#blogofprime-thatsqt.rhcloud.com/~/git/blogofprime.git/
+ 557ec12...4034b71 HEAD -> master (forced update)
Every-time after a certain step remote server hangs up.
My openshift.conf file:
# This is the main configuration file for the application.
# ~~~~~
include "application"
# Secret key
# ~~~~~
# The secret key is used to secure cryptographics functions.
# If you deploy your application to several instances be sure to use the same key!
application.secret="V0sLX<RAciXw_>7^O8y=I4BRW/M4#vhVhF=H44`lMfgAV2hs^Pp?tsfroKt1J3eX"
# The application languages
# ~~~~~
application.langs="en"
# Database configuration
# ~~~~~
# You can declare as many datasources as you want.
# By convention, the default datasource is named `default`
#
db.default.driver=com.mysql.jdbc.Driver
db.default.url="jdbc:mysql://"${OPENSHIFT_MYSQL_DB_HOST}":"${OPENSHIFT_MYSQL_DB_PORT}"/"${OPENSHIFT_APP_NAME}
db.default.user=${OPENSHIFT_MYSQL_DB_USERNAME}
db.default.password=${OPENSHIFT_MYSQL_DB_PASSWORD}
# Evolutions
# ~~~~~
# You can disable evolutions if needed
# evolutionplugin=disabled
# Ebean configuration
# ~~~~~
# You can declare as many Ebean servers as you want.
# By convention, the default server is named `default`
#
ebean.default="models.*"
# Logger
# ~~~~~
# You can also configure logback (http://logback.qos.ch/), by providing a logger.xml file in the conf directory .
# Root logger:
logger.root=ERROR
# Logger used by the framework:
logger.play=INFO
# Logger provided to your application:
logger.application=DEBUG
My build.sbt file:
name := "thatsqt"
version := "1.0-SNAPSHOT"
scalaVersion := "2.11.2" // or "2.10.4"
libraryDependencies ++= Seq(
// Select Play modules
jdbc, // The JDBC connection pool and the play.api.db API
//anorm, // Scala RDBMS Library
javaJdbc, // Java database API
javaEbean, // Java Ebean plugin
javaJpa, // Java JPA plugin
filters, // A set of built-in filters
javaCore, // The core Java API
// WebJars pull in client-side web librarie
"org.webjars" %% "webjars-play" % "2.3.0",
"com.typesafe.play" %% "play-slick" % "0.8.0",
// Add your own project dependencies in the form:
// "group" % "artifact" % "version"
"mysql" % "mysql-connector-java" % "5.1.27"
)
fork in Test := false
lazy val root = (project in file(".")).enablePlugins(PlayJava)
EclipseKeys.withSource := true
Platform:
I am using Mac OS X and typesafe activator for play framework.
What I tried:
I tried to unset TMOUT in both server and client. At this point I am not very sure whether this is a timeout problem or something else.
My project Link: https://github.com/magurmach/PlayOpenshiftThatsQt
How can I solve this problem?
If the problem started occurring recently, it may be caused by exceeded quota.
It's very common to run out of space using 1GB small gears.
Try using rhc app-tidy rhc command:
rhc app-tidy <app>
Does your project include large binary files? This can cause git to take up a lot of RAM server-side, and a small Openshift gear will kill things that take too much RAM. The solution is to ssh into your Openshift box (using "rhc ssh" or equivalent) and tell the server-side git to limit its RAM use:
cd git/*.git
git config pack.windowMemory "25m"
git config pack.packSizeLimit "25m"
git config pack.threads "1"
and why they didn't do that by default I have no idea.
Also, next time you want to put large binary files into your project, you don't have to check them into the git repository (which will take up space tracking their entire history): you could just instruct your app to download them from another server as needed (the second server needs only the ability to host static files).

Unable to build Worklight project for "test" server (JDBC error)

Hello worklight team and devs!
We are done working on our development project and everything works fine in the local dev server (Tomcat).
Now we are trying to build the project to be deployed to a testing WAS ND 8.0.3 server.
We've been following the manual in the infocenter and modified each required file as needed (worklight.properties and application-descriptor.xml)
We made this changes to the worklight.properties file:
publicWorkLightHostname=working.hostname.com
# http or https
publicWorkLightProtocol=http
# For default port leave empty
publicWorkLightPort=ourport
publicWorkLightContext=/worklight
wl.db.jndi.name=jdbc/WorklightDS
wl.db.type=DB2
wl.db.url=jdbc:db2:Worklight
wl.db.username=wluser
wl.db.password=passwd
We tested the jdbc source in the WAS console and it works perfectly.
We proceed to build the war, adapter and wlapp (ALL) and we get this error:
[2013-05-21 12:48:44] FWLSE4001W: Failed to resolve JNDI name: "jdbc/WorklightDS".
Application may fail to access the database in runtime. If building for remote server - ignore this warning.
[2013-05-21 12:48:44] FWLST0011E: ====== Worklight Project BPMWorklight-project-customization failed to start: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
[2013-05-21 12:48:44] Activation failed. Bundle didn't start:C:pathto\BPMWorklight-customization.jar
This happens in the developer workstation and if we install Studio in the server, where the jdbc source is created, the same happens.
I guess that Worklight is trying to "obtain" a JDBC source in TOMCAT not WAS, but we are building for WAS, so the build fails and NO files are changed after the error. NO BUILD is executed.
We also tried to execute the build.xml with ANT in studio but we get this error:
Buildfile: C:\Users\Primary User\IBM\Worklight\LIS_SampleCollection\BPMWorklight\build.xml
BUILD FAILED
C:\Pathtofile\BPMWorklight\build.xml:3: Cannot find ../../common.xml imported from
C:\Pathtofile\BPMWorklight\build.xml
Total time: 62 milliseconds
You're help is greatly appreciated!
Thanks a lot!!
Best,
Nicolas E.
If all you require is to deploy the updated-for-WAS .war file in WebSphere, you don't need to do any build operation in Worklight. After updating any file under the server\ folder in Worklight Studio (the Eclipse plug-in), the .war file is automatically being re-created.
The build operation is mainly for creating the binaries and deploying to Worklight Server (database) (again, when using the Eclipse plug-in).
So what I suggest is to:
First update application-descriptor.xml with your context root value in worklightServerRootURL, and keep your .wlapps on the side
Update worklight.properties and save them.
Now you have your app ready to deploy and the .war file ready to deploy.
Move to WAS, deploy the .war file
Hopefully things will work now, so you can load Worklight Console and deploy the .wlapp and .adapter files.
I don't know what you've read in the IBM Information Center, but you can also try going over the following training module from IBM Worklight Getting Started.
Moving from development environment to stand-alone QA and production servers
Notes:
The above is not so convenient, but it is A way to move from your
development environment to another staging environment, or
application server...
The issue might also happen even after following my steps above, and this will indicate that the real issue is in your DB2 declaration in worklight.properties.
I will update this answer tomorrow with some insight regarding the possible DB2 declaration issue.

Maven deploy fails for Apache Archiva

I have a Maven project which generates a 413.06 KB jar file. I have to deploy it on Apache Archiva based managed repository. I have tried to deploy different versions, and it created required layout and structure, uploaded some files, even it uploaded that jar with 200~ KB. every time the jar file size changes but always it fails to upload 413.06 KB jar file.
Information:-
I am running standalone Archiva
I have given guest account to Global Repository Manager & "Repository Manager - MYREPO"
I have also tried a separate account in Archiva with "Repository Manager - MYREPO" rights and configured it in maven's settings.xml file to set custom timeout.
I am getting following error
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy
(default-deploy) on project SharedshelfRepository: Error deploying artifact: Transfer error:
The server did not respond within the configured timeout. -> [Help 1]
that might be maven-deploy-plugin issue, resources plugin itself needs several dependencies,try manually jar nad p
What version of Maven are you using? You might try 3.0.4 as it has a different HTTP library. I'm also not sure if there's more context for what was happening when it timed out (it seems more request oriented rather than deploy oriented, and deploy does request some metadata).
I can't see that you'd need to alter the timeout, as none of the defaults should apply to such a small file. How long does it take to fail?