Mule ESB Bean property 'enableNotifications' is not writable - properties

I am working with Mule ESB 3.8.2 and I am receiving this error where I am compliling outside of Anypoint Studio.
Bean property 'enableNotifications' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
Someone has a suggest what could be?

After some hours working on this issue I found the solution.
The file pom.xml we must have on plugin
<inclusion>
<groupId>org.mule.modules</groupId>
<artifactId>mule-module-apikit</artifactId>
</inclusion>
and the dependencies must be the version of mule that we're working on it.
<dependency>
<groupId>org.mule.modules</groupId>
<artifactId>mule-module-apikit</artifactId>`enter code here`
<version>${mule.version}</version>
</dependency>
I hope this could be helpfull for someone.

Related

How to use Bean Validation in a Helidon App?

I'm trying to create a simple Rest Resource using Helidon-MP but for some reason it doesn't work when I add the bean validation annotations on my method.
#POST
public Response generatePlan(#Valid #ValidPlan JsonObject payload) {
// some logic here
}
Is this the expected behavior? Or Should I add some dependency or configuration?
I tried to find something on the documentation, but I couldn't.
Thanks
I ended up doing as #LairdNelson answered and added the following dependencies in my pom.xml:
<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
<version>6.1.5.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator-cdi</artifactId>
<version>6.1.5.Final</version>
</dependency>
<dependency>
<groupId>jakarta.el</groupId>
<artifactId>jakarta.el-api</artifactId>
</dependency>
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>jakarta.el</artifactId>
</dependency>
Bean validation is not part of the MicroProfile set of specifications, so by default it is not part of Helidon MP, which is a MicroProfile implementation.
You may of course add an implementation of Bean Validation on your compile or runtime classpath provided it is a CDI portable extension (which is how you add arbitrary capabilities to any MicroProfile-compliant implementation). One such portable extension is the Hibernate Validator-backed one. There may certainly be others.

Weblogic 12.2.1.2.0 javax.interceptors issue

In weblogic 12.1.x usage of #Interceptors(SpringBeanAutowiringInterceptor.class) worked fine since javax.interceptor.Interceptors was part of wlfullclient.jar.
But in weblogic 12.2.1.2.0 it is an issue as wlfullcient.jar is deprecated. I do not find javax.interceptor.Interceptors in wlthint3client.jar. How to use interceptors at the EJB level in weblogic 12.2.1.2? Is there an alternative to #interceptors in weblogic 12.2.1.2.0?
Any help is appreciated.
Thanks in advance.
javax.interceptor.Interceptors is part of JavaEE since JavaEE 5. Add the missing dependency to your project.
eg. with maven and JavaEE7
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<scope>provided</scope>
<version>7.0</version>
</dependency>

Unable to upload file to S3 Bucket using aws-java-sdk

I have a spring boot application which uploads files to S3 bucket.
I am receiving the following error whenever the application tries to upload a file. The stack trace is a huge one. So I am providing only a part of it.
java.lang.IllegalStateException: Socket not created by this factory
at org.apache.http.util.Asserts.check(Asserts.java:34) ~[httpcore-4.4.6.jar:4.4.6]
at org.apache.http.conn.ssl.SSLSocketFactory.isSecure(SSLSocketFactory.java:435) ~[httpclient-4.5.3.jar:4.5.3]
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:186) ~[httpclient-4.5.3.jar:4.5.3]
I am using the following dependency
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk</artifactId>
<version>1.11.123</version>
</dependency>
I have even tried with
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.1.RELEASE</version>
</parent>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-aws</artifactId>
</dependency>
<!--<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-aws-context</artifactId>
</dependency>
But sill getting the same type of error
I have tried using both TransferManager as well as putObject() method from AmazonS3 but with same error.
The application was running well a few days back and the error has started to come only very recently.
I had the same issue on v1.10.12 of the SDK, I switched to v1.11.136 and that resolved my issue, add the code below, to your pom file
<!-- AWS S3 Dependencies-->
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk</artifactId>
<version>1.11.136</version>
</dependency>
<!-- End of AWS S3 Dependencies -->
It would be useful to post more of the stack-trace so we can see at what point in the SDK lifecycle the exception is being generated (the stack-trace above only shows the apache classes). Can you also show how you're configuring the S3 client?
Are you configuring a custom SocketFactory? The check in question is looking to see if the Socket that the SocketFactory created is in fact an SSLSocket if not - that's where it bombs - you can see that from the Apache code here.

Resolving depending war file with shrinkwrap maven resolver

I'm working on setup of arquillian testing. I want to deploy a WAR to JBoss using arquillian. This war is defined as a dependency in my pom.xml:
<dependency>
<groupId>my.project</groupId>
<artifactId>mywar</artifactId>
<version>1.0</version>
<type>war</type>
<scope>runtime</scope>
</dependency>
But when I try to resove this dependency using shrinkwrap, it throws a NoResolvedResultException:
PomEquippedResolveStage resolver = Maven.configureResolver().workOffline().loadPomFromFile("pom.xml");
File war = resolver.resolve("my.project:mywar:war").withoutTransitivity().asSingleFile();
It seems that somehow the resolver isn't able to deal with war files. I experminted with org.jboss.shrinkwrap.resolver.api.ResolveWithRangeSupportStage.resolveVersionRange(String) as well and it seems to interpret the ":war" in the coordinates as the version - which obviously won't work.
If I supply the version, it works:
Maven.resolver().resolve("my.project:mywar:war:1.0").withoutTransitivity().asSingleFile();
But I need to make it work without the version because this will change by the time and I don't want to adapt the version on each release.
Any ideas?
Since your artifact is not JAR, I think you have to add a question mark. Your resolver should look like: .resolve("my.project:mywar:war:?")

Apache Common IO FileUtils Issue

I am trying to use the FileUtils.writeStringToFile() method of the Apache Commons IO. Every bit of documentation says that I can do this:
FileUtils.writeStringToFile(File, String with data, boolean append);
I want this method, because I want the data to be written to the end of the file each time.
However, in Eclipse, it keeps telling me that this method does not exist. The only two I have are:
FileUtils.writeStringToFile(File, String with data);
FileUtils.writeStringToFile(File, String with data, String encoding);
I corrected my POM file to now have this dependency:
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.4</version>
</dependency>
Can someone please tell me what I am doing wrong?
Version 1.3.2 doesn't have this method, use a newer version of commons-io
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.4</version>
</dependency>
Check the FileUtils 2.4 javadoc
Turns out I was adding the Tomcat library files as well as the JRE library files to my project. Because when I deleted commons-io from my POM, I still had FileUtils available.
I had to get rid of the Tomcat library files from my build path, and once I put commons-io back in, it worked.