Netbeans 8.2 : GlassFish 5 Server, deploy, null false - The module has not been deployed - netbeans-8

I'm a new Java WebEnt student, and I'm having issues deploying some basic Entity Classes and JSF Pages.
I loaded up some things without any edit to the files, and when trying to deploy. I get the "\nbproject\build-imp.xml:1045 The module has not been deployed" message. I checked the GlassFish server and here is the beginning log:
java.io.IOException: org.xml.sax.SAXParseException; lineNumber: 10;
columnNumber: 18; Deployment descriptor file META-INF/persistence.xml in
archive [classes]. cvc-complex-type.2.4.d: Invalid content was found
starting with element 'properties'. No child element is expected at this point.
The rest of the log is pasted below
https://pastebin.com/7rXsyRit
EDIT
Pastebin to include the XML files in WEB-INF and persistence.xml
https://pastebin.com/6kRJyA54
Thanks for the help/advice

Yes the issue was <properties/> after I had removed that and tried to deploy, I had gotten that error which following the instructions in this link had resolved.

Related

Taglib cannot be resolved using Intellij Idea and Tomcat

I am using Intellij Idea 2016.2.2 and Tomcat Server 8.0.27. I include taglib in jsp file at top as following:
<%#taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
When I depolyed in Tomcat and ran the code following error is generated.
HTTP Status 500 - The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application
type Exception report
message The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application
description The server encountered an internal error that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:55)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:277)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:75)
org.apache.jasper.compiler.TagLibraryInfoImpl.generateTldResourcePath(TagLibraryInfoImpl.java:243)
org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:124)
org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:416)
org.apache.jasper.compiler.Parser.parseDirective(Parser.java:474)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1430)
org.apache.jasper.compiler.Parser.parse(Parser.java:139)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:227)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:100)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:199)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:356)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:336)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:323)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:585)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:363)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
com.himal.jdbcservlet.controller.CourseController.doPost(CourseController.java:46)
javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52
Then, I have read I have read
https://www.jetbrains.com/help/idea/2016.2/configuring-module-dependencies-and-libraries.html
1) I added by following steps. ProjectStructure->Libraries->'+'From Java->JSTL jar location. After this that jar appears under external Libraries. But it doesn't work.
2) Then I found this link in stack overflow https://stackoverflow.com/a/32444393/6189499
I followed same procedure but doesn't work.
How can I resolve this issue?
Create a lib directorory under web/WEB-inf.
Download jstl 1.2 jar from
https://mvnrepository.com/artifact/jstl/jstl/1.2
Go to Intellij -> Project Structure -> Artifacts -> Add lib directory contents.
Rebuild Project and restart Tomcat.
Add:
javax.servlet.jsp.jstl-1.2.1.jar and
javax.servlet.jsp.jstl.jar
restart Tomcat and redeploy the project.

Where do i put JSTL taglibs after downloading them

kept getting this error when i run my web application :
HTTP Status 500 - The absolute uri: http://java.sun.com/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application
type Exception report
message The absolute uri: http://java.sun.com/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application
description The server encountered an internal error that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:56)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:445)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:117)
org.apache.jasper.compiler.TagLibraryInfoImpl.generateTLDLocation(TagLibraryInfoImpl.java:311)
org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:152)
org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:410)
org.apache.jasper.compiler.Parser.parseDirective(Parser.java:475)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1427)
org.apache.jasper.compiler.Parser.parse(Parser.java:138)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:242)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:102)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:198)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:373)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:353)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:340)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:646)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
myPackage.Register.processRequest(Register.java:63)
myPackage.Register.doGet(Register.java:81)
javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
note The full stack trace of the root cause is available in the Apache Tomcat/7.0.42 logs.
Apache Tomcat/7.0.42
and when i did some search i found that i need to download JSTL taglibs, i downloaded it but i don't know what to do with the files now, is there a specific folder i should put them so that my code runs fine?
From eclipse:
1.
Right Click --> properties --> Java Build Path --> Libraries -- > Add external jars
this will add jar to your eclipse biuld path
Right Click --> Deployment Assembly--> Java Build Path entries --> add JSTL jar
this will add the jar to WAR file when deploying it to the server.

Error in transporting an application from development worklight to Worklight Server Consumer Edition

I am using IBM Worklight environment. I have created a small application "SampleHybridProject" using Worklight Developer studio and tested it successfully.
Now when I am trying to deploy it on the Worklight Server Consumer Edition, and hitting the following URL: http://mymachine.com:9080/SampleHybridProject/console
I am getting this error in my browser:
Error 404: com.ibm.ws.webcontainer.servlet.exception.NoTargetForURIException: No target servlet configured for uri: /SampleHybridProject/console
I am using Worklight Edition 5.0.6. The Worklight Server is default "WAS with Liberty profile".
Here are the properties that I changed in worklight.properties file.
publicWorkLightHostname=localhost
publicWorkLightProtocol=http
publicWorkLightPort=9080
publicWorkLightContext=/SampleHybridProject
wl.db.type=MYSQL
wl.db.url=jdbc:mysql://mysqlinstalledonmypc:3306/WRKLGHT
wl.db.username=root
wl.db.password=admin
Here are the changes that I made in application-descriptor.xml:
<worklightServerRootURL>http://${local.IPAddress}:9080/SampleHybridProject</worklightServerRootURL>
Can you tell me what I am doing wrong or what I need to do?
I have found the problem and solved it. The problem is I was having this error in console.log file:
Error creating bean with name 'txManager' defined in URL [jar:file:/C:/ProgramData/IBM/Worklight/WAS85liberty-server/wlp/usr/shared/resou‌​rces/lib/worklight-jee-library.jar!/conf/core.xml]: Invocation of init method failed; nested exception is java.lang.LinkageError: loader constraint violation: loader (instance of com/ibm/ws/classloading/internal/UnifiedClassLoader) previously initiated loading for a different type with name "javax/sql/DataSource"
This was because I had a jar in the server/lib folder of my project which was causing this problem. I removed the jar from server/lib folder and redeployed the .war file. Now the console is getting loaded.
Are you getting any deployment errors in your liberty logs? A 404 on the context root generally means either the WAR was not found, or the context root defaults to something other than 'SampleHybridProject'. If the WAR appears to be loading correctly, it will output where it is listening on similar to:
[AUDIT ] CWWKT0016I: Web application available (default_host): http://[hostname]:port/SampleHybridProject/*
If it says the context root is anything other than SampleHybridProject, you can set it in the tag in liberty's server.xml:
<application id="SampleHybridProject" name="SampleHybridProject"
location="SampleHybridProject.war" type="war"
context-root="SampleHybridProject">
...
</application>

Drools Guvnor on Glassfish error

I'm trying to deploy Guvnor (guvnor-5.5.0.Final-tomcat-6.0) to a fresh
glassfish server ( 3.1.2.2 build 5) and am getting the error below.
I did try the other WARs without any luck and I get the same error on
OSX and windows.
Error occurred during deployment: Exception while loading the app :
java.lang.IllegalStateException: ContainerBase.addChild: start:
org.apache.catalina.LifecycleException:
java.lang.NoClassDefFoundError: org/apache/AnnotationProcessor. Please
see server.log for more details
Are there any work-around for this ?
Add the jasper-xxx.jar to your lib. It should work. If you deploy in tomcat, it should be in catalina.jar.
Unfortunately JBOSS 7 doesn't use tomcat instead it uses JBossWeb. That's why you have this problem.
Take the guvnor-5.5.0.Final-jboss-as-7.0.war binary war file
add dom4j-1.6.1.jar
remove javassit*.jars
add resteasy-jaxb-provider-2.2.3.GA.jar
add resteasy-jaxrs-2.2.3.GA.jar
Add the a glassfish-web.xml file to WEB-INF https://github.com/snowch/glassfish-guvnor/blob/master/src/main/webapp/WEB-INF/glassfish-web.xml
Replace WEB-INF/web.xml with this https://github.com/snowch/glassfish-guvnor/blob/master/src/main/webapp/WEB-INF/web.xml
Repackage the binary war file and deploy to glassfish

Failed Glassfish deploy - "Referencing error: this bundle has no bean of name [ClientBean]"

I'm trying to run the example from this page : GlassFish-to-GlassFish Remote EJB Invocation
But I get this error when I try to deploy the client on glassfish ("asadmin> deploy client-ejb.jar"):
"Exception while deploying the app [client-ejb] : Referencing error: This bundle has no bean of name [ClientBean]"
I need help, thanks.
I encountered a a similar problem when trying to deploy my application (Exception while deploying the app [my-app] : Referencing error : This bundle has no bean of name [myBeanFacade] ) .Rather weird but all that was needed to solve this was to go to the properties of [my-app] under the build category tree, choose compile and tick the compile on save option. Redeployed my application and viola !!
NB [my-app] contains 2 ejb jars and a web application, one of the ejbs is a library in the web app.
This problem occurred because the guy forgot to add the ServiceIF.class reference in client-ejb.jar.
Execute the command:
jar cvf client-ejb.jar test/ServiceIF.class test/ClientIF.class test/ClientBean.class META-INF/glassfish-ejb-jar.xml
get the new .jar and it will work.
In case you are using a deployment descriptor, then the EJB name should be the same in both the descriptor file.
<ejb-jar>
<enterprise-beans>
<session>
<ejb-name>Hello</ejb-name>
<home>com.ejb.test.HelloHome</home>
<remote>com.ejb.test.HelloObject</remote>
<ejb-class>com.ejb.test.HelloBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
</session>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
**<ejb-name>Hello</ejb-name>**
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>
<glassfish-ejb-jar>
<enterprise-beans>
<ejb>
**<ejb-name>Hello</ejb-name>**
<jndi-name>jndi/Hello</jndi-name>
</ejb>
</enterprise-beans>
</glassfish-ejb-jar>