Glassfish deploy command with createtables error - jdbc

I have an application packaged as .war file. I want to deploy this web application to Glassfish v4.0 server using this command:
./asadmin deploy --force=true --createtables --contextroot test /tmp/test.war
Deployment without --createtables parameter works fine, however I want the tables to be generated/updated during the deployment. On my local server where I have only one JDBC resource defined in glassfish it works fine. But on the test server there are more JDBC resources defined with limited privilegies and one JDBC resource that I want to use just for this task. How do I tell glassfish to use this particular JDBC resource when creating and updating tables?
Thank you

You need to provide {true|false} to the --createtables option:
./asadmin deploy --force=true --createtables=true --contextroot test /tmp/test.war

Related

I am not able access api's deployed in hostgator

I am trying to deploy a spring boot application in hostgator javahosting with vps. I have generated jar file locally and deployed in server with "java -jar file.jar" application started successfully with no errors but not able to access using ip of the server. I want to execute only jar file and i have not installed maven.Any dependicies i am missing?permissions?
Changed the server port to 8080 and it is up and running and able to access.

Tomcat Remote Deployment

I want to deploy a WAR from my local windows box to a remote tomcat machine
I am using the following command from Postman
http://10.248.9.104:8080/manager/text/deploy?path=/greeting1&war=file:///C:/Users/jagaran.das/Documents/work/AIP/Automation/workspace/gs-rest-service-master/initial/target/gs-rest-service-0.1.0.war
Also I have tried lot of options.
My main requirement is to control deployment to 100 tomcat server from a central location. I was thinking of using tomcat manager remote deployment way but I am not able to do. Please help
Tomcat Version is Tomcat 7.0.78

Intellij, Spring dev tools remote, Docker, error Unexpected 404 response uploading class files

Im trying to use Spring Boot Dev tools (Spring Remote), and automatically upload recompiled files to my docker container.
I keep receiving
Unexpected 404 response uploading class files
This is my docker file:
FROM java:8
WORKDIR /first
ADD ./build/libs/first.jar /first/first.jar
EXPOSE 8080
RUN bash -c 'touch /first/first.jar'
ENTRYPOINT ["java","-Dspring.data.mongodb.uri=mongodb://mongodb/micros", "-Djava.security.egd", "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005","-jar", "first.jar"]
This is my configuration and the configuration
And this is the error I'm receiving:
As of Spring Boot 1.5.0, devtools defaults were changed to exclude the devtools from fat jars.
If you want to include them, you have to set the excludeDevtools flag to false.
However, the devtools documentation doesn't explain how to do this. The necessary documentation is actually in the spring-boot-gradle-plugin documentation.
To do it, you can put this snippet of code in your build.gradle file:
bootRepackage {
excludeDevtools = false
}
Unfortunately, this was buggy at first and had no effect as of Spring Boot 1.5.0. The workaround was to do this instead:
springBoot {
excludeDevtools = false
}
However, I have verified that the bootRepackage approach works for Spring Boot 1.5.8 .
I got the same issues as yours while using docker-compose to compose my application ( a web service + redis server + mongo server ).
As the Spring developer tools document point out "Developer tools are automatically disabled when running a fully packaged application. If your application is launched using java -jar or if it’s started using a special classloader, then it is considered a “production application”."
I think when we running Spring Web Application inside Docker container, the developer tool is disabled then we cant remotely restart it.
Currently, I'm running my web application on the host machine and set the redis server, mongo server inside containers so I can restart the web app quickly when the code is changing in development process.
In my case I had to put the application context on the argument of the IDE RemoteSpringApplication configuration.
For example, my application root context was /virtue so I had to configure it like so:

Unable to deploy from Jenkins to Jboss

We are unable to deploy our application from our BuildServer to our appliation server.
This is the maven command we use in Jenkins:
clean install jboss-as:deploy -Pjboss7 -Dmaven.test.skip=true
We have tried the following:
Confirmed we can telnet from our BuildServer to our appliation server
Upgrade Jboss maven plugin
Started Jboss (on our application server) with
$JBOSS_HOME/bin/standalone.sh -b 0.0.0.0
Jenkins seems to hang at the following point:
INFO: JBoss Remoting version 3.2.12.GA
Authenticating against security realm: ManagementRealm
Is the JBoss AS 7 working on the same machine as Jenkins?
Currently your binding your public interface to all network interfaces on the host machine (the -b command). You should also bind your management interface of the app server to a proper network interface (Jboss allows remote deployment only by the management interface). You can do it in the $JBOSS_HOME/standalone/configuration/standalone.xml (or domain.xml for domain mode) file. Find:
and set the inet-address to the ip of the machine which hosts the application server. You can also use the -bmanagement switch to bind the management interface, as such:
$JBOSS_HOME/bin/standalone.sh -bmanagement=192.168.100.10
You also stated, that you have a potential problem with authentication. Please post your maven plugin configuration. Note that the username and password you provide for the maven plugin should match the administrator user on JBoss (you can add him by choosing Management User in the $JBOSS_HOME/bin/add-user.sh promp). This is the most likely source of your problem - but it is hard to tell without any further information (for example something from the pom.xml file).
Also if the app server is working on the same machine as Jenkins, JBoss allows the "local user authentication" which basicaly checks if the call has originated from the same machine.
Additional source for network interface binding: https://docs.jboss.org/author/display/AS71/Command+line+parameters#Commandlineparameters-bindaddress

AWS EC2 : Connecting to PostgreSQL from tomcat 7

I have installed tomcat7 and postgreSQL9 on AWS- Ec2 Micro ,
I am able to connect to the EC2 postgreSQL instance form a spring application running on my local tomcat 7 server.
When I deploy the same war file on the EC2- tomcat7 server, it is throwing the following error..
Cannot create JDBC driver of class '' for connect URL 'jdbc:postgresql://ec2-user#x-x-x-x-x.us-x-x.compute.amazonaws.com/test'
java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getDriver(DriverManager.java:279)
I have copied postgresql-9.1-901.jdbc3.jar to /usr/share/tomcat7/lib
I have tried using the AWS internal IP ... No luck..
I don't know what I am doing wrong. The same war with same configuration works from local tomcat7. Am I missing any thing with AWS tomcat7 configuration?
Hi it seems you haven't included the postgresql jdbc jar. Try including that it should work.

Resources