Eclipse Unable to publish to WeSphere - eclipse

I have a mabven project structure as follow
project1
-- Main pom is here
project2
-- This is my EAR project
Project3
-- This is my JAX-WS client project
Project4
-- This is my EAR project
All of these are bundled together in a single EAR file. Maven build run successfully and ear also gets deployed to WebSphere(v7) from ADMIN console.
But When I am trying to publish it to WAS from eclipse(I have web sphere developer tools plugin installed in my Eclipse) it shows some weird error as follows..
javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR: Problem parsing 'file:/C:/Workspaces/Project3/target/classes/META-INF/wsdl/'.: org.xml.sax.SAXParseException: Content is not allowed in prolog.
Any help will be appreciated.

Related

Eclipse Wildfly integration: Missing webapp resources on server

I'm building a java web application with Vaadin, which generates some config files on maven build. For some unknown reasons, only a part of the generated files in WEB-INF are present on the when trying to full publish to Wildfly in Eclipse. (In particular, WEB-INF/classes/META-INF/VAADIN/config/stats.json is not present which results in an error in the Vaadin application.)
Several things that were tested
Maven build does generate the file in the said location.
Copying the War built by maven directly to /standalone/deployments results in a working application without error.
After maven build and refresh in eclipse, the generated file is correctly shown in project explorer, indicating a successful refresh (right?)
Another generated file in the same directory DO get copied (flow-build-info.json). The difference between these two files may be, that flow-build-info.json exists twice in target, in classes/META-INF/VAADIN... as well as in /[final name]/WEB-INF/classes/META-INF..., while stats.json only exists in /[final name]/WEB-INF/classes/META-INF....
Used versions
Eclipse version: 21.12 & 21.9
JBoss AS, WildFly & EAP Server Tools: 3.9.106.v20210618-2025
Wildfly 17, 20, 22
Vaadin 14.7.5
I found out the problem: Maven build generates the Vaadin files just fine. However, if a maven update is executed afterwards in Eclipse before publishing to the server, the maven update would modify the target/classes directory. This modification somehow removes all files but the flow-build-info.json (still don't understand this part). This results in the missing resources after publishing.
So basically, maven build -> refresh in eclipse -> NO MAVEN UPDATE -> full publish works.

Change the EAR deployment name in JBoss 7.x

I use Eclipse Oxygen (4.7.2). I have JBoss Tools in my eclipse. I have JBoss AS7.1.
I have a maven "ear" project. It is called abc-project. It is a maven project from the git repository. It's version in maven pom.xml is 4.7.5-SNAPSHOT. Its Artifact Id is abc-project. When I right click the server (under the Servers tab), and added the project, it is added as abc(abc-4.7.5-SNAPSHOT).
In the ear's application.xml, we have the display name as 'abc'
After I build and publish the project to JBoss, then in the standalone/deployments folder, the ear project is deployed under the folder with name abc-4.7.5-SNAPSHOT.ear
Now in one of our code, we refer as abc.ear while looking for some default labels files. The server starts fine, but it fails to access the project, because it s deployed under the folder name abc-4.7.5-SNAPSHOT.ear.
Can I change the deployment folder or the deployment name of this project?
I would like it to be deployed under the folder abc.ear
Wherever your project is, locate the .settings folder for your project. I believe this is the eclipse settings folder. Underneath this folder, there is a file called
org.eclipse.wst.common.component
Open this file, and change the name of your project in this following entry
from:
<wb-module deploy-name="abc-4.7.5-SNAPSHOT">
to:
<wb-module deploy-name="abc">
Then, remove the project from the jboss server in eclipse under the server tab/view.
Then restart eclipse clean.
Add the project again to jboss server in eclipse under the server tab/view
Publish and restart jboss from eclipse

Created a maven project with jersey archtype but fail to build due to missing jersery servlet library

I m trying to create a maven project with the jersey archtype by following the tutorial below.
https://www.youtube.com/watch?v=skltzZH7i4w&list=PLqq-6Pq4lTTZh5U8RbdXq0WaYvZBz2rbn&index=11
The maven project fails to build with a number of errors. The root cause, I believe, is this one:
The container 'Maven Dependencies' references non existing library 'C:\Users\XXXXXXXX.m2\repository\com\sun\jersey\jersey-servlet\1.20-SNAPSHOT\jersey-servlet-1.20-SNAPSHOT.jar'
The jar doesn't exist, in fact the \jersey... folder is missing. I am using eclipse, and have installed m2e. What else do I need to bring the jersey dependent files onto the computer?
I repeated the same steps on my home computer and was able to get thru. I suspect the root cause was network/firewall setting at my work.

Can't get eclipse kepler to deploy dependency projects of dynamic web project

I've recently upgraded from Eclipse Juno to Kepler, and have imported some old projects into a new workspace, but unfortunately I cannot get publishing of one of my web projects to work. It has dependencies on a couple of other projects in the same workspace, and these projects are listed in the 'deployment assembly' tab with entries like
Source Deploy Path
/eventserver WEB-INF/lib
that I have added using the 'Add/Project' option (I'm pretty sure I've previously used 'Add/Entries from Classpath' but that option does not list the projects, so I don't know what's going on). But neither the projects' code nor their dependencies are being deployed to WEB-INF/lib when I publish the main project. Also, I have the following warning showing up:
Description Resource Path Location Type
Projects must be referenced by an EAR or a WAR to use classpath publish/export dependencies whose runtime path (../) maps into the parent component. eventserver P/eventserver Classpath Dependency Validator Message
which I only used to get if I didn't have a main project that referred to the utility project.
Any ideas what's going on?
Create an EAR project using this link:
http://www.eclipse.org/webtools/jst/components/j2ee/scenarios/application_creation_tutorial.html
After creation, try to Add the Project in server entry.

ClassNotFoundException when using User Libraries in Eclipse build path

I'm using Eclipse 3.7 (STS) with Tomcat 7 running inside the IDE. I've created a new Dynamic Web project and added a single JSP file to the web content root folder. I can run Tomcat and access the JSP from within Eclipse with no problems.
I've added a few 3rd party JAR's to the project from User Libraries (I'm not using maven or auto dependecies managment). In the JSP I reference a class from the project's JAR file, I can compile this with no problem, but when I deploy on Tomcat the JSP throws ClassNotFoundException. Clearly, Tomcat can't find the JAR's from my library settings. I tried creating a Run As configuration for Tomcat Server and I set the classpath to match the classpath settings of the project, but I still get the same classnotfound problem.
I could get around the issue by manually copying all project JARs to the WEB-INF/lib directory so the webapp can find all dependencies, but that's absurd and I don't expect that to be the solution since it's a maintenance nightmare.
Am I missing something?
In project's properties, go to Deployment Assembly. Add there the buildpath entries as well which you've manually added as user libraries. It'll end up in /WEB-INF/lib of the deployed WAR.
You'll need to copy the jar files to the WEB-INF/lib folder: that is where they are supposed to be.
Eclipse should offer you the option of generating a WAR file that includes all the dependencies: I haven't used Web Tools for a good while but one way or another all dependencies have to be in WEB-INF/lib or the class loader won't be able to find them.