Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Native compile error: Discovered unresolved method during parsing: jakarta.el.ELResolver.getFeatureDescriptors #492

Open
redddcyclone opened this issue Oct 24, 2024 · 14 comments
Assignees
Labels
question Further information is requested

Comments

@redddcyclone
Copy link

redddcyclone commented Oct 24, 2024

Hello,

First of all, I can't exactly say this issue is related to quarkus-faces, but I used it as reference and couldn't think of a better place to ask for help with the following problem.

I'm getting these errors when trying to build a native image for my project with myfaces-quarkus 4.0.2 and quarkus-primefaces 3.14.6.3:

Error: Unsupported features in 2 methods
Detailed message:
Error: Discovered unresolved method during parsing: jakarta.el.ELResolver.getFeatureDescriptors(jakarta.el.ELContext, java.lang.Object). This error is reported at image build time because class org.apache.myfaces.component.validate.CopyBeanInterceptorELResolver is registered for linking at image build time by command line and command line.
Error encountered while parsing org.apache.myfaces.component.validate.CopyBeanInterceptorELResolver.getFeatureDescriptors(CopyBeanInterceptorELResolver.java:80)
Parsing context:
   at root method.(Unknown Source)

Error: Discovered unresolved method during parsing: jakarta.el.ELResolver.getFeatureDescriptors(jakarta.el.ELContext, java.lang.Object). This error is reported at image build time because class org.primefaces.el.InterceptingResolver is registered for linking at image build time by command line and command line.
Error encountered while parsing org.primefaces.el.InterceptingResolver.getFeatureDescriptors(InterceptingResolver.java:77)
Parsing context:
   at root method.(Unknown Source)

I see @melloware had already reported this at https://issues.apache.org/jira/browse/MYFACES-4579, but I couldn't solve this problem on my own.

Do you know what might be causing this?

Thanks in advance!

@melloware
Copy link
Owner

@redddcyclone what the issue was is that somehow you have a dependency in your pom.xml bringing in the wrong EL like "Nevermind Had to remove GlassFish EL it looks like MyFaces includes JASPER EL 11.0.0-M1"

@melloware
Copy link
Owner

If you can provide your pom.xml it may help?

@melloware melloware added the question Further information is requested label Oct 24, 2024
@melloware melloware self-assigned this Oct 24, 2024
@redddcyclone
Copy link
Author

I see that the package jakarta.el-api version 5.0.1 (which contains the method described in the error) is brought by quarkus-reactive-routes and quarkus-narayana-jta. I already tried excluding this dependency from both dependencies but the problem still happens. I'll post the pom.xml in a few minutes

@melloware
Copy link
Owner

thx

@redddcyclone
Copy link
Author

redddcyclone commented Oct 24, 2024

pom.xml is as follows: (indentation is a bit broken because of mixed tabs and spaces)

<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    
    <groupId>com.blahblah</groupId>
    <artifactId>blah</artifactId>
    <version>7.0.0</version>
    <name>Blah</name>
    <description>Project</description>

    <properties>
    
    	<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    	
		<maven.compiler.release>21</maven.compiler.release>
		
		<jasperreports.version>0.0.5</jasperreports.version>
		
		<quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id>
		<quarkus.platform.version>3.15.1</quarkus.platform.version>
        <compiler-plugin.version>3.13.0</compiler-plugin.version>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <skipITs>true</skipITs>
    </properties>

    <dependencyManagement>
        <dependencies>
        
            <dependency>
                <groupId>${quarkus.platform.group-id}</groupId>
                <artifactId>quarkus-bom</artifactId>
                <version>${quarkus.platform.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
			
        </dependencies>
    </dependencyManagement>
    
    <dependencies>

        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-arc</artifactId>
        </dependency>
        
        <dependency>
            <groupId>org.apache.myfaces.core.extensions.quarkus</groupId>
            <artifactId>myfaces-quarkus</artifactId>
            <version>4.0.2</version>
        </dependency>
        
        <dependency>
        	<groupId>io.quarkus</groupId>
        	<artifactId>quarkus-resteasy</artifactId>
        </dependency>
        
		<dependency>
    		<groupId>io.quarkus</groupId>
    		<artifactId>quarkus-reactive-routes</artifactId>
		</dependency>
		
		<dependency>
    		<groupId>io.quarkus</groupId>
    		<artifactId>quarkus-security-jpa</artifactId>
		</dependency>
		
		<dependency>
    		<groupId>io.quarkus</groupId>
    		<artifactId>quarkus-smallrye-jwt</artifactId>
		</dependency>
		<dependency>
    		<groupId>io.quarkus</groupId>
    		<artifactId>quarkus-smallrye-jwt-build</artifactId>
		</dependency>
		
		<dependency>
 			<groupId>io.quarkus</groupId>
	  		<artifactId>quarkus-resteasy-jsonb</artifactId>
		</dependency>
        
        <dependency>
            <groupId>jakarta.mail</groupId>
            <artifactId>jakarta.mail-api</artifactId>
            <version>2.1.3</version>
        </dependency>
        
		<dependency>
			<groupId>io.quarkiverse.primefaces</groupId>
			<artifactId>quarkus-primefaces</artifactId>
			<version>3.14.6.3</version>
		</dependency>
		<dependency>
		    <groupId>com.googlecode.owasp-java-html-sanitizer</groupId>
		    <artifactId>owasp-java-html-sanitizer</artifactId>
		    <version>20240325.1</version>
		</dependency>
		<dependency>
			<groupId>org.webjars</groupId>
			<artifactId>font-awesome</artifactId>
			<version>6.5.2</version>
		</dependency>
		<dependency>
			<groupId>org.webjars.npm</groupId>
			<artifactId>primeflex</artifactId>
			<version>3.3.1</version>
		</dependency>
		
		<dependency>
			<groupId>io.quarkus</groupId>
			<artifactId>quarkus-hibernate-orm</artifactId>
		</dependency>
		<dependency>
			<groupId>io.quarkus</groupId>
			<artifactId>quarkus-jdbc-postgresql</artifactId>
		</dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-narayana-jta</artifactId>
        </dependency>
		
		<dependency>
			<groupId>io.quarkiverse.jasperreports</groupId>
			<artifactId>quarkus-jasperreports</artifactId>
			<version>${jasperreports.version}</version>
		</dependency>
		<dependency>
			<groupId>org.apache.groovy</groupId>
			<artifactId>groovy</artifactId>
			<version>4.0.22</version>
		</dependency>
		<dependency>
			<groupId>net.sourceforge.barbecue</groupId>
			<artifactId>barbecue</artifactId>
			<version>1.5-beta1</version>
		</dependency>
        
    </dependencies>
    
    <repositories>
    
		<repository>
			<id>local-repo</id>
			<url>file:///${project.basedir}/local-repo</url>
		</repository>
		
	</repositories>

    <build>
    
    	<finalName>${project.name}</finalName>
    	
    	<resources>
    	
    		<resource>
				<directory>src/main/resources</directory>
				<filtering>false</filtering>
			</resource>
			
			<resource>
				<directory>src/main/resources</directory>
				<filtering>true</filtering>
				<includes>
					<include>**/*.properties</include>
					<include>**/*.xml</include>
				</includes>
			</resource>
			
		</resources>
    
        <plugins>
        
            <plugin>
                <groupId>${quarkus.platform.group-id}</groupId>
                <artifactId>quarkus-maven-plugin</artifactId>
                <version>${quarkus.platform.version}</version>
                <extensions>true</extensions>
                <executions>
                    <execution>
                        <goals>
                            <goal>build</goal>
                            <goal>generate-code</goal>
                            <goal>generate-code-tests</goal>
                            <goal>native-image-agent</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${compiler-plugin.version}</version>
                <configuration>
					
					<compilerArgs>
						<arg>-parameters</arg>
					</compilerArgs>
                    
                </configuration>
            </plugin>
            
        </plugins>
        
    </build>

    <profiles>
    
        <profile>
            <id>native</id>
            <activation>
                <property>
                    <name>native</name>
                </property>
            </activation>
            <properties>
                <skipITs>false</skipITs>
                <quarkus.native.enabled>true</quarkus.native.enabled>
            </properties>
        </profile>
        
    </profiles>
    
</project>

@redddcyclone
Copy link
Author

redddcyclone commented Oct 24, 2024

Should I remove tomcat-el-api 11.0.0-M1 instead? Maybe I actually tried excluding the wrong dependency

@melloware
Copy link
Owner

try that i will also investigate on my side. I think I need to make a fix in Quarkus PrimeFaces to support this but go ahead and try that first.

@redddcyclone
Copy link
Author

@melloware I excluded tomcat-el-api 11.0.0-M1 from myfaces-quarkus itself, as in:

<dependency>
    <groupId>org.apache.myfaces.core.extensions.quarkus</groupId>
    <artifactId>myfaces-quarkus</artifactId>
    <version>4.0.2</version>
    <exclusions>
        <exclusion>
            <groupId>org.apache.tomcat</groupId>
            <artifactId>tomcat-el-api</artifactId>
        </exclusion>
    </exclusions>
</dependency>

After doing this, the native image was built just fine. Do you think something should be done about this in myfaces-quarkus and/or quarkus-primefaces?

Anyway, I'm gonna test the image now. Thanks a lot for your help as always!

@melloware
Copy link
Owner

Yep I am going to fix it in MyFaces. It should NOT be including JASPER EL it should be deferring toi Quarkus.

@melloware
Copy link
Owner

I was able to reproducer your bug here: https://github.com/quarkiverse/quarkus-primefaces/actions/runs/11501165271/job/32013126752 I just added Reactive Routes and got the issue!

@melloware
Copy link
Owner

@redddcyclone i opened this MYFACES ticket to get it fixed: https://issues.apache.org/jira/browse/MYFACES-4687

@melloware
Copy link
Owner

PR submitted that fixes this: apache/myfaces#773

@redddcyclone
Copy link
Author

Great, thanks a lot for fixing this bug! Should I close this issue or leave it open for the time being?

@melloware
Copy link
Owner

lets leave this open for others to see until the next MyFaces releases comes out and then I will update this ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants