# java.lang.reflect error

**URL:** <https://community.wowza.com/t/java-lang-reflect-error/43912>\
**Category:** Wowza Developer Dojo\
**Tags:** wowza-streaming-server-java-api\
**Created:** [September 25, 2014, 10:02am UTC](https://community.wowza.com/t/java-lang-reflect-error/43912 "2014-09-25T10:02:53Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jim\_Houseman](https://avatars.discourse-cdn.com/v4/letter/j/cc9497/32.png) [@Jim\_Houseman](https://community.wowza.com/u/Jim_Houseman)\
**Post date:** [September 25, 2014, 10:02am UTC](https://community.wowza.com/t/java-lang-reflect-error/43912/1 "2014-09-25T10:02:53Z")

</div>

I’m using Wowza Streaming Engine 4.1.0

Windows 8

Java SE Runtime Environment (build 1.7.0\_67-b01)

My debug configuration VM argument already has “-Dcom.wowza.wms.native.base=“win”” in it.

But I’m getting this error.

```auto
 java.lang.reflect.InvocationTargetException|at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)|at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)|at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)|at java.lang.reflect.Method.invoke(Method.java:606)|at com.wowza.wms.module.ModuleFunction.invoke(ModuleFunction.java:369)|

```

All research on this error points to having that argument in your list.

---

<div class="post-metadata">

**Author:** ![Jim\_Houseman](https://avatars.discourse-cdn.com/v4/letter/j/cc9497/32.png) [@Jim\_Houseman](https://community.wowza.com/u/Jim_Houseman)\
**Post date:** [September 25, 2014, 10:14am UTC](https://community.wowza.com/t/java-lang-reflect-error/43912/2 "2014-09-25T10:14:43Z")

</div>

It seems that this chunk of code:

```auto
s3 = new AmazonS3Client();
		s3.setEndpoint(region);
		s3.putObject(videoBucket,params.getString(4)+".flv",new File(dir+params.getString(4)+".flv"));

```

Is causing the problem. If I comment it out, I don’t get this error.

---

<div class="post-metadata">

**Author:** ![Eva\_Smith](https://avatars.discourse-cdn.com/v4/letter/e/4bbf92/32.png) [@Eva\_Smith](https://community.wowza.com/u/Eva_Smith)\
**Post date:** [October 7, 2014, 8:29am UTC](https://community.wowza.com/t/java-lang-reflect-error/43912/3 "2014-10-07T08:29:40Z")

</div>

Using AWS SDK 1.4.7 jar and the apache commons codec v1.9 fixed the problem for me

> [@java.lang.reflect error](http://community.wowza.com/t/-/43912):
>
> I’m using Wowza Streaming Engine 4.1.0 Windows 8 Java SE Runtime Environment (build 1.7.0\_67-b01) My debug configuration VM argument already has “-Dcom.wowza.wms.native.base=“win”” in it. But I’m getting this error. java.lang.reflect.InvocationTargetException|at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)|at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)|at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)|a…

I had this error again when I installed Wowza on the server available here. I replaced the v1.9 commons codec with the 1.3 commons codec, and it fixed it.

Windows 8 needs AWS SDK 1.4.7 and commons codec 1.9

Amazon Linux 2013.09.2 needs AWS SDK 1.4.7 and commons codec 1.3

For Web Apps in different platforms visit [http://www.ati-erp.com](http://www.ati-erp.com)

---

<div class="post-metadata">

**Author:** ![Matt\_Young](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/matt_young/32/389_2.png) [@Matt\_Young](https://community.wowza.com/u/Matt_Young)\
**Post date:** [September 25, 2014, 8:02pm UTC](https://community.wowza.com/t/java-lang-reflect-error/43912/4 "2014-09-25T20:02:36Z")

</div>

Hello

Try using AWS SDK 1.4.7 (or earlier) in conjunction with the [apache commons codec](http://commons.apache.org/proper/commons-codec/)(v1.9). This should resolve the current conflict.

Thanks,

Matt

---

<div class="post-metadata">

**Author:** ![Matt\_Young](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/matt_young/32/389_2.png) [@Matt\_Young](https://community.wowza.com/u/Matt_Young)\
**Post date:** [October 2, 2014, 1:55pm UTC](https://community.wowza.com/t/java-lang-reflect-error/43912/5 "2014-10-02T13:55:23Z")

</div>

Please refer to ticket #104379.

Thanks,

Matt

---

<div class="post-metadata">

**Author:** ![Jim\_Houseman](https://avatars.discourse-cdn.com/v4/letter/j/cc9497/32.png) [@Jim\_Houseman](https://community.wowza.com/u/Jim_Houseman)\
**Post date:** [September 25, 2014, 10:35am UTC](https://community.wowza.com/t/java-lang-reflect-error/43912/6 "2014-09-25T10:35:29Z")

</div>

This seems to be related, but I can find no solutions here:

> [@AWS SDK S3 client InvocationTargetException](http://community.wowza.com/t/-/43027):
>
> I have a plugin which is being activated correctly, but I’m having issues implementing the AWS SDK to upload the file to S3, I’m pretty new to Java so I’m not really sure what this error could be an indication of, as far as I can tell my code is all correct… The exact error java.lang.reflect.InvocationTargetException|at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)|at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)|at sun.reflect.DelegatingMethodAcce…

I seem to have the same problem the TC is having here.

---

<div class="post-metadata">

**Author:** ![Jim\_Houseman](https://avatars.discourse-cdn.com/v4/letter/j/cc9497/32.png) [@Jim\_Houseman](https://community.wowza.com/u/Jim_Houseman)\
**Post date:** [September 25, 2014, 1:24pm UTC](https://community.wowza.com/t/java-lang-reflect-error/43912/7 "2014-09-25T13:24:25Z")

</div>

I initially installed the AWS SDK using the method described in the second post of this thread:

[https://forums.aws.amazon.com/message.jspa?messageID=550016#550016](https://forums.aws.amazon.com/message.jspa?messageID=550016#550016)

---

<div class="post-metadata">

**Author:** ![Jim\_Houseman](https://avatars.discourse-cdn.com/v4/letter/j/cc9497/32.png) [@Jim\_Houseman](https://community.wowza.com/u/Jim_Houseman)\
**Post date:** [September 25, 2014, 3:00pm UTC](https://community.wowza.com/t/java-lang-reflect-error/43912/8 "2014-09-25T15:00:33Z")

</div>

I went and installed the AWS SDK the correct way, but it didn’t help.

---

<div class="post-metadata">

**Author:** ![Jim\_Houseman](https://avatars.discourse-cdn.com/v4/letter/j/cc9497/32.png) [@Jim\_Houseman](https://community.wowza.com/u/Jim_Houseman)\
**Post date:** [September 26, 2014, 8:45am UTC](https://community.wowza.com/t/java-lang-reflect-error/43912/9 "2014-09-26T08:45:06Z")

</div>

This fixed the issue.

Thanks

---

<div class="post-metadata">

**Author:** ![Jim\_Houseman](https://avatars.discourse-cdn.com/v4/letter/j/cc9497/32.png) [@Jim\_Houseman](https://community.wowza.com/u/Jim_Houseman)\
**Post date:** [October 2, 2014, 9:07am UTC](https://community.wowza.com/t/java-lang-reflect-error/43912/10 "2014-10-02T09:07:11Z")

</div>

Now I’m getting this issue again, but this time, on a server environment, not in a development environment

I’m running the streaming engine with startup.sh and I’m doing this:

```auto
PutObjectRequest p = new PutObjectRequest(videoBucket,flvName, new File(dir+flvName));
p.setRequestCredentials(getCredentials());
p.setCannedAcl(CannedAccessControlList.BucketOwnerFullControl);
			
getLogger().info("attempting to upload " + flvName + " to " + videoBucket);
s3.putObject(p);

```

It crashes at that last line with a similar error:

```auto
ERROR server comment - invoke(doSave): java.lang.reflect.InvocationTargetException|at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)|at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)|at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)|at java.lang.reflect.Method.invoke(Method.java:606)|at com.wowza.wms.module.ModuleFunction.invoke(ModuleFunction.java:293)|

```

This code:

```auto
 s3 = new AmazonS3Client()

```

runs successfully inside of the onAppStart method, so I can at least initialize the object.

In case this is an issue with the libraries that I have, here are all of the files in the lib directory. Note that the aws sdk 1.4.7 and the commons codec 1.9 are there.

```auto
aws-java-sdk-1.4.7.jar wms-drm.jar wms-plugin-bwcheck.jar
bcprov-jdk15on-149.jar wms-dvr.jar wms-plugin-loadbalancer.jar
commons-codec-1.9.jar wms-httpstreamer-cupertinostreaming.jar wms-plugin-streamnamealias.jar
commons-lang-2.6.jar wms-httpstreamer-directstreaming.jar wms-pushpublish.jar
jackson-annotations-2.1.1.jar wms-httpstreamer-mpegdashstreaming.jar wms-release-tools.jar
jackson-core-2.1.1.jar wms-httpstreamer-sanjosestreaming.jar wms-rest.jar
jackson-databind-2.1.1.jar wms-httpstreamer-smoothstreaming.jar wms-restlet-2.1.6.jar
jid3lib-0.5.4.jar wms-jax.validation.jar wms-restlet-2.1.6.org.restlet.ext.simple.jar
joda-time-2.3.jar wms-jlayer.jar wms-server.jar
log4j-1.2.17.jar wms-license-rest.jar wms-stats.jar
Recorder modules.jar wms-mediacache.jar wms-stream-file.jar
slf4j-api-1.6.4.jar wms-mediareader-flv.jar wms-stream-live.jar
slf4j-log4j12-1.6.4.jar wms-mediareader-h264.jar wms-stream-publish.jar
wms-amazonutil.jar wms-mediareader-mp3.jar wms-stream-record.jar
wms-ant.jar wms-mediareader-smil.jar wms-stream-rtp.jar
wms-bootstrap.jar wms-mediawriter-flv.jar wms-stream-shoutcast.jar
wms-commons-modeler.jar wms-mediawriter-h264.jar wms-transcoder.jar
wms-core.jar wms-plugin-amazonaws.jar wms-xstream-1.4.7.jar

```

---

<div class="post-metadata">

**Author:** ![Jim\_Houseman](https://avatars.discourse-cdn.com/v4/letter/j/cc9497/32.png) [@Jim\_Houseman](https://community.wowza.com/u/Jim_Houseman)\
**Post date:** [October 2, 2014, 12:04pm UTC](https://community.wowza.com/t/java-lang-reflect-error/43912/11 "2014-10-02T12:04:08Z")

</div>

This topic contains the entire history of ticket #104379 doesn’t it?

Beyond that, I don’t have access for your ticketing software, I don’t think.

If you’re saying “read this topic again”, I’ve posted my “lib” directory and you can see that I’m using the AWS SDK version and commons-codec that you suggested.

---

<div class="post-metadata">

**Author:** ![Jim\_Houseman](https://avatars.discourse-cdn.com/v4/letter/j/cc9497/32.png) [@Jim\_Houseman](https://community.wowza.com/u/Jim_Houseman)\
**Post date:** [October 3, 2014, 12:16pm UTC](https://community.wowza.com/t/java-lang-reflect-error/43912/12 "2014-10-03T12:16:40Z")

</div>

I fixed this by replacing “commons-codec-1.9.jar” with “commons-codec-1.3.jar”

---

<div class="post-metadata">

**Author:** ![Ali\_Azimi](https://avatars.discourse-cdn.com/v4/letter/a/b77776/32.png) [@Ali\_Azimi](https://community.wowza.com/u/Ali_Azimi)\
**Post date:** [March 6, 2015, 5:31pm UTC](https://community.wowza.com/t/java-lang-reflect-error/43912/13 "2015-03-06T17:31:05Z")

</div>

I’m having the same problem, the only difference is that I’m calling my own web-service, and the app get’s stuck and doing nothing once reaches the line I’m instantiating the class

Please help!

---

<div class="post-metadata">

**Author:** ![Jack\_Beoris](https://avatars.discourse-cdn.com/v4/letter/j/7ab992/32.png) [@Jack\_Beoris](https://community.wowza.com/u/Jack_Beoris)\
**Post date:** [August 20, 2015, 4:57pm UTC](https://community.wowza.com/t/java-lang-reflect-error/43912/14 "2015-08-20T16:57:56Z")

</div>

> I’m having the same problem, the only difference is that I’m calling my own web-service, and the app get’s stuck and doing nothing once reaches the line I’m instantiating the class
> 
> Please help!

Did you ever find and issue to this problem. I am running into the same issue as you.
