I am trying to integrate Paytm with my SpringBoot project. But I am not getting a proper jar for the Paytm CheckSumServiceHelper class. I have tried to integrate the MAVEN dependency
<!-- https://mvnrepository.com/artifact/com.paytm/pgplussdk -->
<dependency>
<groupId>com.paytm</groupId>
<artifactId>pgplussdk</artifactId>
<version>1.3.3</version>
</dependency>
but I'm getting Missing artifact com.paytm:pgplussdk:jar:1.3.3 in pom.xml
I have checked multiple links, the package looks like "com.paytm.pg.merchant", but I'm not getting the accurate jar.
Here is the PaytmCheckSum.jar Paytm_JAVA_Checksum .
But the class name is changed from CheckSumServiceHelper to PaytmChecksum
Eg.
PaytmChecksum.generateSignature(parameters, paytmDetails.getMerchantKey());
PaytmChecksum.verifySignature(parameters,paytmDetails.getMerchantKey(),paytmChecksum);
Related
I have a simple maven project to do some SIF calls with MDM hub, and adding castor dependencies for this.
Maven dependency added:
org.codehaus.castor
castor-xml
1.4.1
This downloaded the castor-xml-1.4.1.jar file.
Right at the line calling sipClient.process(req) below exception is thrown
Exception in thread "main" java.lang.NoSuchMethodError: org.exolab.castor.xml.Marshaller.getResolver()Lorg/exolab/castor/xml/ClassDescriptorResolver;
at com.siperian.sif.message.CastorUtil.setMappingLoader(CastorUtil.java:470)
at com.siperian.sif.message.CastorUtil.beanToXmlString(CastorUtil.java:358)
at com.siperian.sif.message.CastorUtil.beanToXmlString(CastorUtil.java:323)
at com.siperian.sif.message.CastorUtil.beanToXmlString(CastorUtil.java:309)
at com.siperian.sif.message.CastorUtil.beanToXmlString(CastorUtil.java:295)
at com.siperian.sif.client.HttpSiperianClient._process(HttpSiperianClient.java:117)
at com.siperian.sif.client.SiperianClient.process(SiperianClient.java:179)
I can see the getResolver method and classDescriptorResolver in the jar file in Java Decompiler, Images
classResolverDescriptor
getResolver method
Same exception even for 1.3.2 dependency.
Should I download any extra dependencies.
Thanks
This specific error for 2 reasons:
1- You are missing the jar file that has this method (This might not be the issue you have, as you stated you can see it when looking at the decompiled jar)
2- You have 2 or more jars in your dependencies, and it is actually looking at the jar which does not have the method you need.
How you should approach this is as follows:
Go to your ide, and open your pom.xml file
Open the Dependency Heirarchy view and search for org.codehaus.castor or castor-xml and see how many different versions you have.
If you have more than 1, and some are included as part of another jar, you can use in your pom.xml to remove the versions which you dont want.
If you like command line you can probably do the above, using mvn dependency:tree
Hope this helps you in some way.
-- Edited --
Your code is using 1.3.2 dependency. How? You can download the castor-xml.1.3.2.jar and extract it and look into the Marshaller. You will see the method getResolver() does not take any parameters, and therefore you get NoMethodFound.
´´´
/**
* Returns the ClassDescriptorResolver for use during marshalling
*
* #return the ClassDescriptorResolver
* #see #setResolver
*/
public XMLClassDescriptorResolver getResolver() {
}
´´´
Therefore you need to find out in your dependency hierarchy, will one includes this 1.3.2 jar and exclude this jar from it.
An example of how to do exclude is in pom.xml:
<dependency>
<groupId>sample.group.which.has.castor.in.it</groupId>
<artifactId>artifactor.which.has.castor.in.it</artifactId>
<version>1.0</version>
<scope>compile</scope>
<exclusions>
<exclusion> <!-- declare the exclusion here -->
<groupId>org.codehaus.castor</groupId>
<artifactId>castor-xml</artifactId>
<version>1.3.2</version>
</exclusion>
</exclusions>
</dependency>
<dependency> <!-- add proper dependency also, as it is needed -->
<groupId>org.codehaus.castor</groupId>
<artifactId>castor-xml</artifactId>
<version>1.4.1</version>
</dependency>
I am having trouble with mockito dependencies.I wrote a sample test and when I ran it I got this exception
java.lang.NoClassDefFoundError: javassist/NotFoundException
at org.powermock.core.transformers.TestClassTransformerBuilder$RemovesTestMethodAnnotation.fromMethods(TestClassTransformerBuilder.java:62)
at org.powermock.tests.utils.impl.AbstractCommonTestSuiteChunkerImpl.createDefaultMockLoader(AbstractCommonTestSuiteChunkerImpl.java:126)
....
the full Exception can be viewed at : https://pastebin.com/xWqUX0Wc
and the
test code - https://pastebin.com/pbWLc27B
My dependencies are the following:
mockito-all-1.9.5.jar
powermock-api-mockito-1.6.3.jar
powermock-api-support-1.4.9.jar
powermock-core-2.0.4.jar
powermock-module-junit-1.7.4.jar
powermock-module-junit-common-1.7.4.jar
powermock-reflect-2.0.4.jar
powermock-test-utils-1.5.3.jar
Where can be the problem?I guess something is wrong with the version of the jars.What version of the jars would you suggest to use ?
Your are missing JavaAssist jar download below jars and add them into your projects or add them in maven pom.xml file.
<javaassist.version>3.20.0-GA</javaassist.version>
<dependency>
<groupId>org.javassist</groupId>
<artifactId>javassist</artifactId>
<version>${javaassist.version}</version>
<scope>compile</scope>
</dependency>
I wanted to follow this answer from SO and tried to add the following code:
public class CustomJdbcUserDetailsService extends JdbcDaoImpl {
#Override
public List<GrantedAuthority> loadUserAuthorities(String username) {
return super.loadUserAuthorities(username);
}
}
in my Spring-Boot Project. Sadly I get the output:
The type org.springframework.jdbc.core.support.JdbcDaoSupport cannot be resolved. It is indirectly referenced from required .class files
So on research I tried to add some new dependencies (like suggested here)
e.g.:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
</dependency>
but it does not help. I tried to refresh (clean) the project but nothing changed. Can someone relate to this issue? I am using Spring Tool Suite btw.
Since you are using SpringBoot ,you can simply add the JDBC starter to your pom.xml in order to have JDBC support.
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
It will transitively give you spring-jdbc , spring-tx and HikariCP
You also need to include the JDBC driver in your pom.xml depending on what DB you are using.
Also remember to configure the DB access info in your application.properties , for example in case of Postgresql:
spring.datasource.url=jdbc:postgresql://127.0.0.1:5432/
spring.datasource.username=admin
spring.datasource.password=password
spring.datasource.driver-class-name=org.postgresql.Driver
You can try below steps in order:
Add spring-jdbc dependency
Do maven force update
Delete .m2/repository folder and then do maven update as this can also happen due to corrupted local maven repository
I'm new to Maven and the AWS SDK. So I installed both and updated my Java SDK. Double checked all required path and classpath settings.
The AWS Polly manual (page 119 in the pdf) presents a demo code example, to test Polly.
Being in this for the very first time, I tried this example (pom.xml and PollyDemo.java). Calling Maven as written in the manual, I receive the ClassNotFoundException for PollyDemo (classpath to com.amazonaws.demos.polly package has been set).
With over 10 years Java experience I feel like a newbie.
Please help
you need to add aws-java-sdk-polly dependency into your pom.xml
file and update the project, you can find dependency below:
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-polly</artifactId>
<version>1.11.77</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.googlecode.soundlibs/jlayer -->
<dependency>
<groupId>com.googlecode.soundlibs</groupId>
<artifactId>jlayer</artifactId>
<version>1.0.1-1</version>
</dependency>
for more you can refer below link :
http://docs.aws.amazon.com/de_de/polly/latest/dg/examples-java.html
http://docs.aws.amazon.com/polly/latest/dg/examples-java.html
The example can be run if: AWS credentials are created and setted (1), a new project is started by creating an empty directory (e.g. 'my-app'),
opening a shell in 'my-app' and running the command 'mvn archetype:generate -DgroupId=com.amazonaws.demos.polly -DartifactId=polly-java-demo -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false' (2), and finally replace both the existing 'pom.xml' and hello world java file with the ones in the example (3).
I have add a dependency in pom.xml, like:
<dependency>
<groupId>org.opendaylight.controller</groupId>
<artifactId>features-restconf</artifactId>
<version>1.2.1-Lithium-SR1</version>
<classifier>features</classifier>
<type>xml</type>
<scope>runtime</scope>
</dependency>
This dependency is an xml file, it is something like: (for simplicity)
<feature name ='odl-mdsal-apidocs' version='1.2.1-Lithium-SR1' description="OpenDaylight :: MDSAL :: APIDOCS">
<feature version='1.2.1-Lithium-SR1'>odl-restconf</feature>
<bundle>mvn:org.opendaylight.controller/sal-rest-docgen/1.2.1-Lithium-SR1</bundle>
<bundle>mvn:com.fasterxml.jackson.core/jackson-annotations/2.3.2</bundle>
<bundle>mvn:com.fasterxml.jackson.core/jackson-core/2.3.2</bundle>
<bundle>mvn:com.fasterxml.jackson.core/jackson-databind/2.3.2</bundle>
<bundle>mvn:com.fasterxml.jackson.datatype/jackson-datatype-json-org/2.3.2</bundle>
<bundle>mvn:com.fasterxml.jackson.module/jackson-module-jaxb-annotations/2.3.2</bundle>
<bundle>mvn:com.fasterxml.jackson.jaxrs/jackson-jaxrs-base/2.3.2</bundle>
</feature>
I found that all dependencies as described as < bundle > in xml file will be downloaded into local repository. So I think it is another way to do with project dependency. But I can not find any information about this usage of dependency in pom.xml.
Where can I find materials about this part of Maven? Is there any document or tutorial?
It seems that the bundle functionality has been depreciated. That's probably why you can't find much information on it. Another post shows the information about it being deprecated along with an alternative way of doing bundles. See the link below.
Why (and in favor of what) are maven-bundle-plugin's wrap/bundleall goals deprecated?
Hope this helps