Liferay hook with spring cause deploy exception - spring

I'm migrating code of liferay hook from liferay version 7.1 to 7.4 and have problem with hook that also is using spring. When I try to deploy this hook with spring I get this exception in logs:
java.lang.RuntimeException: com.liferay.portal.kernel.deploy.auto.AutoDeployException: More than one auto deploy listener is available for C:\Sources\liferay-dxp-7.4.13.u43\tomcat-9.0.56\temp\20230127125211722PNNVWNES\listeners-hook.war: com.liferay.portal.deploy.auto.HookAutoDeployListener, com.liferay.portal.deploy.auto.PortletAutoDeployListener
at com.liferay.portal.osgi.web.wab.generator.internal.processor.WabProcessor._getAutoDeployListener(WabProcessor.java:413) ~[?:?]
It looks that liferay can't decide if this is a hook or a portlet. How to fix this?

Related

How to replace Spring custom configurations with the new JBossWS descriptor configuration in JBoss 7.4?

While upgrading JBoss server from 6 to 7.4, I got to know that Spring integration is no longer supported in JBoss EAP 7. But in my project we have used Apache CXF dependency injection to provide WS endpoints. But as spring integration is no longer supported, I need to replace Spring custom configurations with the new JBossWS descriptor configuration but I got no references anywhere.
This approach is specified in below URL at point no: 5.1.2
APPLICATION MIGRATION CHANGES
Can somebody help me with this migration?
I tried by removing servlet dependency from web.xml and it was working but then I WS endpoints stopped working as I removed the dependency injection. PFA for reference

Spring 5 with Spring-social reports java.lang.NoSuchMethodError: org.springframework.web.util.WebUtils.extractFullFilenameFromUrlPath

I have tested Spring 5.0.0.RELEASE to 5.3.4 and all failed with the latest spring social with Facebook login and all reported this error
java.lang.NoSuchMethodError: org.springframework.web.util.WebUtils.extractFullFilenameFromUrlPath(Ljava/lang/String;)Ljava/lang/String;
I looked at all JARs & it seems that the static method of WebUtils.extractFullFilenameFromUrlPath doesn't exists in 5.x.x. BTW. I tried this solution and it failed too; Spring still attempts to invoke the method
On the other hand, Spring 4.x.x worked like a charm
It should be noted that I am not using Spring Boot
Plz help

Issue when deploying Jhipster 4.7.0 War file in WebSphere 8.5.5

I'm developing application using Jhipster 4.7.0 . I have created war file. When I'm deploying to web-sphere 8.5.5 I'm facing this issue:
"com.ibm.ws.webcontainer.exception.WebAppNotLoadedException: Failed to load webapp: javax.servlet.ServletContainerInitializer: Provider org.springframework.web.SpringServletContainerInitializer not a subtype"
I have changed class-loading library to PARENT_LAST because latest version using JPA2.1 and JPA provider for Websphere is older.
It does not seem to Jhipster Issue. It seems Spring Boot Deployment on WebSphere issue.
Any suggestion for that .It seems that it's because of library conflict with Websphere but I do not know where should I trace it?

java.lang.NoClassDefFoundError on using spring security on google app engine

I am using Spring Core framework version 4.1.6.RELEASE and Spring Security version 4.0.0.RELEASE in my google app. But when I try to run it in local appservere I see following log
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.filterChains': Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: java.lang.reflect.Parameter is a restricted class. Please see the Google App Engine developer's guide for more details.
Then I checked that in which jdk version this java.lang.reflect.Parameter class was introduced and found that it is there since 1.8. But app engine supports java 1.7 only. How could I find the spring framework versions which are build on 1.7 JDK. Please suggest
You have to download the JDK7 and it will work. I had the same problem.

deploying Spring boot in websphere

Websphere 8.5.5.2
Trying to deploy spring boot application in to websphere server. I already made sure class loader policy is parent last. Issue seems because websphere may need some additional configuration to recognize war without any web.xml? Not sure. Getting below error.
Caused by: javax.xml.bind.JAXBException: ClassCastException: attempting to cast jar:file:/usr/WebSphere850/AppServer/endorsed_apis/jaxb-api.jar!/javax/xml/bind/JAXBContext.class
to
wsjar:file:/usr/WebSphere850/AppServer/profiles/node01/installedApps/dchislwsapp020Cell01/My%20Application%20Service%20-%20Test%20Service.ear/test-plan-rest.war/WEB-INF/lib/jaxb-api-2.2.11.jar!/javax/xml/bind/JAXBContext.class.Please make sure that you are specifying the proper ClassLoader.`
You should be able to do this by adding
DisableIBMJAXWSEngine: true
to your application's META-INF/MANIFEST.MF to disable it at the application level.
To disable it at the server level follow the directions at: http://www-01.ibm.com/support/knowledgecenter/SS7JFU_6.1.0/com.ibm.websphere.express.doc/info/exp/ae/twbs_thirdparty.html?cp=SS7JFU_6.1.0%2F1-7-9-4-1-14-0 to disable at the server level.

Resources