I successfully deployed generated jhipster.war.original to weblogic 12c without any exception.
Front-end seems to be running however any REST request ends with 404-not found... Any ideas what could be a problem?
For successful deployment I had to remove all tomcat and websocket(anyway not chosen in jhipster config) dependencies from generated war.
Is this an issue or info? Anyways we do not officially support web logic and seems like you fixed it anyways so closing
@mzatko You could consider writing a tip in the jhipster documentation project
Sorry for not being clear enough. My problem is that REST "backend" is not working at all... All REST requests end up with "404 not found"
I suppose you have a context path while in jhipster embedding tomcat we haven't one.
Hi @gmarziou, thank you for your answer. That was my first idea, however everything looks correct. When there is context-path for webapp, there is context-path for REST as well. Requests from angular are sent to correct endpoints. However I checked if there are endpoints without context-path and there are none. It seems like with weblogic REST services simply aren't configured. I tried with wildfly8.2 and it worked fine...
Could you try with Spring Boot REST service example?
JHipster should be very close to this example but it should be simpler to debug.
Hi @gmarziou, finally I found solution, maybe it could help someone:
implements WebApplicationInitializer to class ApplicationWebXml definition as weblogic searches only direct implementations. It will be then:public class ApplicationWebXml extends SpringBootServletInitializer implements WebApplicationInitializer {
...
}
<properties>
...
<javassist.version>3.20.0-GA</javassist.version>
...
</properties>
...
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<packagingExcludes>WEB-INF/lib/tomcat-*.jar,WEB-INF/lib/jetty-*.jar,WEB-INF/lib/javax-websocket*.jar,WEB-INF/lib/websocket*.jar</packagingExcludes>
</configuration>
</plugin>
...
<?xml version="1.0" encoding="UTF-8"?>
<wls:weblogic-web-app
xmlns:wls="http://xmlns.oracle.com/weblogic/weblogic-web-app"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd
http://xmlns.oracle.com/weblogic/weblogic-web-app
http://xmlns.oracle.com/weblogic/weblogic-web-app/1.4/weblogic-web-app.xsd">
<wls:container-descriptor>
<wls:prefer-application-packages>
<wls:package-name>org.slf4j.*</wls:package-name>
<wls:package-name>javassist.*</wls:package-name>
<wls:package-name>org.joda.time.*</wls:package-name>
<wls:package-name>javax.persistence.*</wls:package-name>
<wls:package-name>com.google.common.*</wls:package-name>
</wls:prefer-application-packages>
</wls:container-descriptor>
</wls:weblogic-web-app>
Thanks for having written this solution.
Another important issue affects oauth2 authentication config:
you need to add
<security-configuration>
...
<enforce-valid-basic-auth-credentials>false</enforce-valid-basic-auth-credentials>
</security-configuration>
in domains/<<mydomainname>>/config/config.xml of weblogic server otherwise WL will try to manage Basic HTTP Authentication itself what causes you are not able to login.
@mzatko
I also deployment jhipster on weblogic 12c.
I get this error:
java.lang.IllegalAccessError: tried to access method com.fasterxml.jackson.databind.ser.std.StdSerializer.
Do you see this error in progess your deploy?
@tvd27285 you just should add this line to your weblogic.xml
<wls:package-name>com.fasterxml.jackson.*</wls:package-name>
@siwarbns i added <wls:package-name>com.fasterxml.jackson.*</wls:package-name> to my weblogic.xml but still get error when deploy to weblogic 12c:
java.lang.IllegalAccessError: tried to access method com.fasterxml.jackson.databind.ser.std.StdSerializer.<init>(Ljava/lang/Class;)V from class com.fasterxml.jackson.datatype.jsr310.JavaTimeModule
tried to access method com.fasterxml.jackson.databind.ser.std.StdSerializer.<init>(Ljava/lang/Class;)V from class com.fasterxml.jackson.datatype.jsr310.JavaTimeModule
Hi @gmarziou, finally I found solution, maybe it could help someone:
- Most important is to add
implements WebApplicationInitializerto class ApplicationWebXml definition as weblogic searches only direct implementations. It will be then:public class ApplicationWebXml extends SpringBootServletInitializer implements WebApplicationInitializer { ... }
- changes to pom.xml: as I am using java8, I had to upgrade javassist by adding javassist.version property; to exclude websocket and jetty jars from war I had to change maven-war-plugin configuration
<properties> ... <javassist.version>3.20.0-GA</javassist.version> ... </properties> ... <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <configuration> <packagingExcludes>WEB-INF/lib/tomcat-*.jar,WEB-INF/lib/jetty-*.jar,WEB-INF/lib/javax-websocket*.jar,WEB-INF/lib/websocket*.jar</packagingExcludes> </configuration> </plugin> ...
- to prefer some application packages over weblogic's defaults create src/main/webapp/WEB-INF/weblogic.xml file
<?xml version="1.0" encoding="UTF-8"?> <wls:weblogic-web-app xmlns:wls="http://xmlns.oracle.com/weblogic/weblogic-web-app" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd http://xmlns.oracle.com/weblogic/weblogic-web-app http://xmlns.oracle.com/weblogic/weblogic-web-app/1.4/weblogic-web-app.xsd"> <wls:container-descriptor> <wls:prefer-application-packages> <wls:package-name>org.slf4j.*</wls:package-name> <wls:package-name>javassist.*</wls:package-name> <wls:package-name>org.joda.time.*</wls:package-name> <wls:package-name>javax.persistence.*</wls:package-name> <wls:package-name>com.google.common.*</wls:package-name> </wls:prefer-application-packages> </wls:container-descriptor> </wls:weblogic-web-app>
- now is appname.war.original file deployable and it is running in weblogic12c
Thank you for sharing. It survived me!
Most helpful comment
Hi @gmarziou, finally I found solution, maybe it could help someone:
implements WebApplicationInitializerto class ApplicationWebXml definition as weblogic searches only direct implementations. It will be then: