• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

mvn clean install fails. Says any packages from JDK do not exist.

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm updating a project and am having one final issue. When I run "mvn clean install" I get a bunch of errors for all of the java classes used. I get hundreds of errors like "package javax.servlet does not exist". My update was to take an existing project and update all libraries, the version of java, eclipse, wildfly, etc.

The project compiles and runs within Eclipse, but fails when I do the mvn clean install. There must be something I am missing to tell mvn that all of the jdk classes are provided at run time.

Eclipse 2022-3
Wildfly 25.0.1
OpenJDK 17

Is there something I need to add to the mvn command line, or to my pom.xml or something?

Here is the portion of the mvn clean install that is relevant.

[INFO] --------------------< com.b2bconnex:Connex100-web >---------------------
[INFO] Building Connex100 - web 1                                         [4/5]
[INFO] --------------------------------[ war ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ Connex100-web ---
[INFO] Deleting C:\B2BDev\workspace\Connex100\web\target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ Connex100-web ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.3.1:compile (default-compile) @ Connex100-web ---
[INFO] Compiling 668 source files to C:\B2BDev\workspace\Connex100\web\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] \B2BDev\workspace\Connex100\web\src\main\java\com\b2bconnex\utility\listeners\SystemDownTrackerSingleton.java:[9,20] error: package javax.servlet does not exist

[ERROR] \B2BDev\workspace\Connex100\web\src\main\java\com\b2bconnex\utility\web\ActionBase.java:[14,25] error: package javax.servlet.http does not exist

[ERROR] \B2BDev\workspace\Connex100\web\src\main\java\com\b2bconnex\utility\web\ActionBase.java:[15,25] error: package javax.servlet.http does not exist

[ERROR] \B2BDev\workspace\Connex100\web\src\main\java\com\b2bconnex\utility\web\ActionBase.java:[16,25] error: package javax.servlet.http does not exist

[ERROR] \B2BDev\workspace\Connex100\web\src\main\java\com\b2bconnex\actions\transaction\ViewTransactionHistoryAction.java:[8,25] error: package javax.servlet.http does not exist

[ERROR] \B2BDev\workspace\Connex100\web\src\main\java\com\b2bconnex\actions\transaction\ViewTransactionHistoryAction.java:[9,25] error: package javax.servlet.http does not exist

[ERROR] \B2BDev\workspace\Connex100\web\src\main\java\com\b2bconnex\admin\instructions\ViewInstructionAction.java:[10,25] error: package javax.servlet.http does not exist

[ERROR] \B2BDev\workspace\Connex100\web\src\main\java\com\b2bconnex\admin\type\obj\TypeBO.java:[9,21] error: package javax.xml.bind does not exist

[ERROR] \B2BDev\workspace\Connex100\web\src\main\java\com\b2bconnex\actions\download\DownloadTypeStructureXML.java:[5,21] error: package javax.xml.bind does not exist

[ERROR] \B2BDev\workspace\Connex100\web\src\main\java\com\b2bconnex\actions\download\DownloadTypeStructureXML.java:[6,32] error: package javax.xml.bind.annotation does not exist

[ERROR] \B2BDev\workspace\Connex100\web\src\main\java\com\b2bconnex\actions\download\DownloadTypeStructureXML.java:[7,32] error: package javax.xml.bind.annotation does not exist

[ERROR] \B2BDev\workspace\Connex100\web\src\main\java\com\b2bconnex\actions\download\DownloadTypeStructureXML.java:[22,1] error: cannot find symbol

[ERROR] \B2BDev\workspace\Connex100\web\src\main\java\com\b2bconnex\actions\download\DownloadTypeStructureXML.java:[23,1] error: cannot find symbol
 
Saloon Keeper
Posts: 15630
366
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please share your POM.
 
david kuehner
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Stephan van Hulst wrote:Please share your POM.



My project is comprised of 4 sub projects. There is an API project, an EJB project and a WEB project all built into an EAR project. Each has it's own POM as below. I understand that there may be some issues with all of this as the person who put all of this together is no longer with the company and I know I've missed some things when doing this upgrade.

The API POM.

<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 <modelVersion>4.0.0</modelVersion>
 <parent>
   <groupId>com.api</groupId>
   <artifactId>api</artifactId>
   <version>1</version>
 </parent>
 <artifactId>api-api</artifactId>
 <name>api - api</name>
 <url>http://maven.apache.org</url>;
 <properties>
   <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
   <maven.compiler.source>17</maven.compiler.source>
   <maven.compiler.target>17</maven.compiler.target>
 </properties>
 <dependencies>
   <dependency>
     <groupId>junit</groupId>
     <artifactId>junit</artifactId>
     <scope>test</scope>
   </dependency>
 </dependencies>
</project>

The EJB POM

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   <modelVersion>4.0.0</modelVersion>
   <parent>
       <artifactId>bbbbb</artifactId>
       <groupId>com.ejb</groupId>
       <version>1</version>
   </parent>
   <artifactId>bbbbb-ejb</artifactId>
   <packaging>ejb</packaging>
   <name>bbbbb - ejb</name>

   <url>http://jboss.org/jbossas</url>;

   <dependencies>
       <dependency>
           <groupId>org.jboss.spec.javax.ejb</groupId>
           <artifactId>jboss-ejb-api_3.1_spec</artifactId>
           <scope>provided</scope>
       </dependency>
       <dependency>
           <groupId>javax.enterprise</groupId>
           <artifactId>cdi-api</artifactId>
           <scope>provided</scope>
       </dependency>
       <dependency>
           <groupId>org.hibernate.javax.persistence</groupId>
           <artifactId>hibernate-jpa-2.0-api</artifactId>
           <scope>provided</scope>
       </dependency>
       <dependency>
           <groupId>org.hibernate</groupId>
           <artifactId>hibernate-validator</artifactId>
           <scope>provided</scope>
       </dependency>
       <dependency>
           <groupId>junit</groupId>
           <artifactId>junit</artifactId>
           <scope>test</scope>
       </dependency>
   </dependencies>

   <build>
       <finalName>${project.artifactId}</finalName>
       <plugins>
           <plugin>
               <artifactId>maven-ejb-plugin</artifactId>
               <version>${version.ejb.plugin}</version>
               <configuration>
                   <ejbVersion>3.1</ejbVersion>
               </configuration>
           </plugin>
       </plugins>
   </build>

   <profiles>
       <profile>
           <id>default</id>
           <activation>
               <activeByDefault>true</activeByDefault>
           </activation>
           <build>
               <plugins>
                   <plugin>
                       <artifactId>maven-surefire-plugin</artifactId>
                       <version>${version.surefire.plugin}</version>
                       <configuration>
                           <skip>true</skip>
                       </configuration>
                   </plugin>
               </plugins>
           </build>
       </profile>

       <profile>
           <id>arq-jbossas-managed</id>
           <dependencies>
               <dependency>
                   <groupId>org.jboss.as</groupId>
                   <artifactId>jboss-as-arquillian-container-managed</artifactId>
                   <scope>test</scope>
               </dependency>
           </dependencies>
       </profile>

       <profile>
           <id>arq-jbossas-remote</id>
           <dependencies>
               <dependency>
                   <groupId>org.jboss.as</groupId>
                   <artifactId>jboss-as-arquillian-container-remote</artifactId>
                   <scope>test</scope>
               </dependency>
           </dependencies>
       </profile>

   </profiles>
 <properties>
   <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
   <maven.compiler.source>17</maven.compiler.source>
   <maven.compiler.target>17</maven.compiler.target>
 </properties>

</project>

The WEB POM

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
 <modelVersion>4.0.0</modelVersion>
 <parent>
   <artifactId>cccccc</artifactId>
   <groupId>com.web</groupId>
   <version>1</version>
 </parent>
 <artifactId>cccccc-web</artifactId>
 <packaging>war</packaging>
 <name>cccccc - web</name>
 <url>http://jboss.org/jbossas</url>;
 <profiles>
   <profile>
     <id>play</id>
     <build>
       <plugins>
         <plugin>
           <artifactId>maven-compiler-plugin</artifactId>
           <configuration>
             <includes>
               <include>com/**/*.java</include>
             </includes>
           </configuration>
         </plugin>
       </plugins>
     </build>      
   </profile>
 </profiles>
 <dependencies>
   <dependency>
     <groupId>com.api</groupId>
     <artifactId>cccccc-api</artifactId>
     <scope>provided</scope>
   </dependency>
   <dependency>
     <groupId>com.ejb</groupId>
     <artifactId>cccccc-ejb</artifactId>
     <type>ejb</type>
     <scope>provided</scope>
   </dependency>
   <dependency>
    <groupId>commons-beanutils</groupId>
    <artifactId>commons-beanutils</artifactId>
    <version>1.9.4</version>
   </dependency>
   <dependency>
    <groupId>commons-codec</groupId>
    <artifactId>commons-codec</artifactId>
    <version>1.15</version>
   </dependency>
   <dependency>
    <groupId>commons-collections</groupId>
    <artifactId>commons-collections</artifactId>
    <version>3.2.2</version>
   </dependency>
   <dependency>
    <groupId>org.apache.commons</groupId>
    <artifactId>commons-collections4</artifactId>
    <version>4.4</version>
   </dependency>
   <dependency>
    <groupId>commons-io</groupId>
    <artifactId>commons-io</artifactId>
    <version>2.10.0</version>
   </dependency>
   <dependency>
    <groupId>org.apache.commons</groupId>
    <artifactId>commons-lang3</artifactId>
    <version>3.12.0</version>
   </dependency>
   <dependency>
    <groupId>commons-net</groupId>
    <artifactId>commons-net</artifactId>
    <version>3.8.0</version>
   </dependency>
  <dependency>
   <groupId>org.apache.xmlbeans</groupId>
   <artifactId>xmlbeans</artifactId>
   <version>5.0.3</version>
  </dependency>
 </dependencies>
 <build>
   <finalName>${project.artifactId}</finalName>
   <plugins>
     <plugin>
       <artifactId>maven-war-plugin</artifactId>
       <version>${version.war.plugin}</version>
       <configuration>
        <archiveClasses>true</archiveClasses>
       </configuration>
     </plugin>
     <plugin>
       <groupId>org.apache.maven.plugins</groupId>
       <artifactId>maven-compiler-plugin</artifactId>
       <configuration>
         <source>17</source>
         <target>17</target>
        <includes>
         <include>com/web/**/*.java</include>
        </includes>
       </configuration>
     </plugin>
     <plugin>
       <groupId>org.apache.maven.plugins</groupId>
       <artifactId>maven-surefire-plugin</artifactId>
       <version>2.12</version>
     </plugin>
   </plugins>
 </build>
 <properties>
   <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
   <maven.compiler.source>17</maven.compiler.source>
   <maven.compiler.target>17</maven.compiler.target>
 </properties>
</project>

 
david kuehner
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The EAR POM

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   <modelVersion>4.0.0</modelVersion>

   <parent>
       <artifactId>dddd</artifactId>
       <groupId>com.ear</groupId>
       <version>1</version>
   </parent>

   <artifactId>dddd-ear</artifactId>
   <packaging>ear</packaging>

   <name>dddd - ear</name>

   <url>http://jboss.org/jbossas</url>;

   <dependencies>

       <dependency>
           <groupId>com.api</groupId>
           <artifactId>dddd-api</artifactId>
       </dependency>
       <dependency>
           <groupId>com.web</groupId>
           <artifactId>dddd-web</artifactId>
           <type>war</type>
       </dependency>
       <dependency>
           <groupId>com.ejb</groupId>
           <artifactId>dddd-ejb</artifactId>
           <type>ejb</type>
       </dependency>
   </dependencies>

   <build>
       <finalName>${project.artifactId}</finalName>
       <plugins>
           <plugin>
               <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-ear-plugin</artifactId>
               <version>${version.ear.plugin}</version>
               <configuration>
                   <version>6</version>
                   <defaultLibBundleDir>lib</defaultLibBundleDir>
                   <modules>
                   <webModule>
                       <groupId>com.ear</groupId>
                       <artifactId>dddd-web</artifactId>
                       <contextRoot>/</contextRoot>
                   </webModule>
                   </modules>
                   <fileNameMapping>no-version</fileNameMapping>
               </configuration>
           </plugin>
           <plugin>
               <artifactId>maven-war-plugin</artifactId>
               <version>${version.war.plugin}</version>
               <configuration>
                     <packagingIncludes>WEB-INF/lib/*.jar</packagingIncludes>
               </configuration>
           </plugin>

           <plugin>
               <groupId>org.jboss.as.plugins</groupId>
               <artifactId>jboss-as-maven-plugin</artifactId>
               <configuration>
                   <filename>${project.artifactId}.ear</filename>
                   <skip>false</skip>
               </configuration>
           </plugin>
       </plugins>
   </build>
 
   <profiles>
       <profile>
           <id>openshift</id>
           <build>
               <plugins>
                   <plugin>
                       <artifactId>maven-ear-plugin</artifactId>
                       <version>${version.ear.plugin}</version>
                       <configuration>
                           <outputDirectory>deployments</outputDirectory>
                       </configuration>
                   </plugin>
               </plugins>
           </build>
       </profile>
   </profiles>

   <version>10.00.00</version>
 <properties>
   <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
   <maven.compiler.source>17</maven.compiler.source>
   <maven.compiler.target>17</maven.compiler.target>
 </properties>
</project>
 
Stephan van Hulst
Saloon Keeper
Posts: 15630
366
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We also need to see the parent POMs of those projects.

Are those the real Maven coordinates (groupId and artifactId) or did you censor them? If those are the original coordinates, then you might want to consider renaming them to something sensible.

If you did censor them, please do so consistently. For instance, I see you named you web app project cccccc-web in one file, but you refer tonit as dddd-web in another. We need to be able to reproduce your build.
 
david kuehner
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry - parent POM below

Ad, yes, I did do a small amount of censoring.

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
 <name>parent</name>
 <modelVersion>4.0.0</modelVersion>
 <groupId>com.parent</groupId>
 <artifactId>parent</artifactId>
 <packaging>pom</packaging>
 <url>http://jboss.org/jbossas</url>;
 <modules>
   <module>ejb</module>
   <module>web</module>
   <module>ear</module>
   <module>api</module>
 </modules>
 <profiles>
   <profile>
     <id>ci</id>
     <modules>
       <module>web</module>
       <module>ear</module>
     </modules>
   </profile>
 </profiles>
 <properties>
   <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
   <version.jboss.maven.plugin>7.3.Final</version.jboss.maven.plugin>
   <version.jboss.bom>1.0.7.CR8</version.jboss.bom>
   <version.jboss.as>7.2.0.Final</version.jboss.as>
   <version.compiler.plugin>2.3.1</version.compiler.plugin>
   <version.ear.plugin>2.6</version.ear.plugin>
   <version.ejb.plugin>2.3</version.ejb.plugin>
   <version.surefire.plugin>2.10</version.surefire.plugin>
   <version.war.plugin>2.1.1</version.war.plugin>
   <maven.compiler.target>17</maven.compiler.target>
   <maven.compiler.source>17</maven.compiler.source>
 </properties>
 <dependencyManagement>
   <dependencies>
     <dependency>
       <groupId>com.api</groupId>
       <artifactId>aaaaa-api</artifactId>
       <version>1</version>
     </dependency>
     <dependency>
       <groupId>com.ejb</groupId>
       <artifactId>bbbbb-ejb</artifactId>
       <version>1</version>
       <type>ejb</type>
     </dependency>
     <dependency>
       <groupId>com.web</groupId>
       <artifactId>ccccc-web</artifactId>
       <version>1</version>
       <type>war</type>
     </dependency>
     <dependency>
       <groupId>org.jboss.bom</groupId>
       <artifactId>jboss-javaee-6.0-with-tools</artifactId>
       <version>${version.jboss.bom}</version>
       <type>pom</type>
       <scope>import</scope>
     </dependency>
     <dependency>
       <groupId>org.jboss.bom</groupId>
       <artifactId>jboss-javaee-6.0-with-hibernate</artifactId>
       <version>${version.jboss.bom}</version>
       <type>pom</type>
       <scope>import</scope>
     </dependency>
   </dependencies>
 </dependencyManagement>
 <build>
   <pluginManagement>
     <plugins>
       <plugin>
         <artifactId>maven-compiler-plugin</artifactId>
         <version>${version.compiler.plugin}</version>
         <configuration>
           <source>${maven.compiler.source}</source>
           <target>${maven.compiler.target}</target>
         </configuration>
       </plugin>
       <plugin>
         <groupId>org.jboss.as.plugins</groupId>
         <artifactId>jboss-as-maven-plugin</artifactId>
         <version>${version.jboss.maven.plugin}</version>
         <inherited>true</inherited>
         <configuration>
           <skip>true</skip>
         </configuration>
       </plugin>
     </plugins>
   </pluginManagement>
   <plugins>
     <plugin>
       <groupId>org.codehaus.mojo</groupId>
       <artifactId>license-maven-plugin</artifactId>
       <version>1.5</version>
     </plugin>
   </plugins>
 </build>
 <version>1</version>
</project>
 
david kuehner
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
P.S. You are right. I didn't censor as well as I should. I didn't realize that you were going to try to reproduce anything. I thought it would just be more of a visual review looking for issues.
 
Stephan van Hulst
Saloon Keeper
Posts: 15630
366
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Okay well, it seems to me that the problem is simply that your web project doesn't declare a dependency on the Servlet API.

Use one of the following coordinates, depending on the version of the Servlet API you want to use.

You won't be able to use a version newer than 4.0.3 without changing a lot of code, because in version 4.0.4 all the packages were renamed from javax.servlet to jakarta.servlet.
 
david kuehner
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you, however, I've already gone down this path. Adding the dependency you mentioned only fixes one of the issues. I've added the top of the new set of errors output by mvn below.

The problem is that I would need to add new dependencies for all of the javax classes I've used. As you can see, now I need to handle javax.xml, javax.persistence, javax.servlet.jsp, etc. And those are just the beginning.

I was hoping to find a way to add a general dependency to handle all of the JDK classes. My previous mvn build before I updated my project didn't need to add each JDK class as a dependency.


[INFO] --- maven-compiler-plugin:2.3.1:compile (default-compile) @ Connex100-web ---
[INFO] Compiling 668 source files to C:\B2BDev\workspace\Connex100\web\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] \B2BDev\workspace\Connex100\web\src\main\java\com\b2bconnex\admin\type\obj\TypeBO.java:[9,21] error: package javax.xml.bind does not exist
[ERROR] \B2BDev\workspace\Connex100\web\src\main\java\com\b2bconnex\actions\download\DownloadTypeStructureXML.java:[5,21] error: package javax.xml.bind does not exist
[ERROR] \B2BDev\workspace\Connex100\web\src\main\java\com\b2bconnex\actions\download\DownloadTypeStructureXML.java:[6,32] error: package javax.xml.bind.annotation does not exist
[ERROR] \B2BDev\workspace\Connex100\web\src\main\java\com\b2bconnex\actions\download\DownloadTypeStructureXML.java:[7,32] error: package javax.xml.bind.annotation does not exist
[ERROR] \B2BDev\workspace\Connex100\web\src\main\java\com\b2bconnex\actions\download\DownloadTypeStructureXML.java:[22,1] error: cannot find symbol
[ERROR] \B2BDev\workspace\Connex100\web\src\main\java\com\b2bconnex\actions\download\DownloadTypeStructureXML.java:[23,1] error: cannot find symbol
[ERROR] \B2BDev\workspace\Connex100\web\src\main\java\com\b2bconnex\admin\gui\skin\obj\GuiSkinBean.java:[3,24] error: package javax.persistence does not exist
[ERROR] \B2BDev\workspace\Connex100\web\src\main\java\com\b2bconnex\utility\web\TextTag.java:[7,24] error: package javax.servlet.jsp does not exist
[ERROR] \B2BDev\workspace\Connex100\web\src\main\java\com\b2bconnex\utility\web\TextTag.java:[8,24] error: package javax.servlet.jsp does not exist
[ERROR] \B2BDev\workspace\Connex100\web\src\main\java\com\b2bconnex\utility\web\TextTag.java:[9,31] error: package javax.servlet.jsp.tagext does not exist
[ERROR] \B2BDev\workspace\Connex100\web\src\main\java\com\b2bconnex\utility\web\TextTag.java:[23,29] error: cannot find symbol
[ERROR] \B2BDev\workspace\Connex100\web\src\main\java\com\b2bconnex\utility\web\TextTag.java:[97,41] error: cannot find symbol
[ERROR] \B2BDev\workspace\Connex100\web\src\main\java\com\b2bconnex\admin\gui\content\obj\GuiContentBean.java:[3,24] error: package javax.persistence does not exist
[ERROR] \B2BDev\workspace\Connex100\web\src\main\java\com\b2bconnex\schedule\VMScheuledWebServiceProcessor.java:[10,21] error: package javax.xml.soap does not exist
[ERROR] \B2BDev\workspace\Connex100\web\src\main\java\com\b2bconnex\schedule\VMScheuledWebServiceProcessor.java:[11,21] error: package javax.xml.soap does not exist
[ERROR] \B2BDev\workspace\Connex100\web\src\main\java\com\b2bconnex\schedule\VMScheuledWebServiceProcessor.java:[12,21] error: package javax.xml.soap does not exist
[ERROR] \B2BDev\workspace\Connex100\web\src\main\java\com\b2bconnex\schedule\VMScheuledWebServiceProcessor.java:[13,21] error: package javax.xml.soap does not exist
[ERROR] \B2BDev\workspace\Connex100\web\src\main\java\com\b2bconnex\schedule\VMScheuledWebServiceProcessor.java:[14,21] error: package javax.xml.soap does not exist
 
Saloon Keeper
Posts: 27885
198
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First, make sure that Wildfly version 25 does in fact work with Jakarta EE and NOT Java EE. Java EE was the original Sun/Oracle Enterprise Edition spec, Jakarta EE is the post-Oracle Enterprise spec. To the best of my knowledge an EE server runs with one or the other but cannot run with both.

The "javax" classes are not part of the core JDK. They are part of Java EE and every reference to the Java EE classes has to be re-mapped to the jakarta package space when migrating from Java EE to Jakarta EE.

Hopefully someone wrote a tool to do the project source code conversions in bulk for a project. I did something similar recently for a project that had packages renamed, but not to jakarta.
 
david kuehner
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ah. I see. The switch from java EE to Jakarta EE was not something I was aware of. I'll have to look into that and see what the implications are.

Needless to say, updating legacy applications to enhance security is not a trivial task.

Thank you for your help. I think there is more I need to do at a general level before trying to sort things out the detail level.
 
Tim Holloway
Saloon Keeper
Posts: 27885
198
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The biggest impact is the renaming of all the packages. And of course, the whole subsystem's new name: "Jakarta EE". Jakarta itself has a long and storied history at the Apache project where it spawned (among other things), the Tomcat webapp server.

Tomcat switches to Jakarta at Tomcat 10. I've been dreading the migration, since it has massive downstream effects when working with web frameworks such as JSF implementation libraries (JSF was JEE and has moved to Jakarta EE but not all providers have done so yet, I think), and Spring Boot.
 
Stephan van Hulst
Saloon Keeper
Posts: 15630
366
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm relatively certain that it's the Preview version of Wildfly 26 that made the switch to Jakarta EE. Wildfly 25 should be fine with the Java EE classes.

Really, there really aren't *that* many API dependencies to add to the project, but if you don't want to, I believe you can also just add one dependency that includes all the APIs of the entire Java EE platform:

I'm surprised that the application built before you started maintaining it. The Java EE APIs are not included by default, and the project should already have made a reference to those APIs for it to build successfully.
 
david kuehner
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
2 things:

First, it turns out that the javax - javaee-api dependency was in the old version of the POM, but it had been taken out by "those who came before". Thank you for pointing this out.

Second, now the project almost builds. The only unresolved packages now are javax.xml.bind, javax.xml.bind.annotation, and javax.xml.soap


I don't suppose that you know the dependencies I need to add to cover those? The maven setup in the project might not be correct, but if I can get it to build and it tests out OK, then this might just do the trick.

Thanks in advance.
 
Tim Holloway
Saloon Keeper
Posts: 27885
198
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The javax.xml packages used to be part of the base JDK (not the EE devkit). That is no longer true.

The best Maven replacements depend on what version of Java EE or Jakarta EE you are building for, so here's a link:

https://stackoverflow.com/questions/52502189/java-11-package-javax-xml-bind-does-not-exist
 
david kuehner
Greenhorn
Posts: 15
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You guys are awesome.

You have lead me down the right path and my project is building into an ear now.

Next comes testing.

reply
    Bookmark Topic Watch Topic
  • New Topic