java.lang.NoClassDefFoundError, java.lang.ClassNotFoundException

When you add a dependency reference to a Java project, it may compile without any errors, but runtime you may get an error message similar to this: HTTP Status 500 – Internal Server Error Type Exception Report Message An exception occurred processing JSP page [/index.jsp] at line [1] Description The server encountered an unexpected condition …

Java Spring MVC web application configuration in NetBeans 8

When you create a Java Spring MVC web application or make changes to an existing one, it is important to know the location of configuration values. Java package name The Java package name is stored in Every .java file package MY_PACKAGE_NAME pom.xml file <configuration> <mainClass>com.objectdb.Enhancer</mainClass> <arguments> <argument>MY_PACKAGE_NAME.MY_MAIN_CLASS_NAME</argument> </arguments> </configuration> .jsp file <%@page import=”MY_PACKAGE_NAME.*”%> <jsp:useBean id=”MY_BEAN_ID” type=”MY_PACKAGE_NAME.MY_DAO_CLASS_NAME” …

org.apache.jasper.JasperException: java.lang.IllegalStateException: No output folder

This error can happen on Linux and Windows, and the cause could be the same. On Windows Server 2012R2 I opened a command prompt. To be able to delete a directory from the Tomcat webapps folder, I have issued the shutdown command. When I started the server with the startup command, and navigated to my local …

Only persistence units with transaction type JTA can be used as a container managed entity manager

NetBeans can use multiple deployment servers. When your web application uses the Entity Framework and you select the Glassfish server as the deployment server, you can get the error message when you try to run your application in the IDEÉ Severe: Exception while preparing the app : The persistence-context-ref-name […] in module […] resolves to a …

Deploy a WAR file of a Java web application on the Apache Tomcat web server

There are two ways to deploy a WAR file of a Java web application on the Apache Tomcat web server Using the command line Copy the WAR file into the webapps folder of the Tomcat installation directory, Make sure the CATALINA_HOME environment variable points to the Tomcat directory (not the bin subdirectry) Open a Terminal window or …

Create a WAR file for a Java web application in NetBeans

Configure the web application Add the web.xml file The wb.xml file contains the web application configuration values for the webserver. I has to be in the WEB-INF directory of the web applicaion. To add the web.xml file to your NetBeans Java web application Right-click the Netbeans project, and select New -> Other… In the New File window select …

java.sql.SQLException: Incorrect string value: ‘\xF0\x9F\x96\xA4\xE2\x9C…’ for column

When your application tries to store 4-byte Unicode characters in a MySQL database you may get the error rmessage java.sql.SQLException: Incorrect string value: ‘\x..\x..\x..\x..\x..\x…’ for column   To store 4-byte Unicode characters in MySQL you need a modern version of the database engine, version 5.5 or later, set the column collation to COLLATE utf8mb4_unicode_ci in the database, …

Package dependent Java JAR files into the project JAR file

When you execute your Java JAR file, you need to include all dependent JAR files in the “fat jar” file, so the Java virtual machine can find them at runtime. Set up NetBeans to include the JAR files from the library In NetBeans you need to add the list of dependent libraries to the build.xml file. On the …

Start a new Spring MVC Java Web application development in NetBeans

When you create your first Spring MVC Java web application in the base installation of NetBeans follow the steps below Create a project In the File menu select New Project… Select the Java Web category, select the Web Application project, and click Next, Enter the name of the project and click Next, If this is …