WildFly deploy fails - java

I have been trying to work with WildFly, however I'm facing some odd issues, for example I can deploy from a *.war withouth any problem with connection to the database, but an unmanaged deployment is a headache, never starts, same when trying to do this throught Eclipse.
I'm doing a normal deploy for debugg using Eclipse, but anytime I'm getting this message:
WFLYEE0027: Could not load oracle.jdbc.driver.OracleDriver referenced in env-entry.
I have all the runtime configuration in Eclipse and also I did all the module configuration inside WildFly for standalone. I have added the *.jar to the proyect manually.
This is a maven project, any idea of how to solve this?

Okay, for this time I could solve the problem by adding the *.jar files this way:
So now WildFly can load the libraries from the lib folder

Related

Java ClassNotFoundException under Tomcat in Eclipse

I have been all over existing posts that deal with the ClassNotFoundException running a Java web app under Tomcat in Eclipse.
I am unable to provide source code and configuration artifacts because I am working on a proprietary code base. However, through trial and error I have boiled the problem down to its basic elements.
I have project packaged by Maven as a WAR. There are a number of other projects in the workspace on which the primary package depends. This arrangement has been working fine: I can deploy the WAR and the JARs it depends on under a Tomcat instance in Eclipse and the application runs and I can debug it.
Now I have created a new project that for the moment contains a single public class with a public constructor. The maven build works fine and the Eclipse compile workspace works fine. However, when I deploy to Tomcat and exercise an execution path that instantiates the class in the new project, I get a ClassNotFoundException.
I have checked the following items:
The Web Deployment Assembly for the primary package's project specifies WEB-INF/lib/ as the Deploy Path for the new project;
The JAR for the new project does in fact end up in the WEB-INF/lib/ folder under the actual deployment folder;
When I do a clean and publish on the server, the contents of the actual deployment folder do in fact get nuked and get repopulated with all the right JARs;
The new project's JAR as I find it the WEB-INF/lib in the deployment folder does in fact contain the class I am trying to instantiate;
The Tomcat log (which includes the startup cycle) contains no errors other than than the ClassNotFoundException;
I have re-done the Maven build and applied Maven build to the Eclipse projects numerous times;
I have cleaned and rebuilt in Eclipse numerous times;
I have cleaned and republished to the web server in Eclipse countless times;
I have created several new server instances.
Based on existing discussions of the ClassNotFoundException-in-Tomcat problem, these are the only things I have found to check. What else should I be looking into?
Thanks for your help.
Even for me the same problem has occurred .... I have clean the Tomcat and the Tomcat work directory and run the project again it worked fine...
This may happen because of the cache, sometimes which is not cleaned properly while building the application.
sometimes deleting the project from the eclise and importing it again doing it from scratch will also clear the problem
I'm not sure what exactly was wrong. However, I ended up resolving this issue by removing the project from the workspace, re-creating it from scratch, and importing my class into the re-created project.

Glassfish and Java EE external JAR

I am trying to use postgres on a EJB in a EAR, but i keep getting the error:
java.lang.ClassNotFoundException: org.postgresql.driver
so my app is not finding the jar. According to what I saw here: How to use 3rd party libraries in glassfish?, I should put the jar on either glassfish3/glassfish/domains/domain1/lib/ext or glassfishv3/glassfish/domains/domain1/lib, I tried both and is not working.
I was also not sure of something, should I add the jar to that folder and then reference the build path (using netbeans) of my app to the jar on that folder? or should I omit this step?
Anyhow, I tried both, referencing it and not doing it (only adding the jar to the folder in glassfish) and is not working.
So, how can I add an external jar to my application (EAR) that is put on a glassfish cluster?

Deploy web application on Tomcat

I created a simple web application in eclipse which connect to sql server. I downloaded the sql driver and added it to build path like this:
Build Path->Configure Build Path->Add External JARs.
When I run my application on Tomcat I get exception: ClassNotFoundException. I think that I know what it reason is (the folder WEB-INF->lib of my application is empty). When I put jar file of driver in WEB-INF->lib - everything is good. How I can add jar file(sql driver) to folder WEB-INF->lib of my application using eclipse?
Putting the JDBC driver JAR in [Tomcat-install-root]/lib will solve your problem, and you can do that outside of Eclipse.

java.lang.ClassNotFoundException - org.openrdf.repository.config.RepositoryConfigException in JSF

I am trying to run a JSF application on Tomcat 6 which is only for connecting to the Sesame repository. I added all the external Jar files needed for Sesame and the the project is created as Dynamic Web Project for JSF. I also configured everything for JSF by following some tutorials. In Eclipse, I export the WAR file to deploy it on Tomcat 6 as follows:
Right-click on the project -> Export -> WAR file.
The WAR file is stored in webapps folder in Tomcat. When I insert the URL: http://localhost:8080/JSFSesame/faces/index.jsp, I get the following message:
An Error Occurred:
org/openrdf/repository/config/RepositoryConfigException
Caused by:
java.lang.ClassNotFoundException - org.openrdf.repository.config.RepositoryConfigException
I do not know what is missing at this point. It seems like I need to add JAR files that I am not aware of. Could anyone please assist me to solve this problem? Your help would be very much appreciated.
The Class RepositoryConfigException is missing.
It is e.g. part of the following JAR sesame-repository-api-2.5.0.jar.
Alternatively use Ctrl+Shift+H in eclipse and look, fro which jar it is retrieved from there - copy the jar.

Missing spring-web.jar when deploying with WTP to Websphere

I've build a spring-based web project in Eclipse using Maven. Dependencies and class path are correct and the deployment assembly also lists spring-web*.jar correctly. However, when I deploy it using WebSphere 8 from within Eclipse the mentioned JAR file is missing from the created libs folder under .metadata.plugins\org.eclipse.wst.server.core\tmp2*\WEB-INF\lib . This JAR however is listed under the module section as a submodule for the container. I wasn't able to find out, why this JAR is listed there and why it is not copied to the LIB folder.
It works with a Tomcat server, it works when I export the WAR and deploy it manually and it also works when I manually copy the JAR to the lib folder.
Q1: Is this specific to Websphere?
Q2: Why is SPRING-WEB listed as submodule and what effect has this?
Q3: How can I automatically deploy it correctly?
This seems to be a bug in WAS as reported here
You can either copy the missing JARs manually or you can use the "Run server with resources on server" option in the "Publishing settings for WebSphere Application Server" server settings.

Categories