miha zoubek

Ranch Hand
+ Follow
since Sep 13, 2019
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
4
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by miha zoubek

Hello


when application is started from Intellij it is working. Issue is only when I do "mvn package" and then run like "java -jar VoLTE-0.0.1-SNAHOT.jar"

here is my error:


APPLICATION FAILED TO START
***************************

Description:

An attempt was made to call a method that does not exist. The attempt was made from the following location:

   org.springframework.boot.autoconfigure.http.HttpMessageConverters.configurePartConverters(HttpMessageConverters.java:140)

The following method did not exist:

   'java.util.List org.springframework.http.converter.support.AllEncompassingFormHttpMessageConverter.getPartConverters()'

The method's class, org.springframework.http.converter.support.AllEncompassingFormHttpMessageConverter, is available from the following locations:

   jar:file:/C:/Users/bla/OneDrive/Dokumenti/Job/Lj/Spring/VoLTELatest/VoLTE/target/VoLTE-0.0.1-SNAPSHOT.jar!/BOOT-INF/lib/spring-web-5.2.1.RELEASE.jar!/org/springframework/http/converter/support/AllEncompassingFormHttpMessageCon
verter.class

The class hierarchy was loaded from the following locations:

   org.springframework.http.converter.support.AllEncompassingFormHttpMessageConverter: jar:file:/C:/Users/bla/OneDrive/Dokumenti/Job/Lj/Spring/VoLTELatest/VoLTE/target/VoLTE-0.0.1-SNAHOT.jaPSr!/BOOT-INF/lib/spring-web-5.2.1.RELEA
SE.jar!/
   org.springframework.http.converter.FormHttpMessageConverter: jar:file:/C:/Users/miha_/OneDrive/Dokumenti/Job/Lj/Spring/VoLTELatest/VoLTE/target/VoLTE-0.0.1-SNAPSHOT.jar!/BOOT-INF/lib/spring-web-5.2.1.RELEASE.jar!/


Action:

Correct the classpath of your application so that it contains a single, compatible version of org.springframework.http.converter.support.AllEncompassingFormHttpMessageConverter



Pom.xml

thank you for help!
Miha
2 years ago
Hello

i am unable to find out what is causing this issue:

ain] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'requestMappingHandlerAdapter' defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter]: Factory method 'requestMappingHandlerAdapter' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'messageConverters' defined in class path resource [org/springframework/boot/autoconfigure/http/HttpMessageConvertersAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.autoconfigure.http.HttpMessageConverters]: Factory method 'messageConverters' threw exception; nested exception is java.lang.NoSuchMethodError: org.springframework.http.converter.support



my pom.xml file:
<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>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.5.1</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>VoLTE</groupId>
<artifactId>VoLTE</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>VoLTE</name>
<description>test VoLte</description>

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web-services</artifactId>
</dependency>





<!-- wss4j -->
<dependency>
<groupId>org.apache.wss4j</groupId>
<artifactId>wss4j</artifactId>
<version>2.2.4</version>

<type>pom</type>
</dependency>

<dependency>
<groupId>org.apache.santuario</groupId>
<artifactId>xmlsec</artifactId>
<version>2.1.4</version>
</dependency>


<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>

</dependency>
<dependency>
<groupId>org.springframework.ws</groupId>
<artifactId>spring-ws-security</artifactId>

</dependency>


</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>

<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.10</version>
<configuration>
<useFile>false</useFile>
</configuration>
</plugin>

<!-- maven-jaxb2-plugin -->

<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<version>0.14.0</version>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>

<configuration>

<packageName>VoLTE.client.test</packageName>
<wsdl>true</wsdl>
<xmlschema>false</xmlschema>
<schemaFiles>AdmMediation_testt_11.wsdl</schemaFiles>
<schemaDirectory>src/main/resources/static</schemaDirectory>
<outputDirectory>${project.basedir}/src/main/java</outputDirectory>
<clearOutputDir>true</clearOutputDir>
</configuration>
</plugin>


</plugins>
</build>

</project>


Description:

An attempt was made to call a method that does not exist. The attempt was made from the following location:

   org.springframework.boot.autoconfigure.http.HttpMessageConverters.configurePartConverters(HttpMessageConverters.java:140)

The following method did not exist:

   org.springframework.http.converter.support.AllEncompassingFormHttpMessageConverter.getPartConverters()Ljava/util/List;

The method's class, org.springframework.http.converter.support.AllEncompassingFormHttpMessageConverter, is available from the following locations:

   jar:file:/C:/Users/miha_/.m2/repository/org/springframework/spring-web/5.2.1.RELEASE/spring-web-5.2.1.RELEASE.jar!/org/springframework/http/converter/support/AllEncompassingFormHttpMessageConverter.class

The class hierarchy was loaded from the following locations:

   org.springframework.http.converter.support.AllEncompassingFormHttpMessageConverter: file:/C:/Users/miha_/.m2/repository/org/springframework/spring-web/5.2.1.RELEASE/spring-web-5.2.1.RELEASE.jar
   org.springframework.http.converter.FormHttpMessageConverter: file:/C:/Users/miha_/.m2/repository/org/springframework/spring-web/5.2.1.RELEASE/spring-web-5.2.1.RELEASE.jar


Action:

Correct the classpath of your application so that it contains a single, compatible version of org.springframework.http.converter.support.AllEncompassingFormHttpMessageConverter



thank you
miha
2 years ago

Tim Moores wrote:

Wss4jSecurityInterceptor should be in spring-ws-security from what I see on www of maven.

What should be the issue that I am unable to import Wss4jSecurityInterceptor ?


What tells you that you are unable to do so? Post the exact error message.



in external librarias i do not see ws-security library and also when you type Wss4jSecurityInterceptor and try to import it you can not do it. you have only option to create new class "Wss4jSecurityInterceptor "
2 years ago
Hello

I have one issue which I have hard to resolve it.

So I need to have: Wss4jSecurityInterceptor. My POM looks like:

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web-services</artifactId>
</dependency>



<dependency>
<groupId>org.springframework.ws</groupId>
<artifactId>spring-ws-security</artifactId>
<version>3.0.10.RELEASE</version>

</dependency>






<!-- wss4j -->
<dependency>
<groupId>org.apache.wss4j</groupId>
<artifactId>wss4j</artifactId>
<version>2.2.4</version>

<type>pom</type>
</dependency>

<dependency>
<groupId>org.apache.santuario</groupId>
<artifactId>xmlsec</artifactId>
<version>2.1.4</version>
</dependency>


<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>5.2.1.RELEASE</version>
</dependency>

</dependencies>

Wss4jSecurityInterceptor should be in spring-ws-security from what I see on www of maven.

What should be the issue that I am unable to import Wss4jSecurityInterceptor ?


thank you
miha
2 years ago
hi

i need one info. I have maven project which I am starting in Intellij and it runs ok.
How can I run this project from command line? If I do "mvn spring:boot run" it download me everything and create again new clasess (wsdl links in pom file). I do not want that as wsdl files are not ok and I need evrytime to do some manually work on classes to get everything working.

I also tried to do "mvn package" to get jar files but this also generate new classes from wsdl files.


thank you
miha


3 years ago

Campbell Ritchie wrote:I think you are overloading the method in question; if you overrode it, it would have the same signature including the same parameters. You have different parameter types.




Hmm, but method calncePortingNotify has the same types defined as "public class CancelPortingNotify". Can you maybe show me how this would be right? tnx

3 years ago
Hello

so my error is:



which indicate that i did not implement or did not implement properly method cancelPortingNotify.

I would like to know what I am doing wrong:








My implementation:



thank you
3 years ago
Hello


this is my whole log from spring that I get. I do not know why i get this errors and how to fix them.
I have cloded this project as I need it for decrypting soap request. https://github.com/JuanMorenoDeveloper/ws-security-spring-boot-cxf


br
miha



3 years ago
my error is this:

org.apache.cxf.interceptor.Fault: Message part {http://www.w3.org/2001/04/xmlenc#}EncryptedData was not recognized. (Does it exist in service WSDL?)

Which is due to setting properties for decoding ecrypted data. My issue is that I am having problems how to do that with apache cxf (Timestamp and Signature works ok).

Here is my part of code:



So I define "loadDecryptionKeystore" in which I get keystore. But where do I define which certificate to take (with setEncryptionUser("xxx"); ?) and where password to access private key in certificate? Should I define also something else, how ?

ps.: this is configuration for server part when receiving request

thank you
3 years ago
Hello

can someone maybe know how to fix this or what is a solution for this issue?

Issue is this:
When the soap message is encrypted, the PayloadRootAnnotationMethodEndpointMapping is unable to map the soap message because The security interceptor did not have yet the time to decipher it. The solution is to replace @PayloadRoot with @SoapAction.

When a soap message is received, spring-ws calls first the PayloadRootAnnotationMethodEndpointMapping then SoapActionAnnotationMethodEndpointMapping.


My client can not add @SoapAction to the header for request so I have to somehow decrypt first this.


tnx
miha
3 years ago

Tim Moores wrote:Is there a problem with using the annotation?



Hello

yes, but the main issue is that @Endpoint is triggered before request is decrypted. So if you use @SoapAction then @Endpoint is found and request is decrypted. But what if I do not want to use @SoapAction annotaion as otherside does not use it?
3 years ago
Hello

in my case in spring decryption is not working without @SoapAction annotation. This is caused as @Endpoint is searched before body of request is decrypted. Is there any way so that on the client side costumers will not have to use @SoapAction option?

Exp:



thank you
miha
3 years ago

Himai Minh wrote:You may find this site helpful https://memorynotfound.com/spring-ws-intercept-request-response-soap-messages/
You may need new PayloadRootSmartSoapEndpointInterceptor(new GlobanEndpointInterceptor()).



Hi @Himai Minh i tried like this but not working in my case. Thing is that the request is send to @Endpoint before it is decrypted and checked with security Interecptor. Due to this it can not find @Endpoint. Why it does not reach interceptor i am just unable to figure it out

Can some please help me.
3 years ago

Himai Minh wrote:EndpointInterceptor is an interface with 4 methods definitions.
Your GlobanEndpointInterceptor only overrides 2 of them. So, you need to define the implementations of the other two methods.

Reference: https://docs.spring.io/spring-ws/docs/2.2.3.RELEASE/api/index.html?org/springframework/ws/server/EndpointInterceptor.html




@Himai Minh thank you. This was the case. But the main issue perssist. I do not know why EndpointInterceptor in not triggered when request is recevied.





interceptor class:



}


thank you
3 years ago
Hello

So i have created web services which is working ok and @Endpoint is detected when there is no ws-security enabled (Wss4jSecurityInterceptor). If I enable security   I get: No Endpoint found.

I guess the main issue here is that the @Endpoint is triggered before interceptor decodes request from client (I guess).

I am trying like this if interceptor will be triggered but i get different error which i am unable to fix:

Error:(10, 8) java: softnet.si.ldp.client.GlobanEndointInterceptor is not abstract and does not override abstract method afterCompletion(org.springframework.ws.context.MessageContext,java.lang.Object,java.lang.Exception) in org.springframework.ws.server.EndpointInterceptor



import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.stereotype.Component;
import org.springframework.ws.context.MessageContext;
import org.springframework.ws.server.EndpointInterceptor;




My interceptors:
 

thank you for all help!



3 years ago