You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by "matthiasblaesing (via GitHub)" <gi...@apache.org> on 2024/06/12 20:31:18 UTC

[PR] Run maven embedder with the "normal" NetBeans environment not special context class loader [netbeans]

matthiasblaesing opened a new pull request, #7464:
URL: https://github.com/apache/netbeans/pull/7464

   To parse JSF libraries in an (more or less) isolated environment, the JSF library parsing is done with a special context class loader in place.
   
   However as part of the preparation of the parsing process also maven embedded is used to fetch the JSF reference implementation(s).
   
   For a subset of users this exception was oberserved:
   
   ```
   SEVERE [org.openide.util.Exceptions]
   java.lang.ClassCastException: class org.apache.commons.logging.impl.LogFactoryImpl cannot be cast to class org.apache.commons.logging.LogFactory (org.apache.commons.logging.impl.LogFactoryImpl is in unnamed module of loader org.netbeans.modules.web.jsf.editor.facelets.FaceletsLibrarySupport$3 @473436a0; org.apache.commons.logging.LogFactory is in unnamed module of loader org.netbeans.modules.netbinox.NetbinoxLoader @1f369488)
   	at org.apache.commons.logging.LogFactory.newFactory(LogFactory.java:1445)
   	at org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:818)
   	at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:987)
   	at org.apache.http.conn.ssl.AbstractVerifier.<init>(AbstractVerifier.java:61)
   	at org.apache.http.conn.ssl.AllowAllHostnameVerifier.<init>(AllowAllHostnameVerifier.java:44)
   	at org.apache.http.conn.ssl.AllowAllHostnameVerifier.<clinit>(AllowAllHostnameVerifier.java:46)
   Caused: java.lang.ExceptionInInitializerError
   	at org.apache.http.conn.ssl.SSLConnectionSocketFactory.<clinit>(SSLConnectionSocketFactory.java:151)
   	at org.eclipse.aether.transport.http.GlobalState.newConnectionManager(GlobalState.java:169)
   	at org.eclipse.aether.transport.http.LocalState.<init>(LocalState.java:57)
   	at org.eclipse.aether.transport.http.HttpTransporter.<init>(HttpTransporter.java:197)
   	at org.eclipse.aether.transport.http.HttpTransporterFactory.newInstance(HttpTransporterFactory.java:95)
   	at org.eclipse.aether.internal.impl.DefaultTransporterProvider.newTransporter(DefaultTransporterProvider.java:94)
   	at org.eclipse.aether.connector.basic.BasicRepositoryConnector.<init>(BasicRepositoryConnector.java:128)
   	at org.eclipse.aether.connector.basic.BasicRepositoryConnectorFactory.newInstance(BasicRepositoryConnectorFactory.java:172)
   	at org.eclipse.aether.internal.impl.DefaultRepositoryConnectorProvider.newRepositoryConnector(DefaultRepositoryConnectorProvider.java:122)
   	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:536)
   	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:449)
   	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:261)
   	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:243)
   	at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveArtifact(DefaultRepositorySystem.java:278)
   	at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:197)
   	at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolveAlways(DefaultArtifactResolver.java:152)
   	at org.netbeans.modules.maven.embedder.MavenEmbedder.resolveArtifact(MavenEmbedder.java:424)
   	at org.netbeans.modules.maven.j2ee.MavenJsfReferenceImplementationProvider.artifactPathFor(MavenJsfReferenceImplementationProvider.java:81)
   	at org.netbeans.modules.web.jsf.editor.facelets.FaceletsLibrarySupport.parseLibraries(FaceletsLibrarySupport.java:361)
   	at org.netbeans.modules.web.jsf.editor.facelets.FaceletsLibrarySupport._findLibraries(FaceletsLibrarySupport.java:325)
   ```
   
   The theory is, that running DefaultArtifactResolver#resolveAlways causes loading of class LogFactoryImpl. As the context class loader is replaced that context class loader is used for loading the class. That clashes with the LogFactory, that is loaded via NetBinox.
   
   It is expected, that removing the maven embedder call resolves the problem or at least reduces the situation where this problem might occur.
   
   Closes: #7449
   Closes: #7436
   Closes: #7354


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


Re: [PR] Run maven embedder with the "normal" NetBeans environment not special context class loader [netbeans]

Posted by "matthiasblaesing (via GitHub)" <gi...@apache.org>.
matthiasblaesing merged PR #7464:
URL: https://github.com/apache/netbeans/pull/7464


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


Re: [PR] Run maven embedder with the "normal" NetBeans environment not special context class loader [netbeans]

Posted by "matthiasblaesing (via GitHub)" <gi...@apache.org>.
matthiasblaesing commented on PR #7464:
URL: https://github.com/apache/netbeans/pull/7464#issuecomment-2171435519

   @asbachb thanks for checking. I think the change is save enough after test and check. Lets get this in.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


Re: [PR] Run maven embedder with the "normal" NetBeans environment not special context class loader [netbeans]

Posted by "matthiasblaesing (via GitHub)" <gi...@apache.org>.
matthiasblaesing commented on PR #7464:
URL: https://github.com/apache/netbeans/pull/7464#issuecomment-2168550701

   @vitsuchanek @SimonePadovan @helper14 thank you all for the quick check.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists