I want to run a customer script which inturn runs multiple python files from my java programs. the script runs fine when in run the jar manually from the terminal using java -jar jarfilename.jar but fails when i run the same jar as service in background.
I'm getting the following error in my debug log
Site:16 RESULT:False:Vmin test completed with no report! Something went wrong.#_#
Site:9 Traceback (most recent call last):
Site:9 File "pexpect/spawnbase.py", line 166, in read_nonblocking
Site:9 OSError: [Errno 5] Input/output error
Site:9
Site:9 During handling of the above exception, another exception occurred:
Site:9
Site:9 Traceback (most recent call last):
Site:9 File "pexpect/expect.py", line 111, in expect_loop
Site:9 File "pexpect/pty_spawn.py", line 485, in read_nonblocking
Site:9 File "pexpect/spawnbase.py", line 171, in read_nonblocking
Site:9 pexpect.exceptions.EOF: End Of File (EOF). Exception style platform.
Site:9
Site:9 During handling of the above exception, another exception occurred:
Site:9
Site:9 Traceback (most recent call last):`
The above error shows OSError: [Errno 5] Input/output error which from this link linki found it might be due to the print stattement in py file but unfortunately i don't have access to any customer file how can we handle it from java side or any thing when writing a service might fix it?
I'm totally new to AWS and to lambda functions. Currently, I try to start my first "Hello world" program, using IntelliJ and Java. I programmed a Lambda Function in Java using AWS. I want to start it locally with the SAM CLI Builder inside a Maven Container (because I don't have Docker).
After solving some other errors I get this one after hitting start:
SAM Build finished exceptionally: Command did not exist successfully, exit code: 1
Earlier I got a warning, that something is wrong with UTF8 so the code would be somehow platform-dependent, but I have 0 clue honestly.
Java SDK Version
15.0.2
SAM Version
1.18.1
Apache Maven Version
3.6.3
And here is a traceback of the full process:
Traceback (most recent call last):
File "runpy.py", line 194, in _run_module_as_main
File "runpy.py", line 87, in _run_code
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\samcli\__main__.py", line 12, in <module>
cli(prog_name="sam")
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\click\core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\click\core.py", line 782, in main
rv = self.invoke(ctx)
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\click\core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\click\core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\click\core.py", line 610, in invoke
return callback(*args, **kwargs)
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\click\decorators.py", line 73, in new_func
return ctx.invoke(f, obj, *args, **kwargs)
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\click\core.py", line 610, in invoke
return callback(*args, **kwargs)
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\samcli\lib\telemetry\metric.py", line 152, in wrapped
raise exception # pylint: disable=raising-bad-type
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\samcli\lib\telemetry\metric.py", line 121, in wrapped
return_value = func(*args, **kwargs)
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\samcli\lib\utils\version_checker.py", line 42, in wrapped
actual_result = func(*args, **kwargs)
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\samcli\commands\build\command.py", line 160, in cli
do_cli(
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\samcli\commands\build\command.py", line 250, in do_cli
artifacts = builder.build()
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\samcli\lib\build\app_builder.py", line 160, in build
return build_strategy.build()
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\samcli\lib\build\build_strategy.py", line 41, in build
result.update(self._build_functions(self._build_graph))
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\samcli\lib\build\build_strategy.py", line 52, in _build_functions
function_build_results.update(self.build_single_function_definition(build_definition))
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\samcli\lib\build\build_strategy.py", line 116, in build_single_function_definition
result = self._build_function(
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\samcli\lib\build\app_builder.py", line 437, in _build_function
return build_method(config, code_dir, artifacts_dir, scratch_dir, manifest_path, runtime, options)
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\samcli\lib\build\app_builder.py", line 486, in _build_function_in_process
builder.build(
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\aws_lambda_builders\builder.py", line 125, in build
return workflow.run()
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\aws_lambda_builders\workflow.py", line 58, in wrapper
valid_path = binary_checker.validator.validate(executable_path)
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\aws_lambda_builders\workflows\java_maven\maven_validator.py", line 33, in validate
jvm_mv = self._get_major_version(maven_path)
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\aws_lambda_builders\workflows\java_maven\maven_validator.py", line 51, in _get_major_version
vs = self._get_jvm_string(maven_path)
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\aws_lambda_builders\workflows\java_maven\maven_validator.py", line 69, in _get_jvm_string
l_dec = l.decode()
**UnicodeDecodeError: 'utf-8' codec can't decode byte 0xfc in position 25: invalid start byte
SAM Build finished exceptionally: Command did not exist successfully, exit code: 1**
You can write Lambda functions using the Java runtime API and IntelliJ. You can build a JAR file and deploy the Lambda function by using the Lambda console. Once you deploy the Lambda function, you can test it from the Lambda console.
You can log messages to Cloud Watch logs. Using the Lambda java runtime API in the IntelliJ IDE, you will avoid these exceptions. You will code your logic and deploy the JAR file, and it works.
In addition, you can easily use additional AWS Java APIs to invoke AWS services from the Lambda function.
To see a step by step AWS dev article that creates a Lambda function using the Lambda runtime API, see:
Creating scheduled events to invoke Lambda functions
I am trying to make a Bluetooth app with Kivy so I need to use java classes, I get this error message when I use Pyjnius
Traceback (most recent call last):
File "C:\Users\Omer Akbas\Desktop\My Apps (Kivy)\First\main.py", line 3, in
<module>
BluetoothAdapter = autoclass('android.bluetooth.BluetoothAdapter')
File "C:\Python27\lib\site-packages\jnius\reflect.py", line 158, in
autoclass
c = find_javaclass(clsname)
File "jnius\jnius_export_func.pxi", line 25, in jnius.find_javaclass
JavaException: Class not found 'android/bluetooth/BluetoothAdapter'
If you're building a Kivy app, pyjnius is installed in the APK automatically as a dependency of Kivy, so you don't have to do anything special beyond the normal Programming Guide » Create a package for Android documentation.
I am trying to use python's charting library from my java project using jython. In my script I use module cairo.
pythonInterpreter.exec("import sys");
pythonInterpreter.exec("import cairo");
Exception throws on the second line, because cairo's init.py contains string:
from _cairo import *
The exception I get is:
Caused by: Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python2.7/dist-packages/cairo/__init__.py", line 1, in <module>
from _cairo import *
ImportError: No module named _cairo
Also, I can use my script from console, so I doubt that it has an error in it. I suppose something is wrong with the way I'm importing cairo in Java.
I got it now. Jython can't execute 'native' libraries, such as cairo (I'm, sure it's native, because _cairo is a .so file, which means it's a C lib)
I am trying to make use of apache lucene in jython27. To do so, I set the CLASSPATH:
% echo $CLASSPATH
/opt/lucene-4.5.0/core/lucene-core-4.5.0.jar:/opt/lucene-4.5.0/queryparser/lucene-queryparser-4.5.0.jar:analysis/common/lucene-analyzers-common-4.5.0.jar:/opt/lucene-4.5.0/demo/lucene-demo-4.5.0.jar
I found some examples that I tried to follow. However, it failed to import the standard module to get the StandardAnalyzer().
>>> from org.apache.lucene import analysis
>>> dir(analysis)
['Analyzer', 'AnalyzerWrapper', 'CachingTokenFilter', 'CharFilter', 'NumericTokenStream', 'Token', 'TokenFilter', 'TokenStream', 'TokenStreamToAutomaton', 'Tokenizer', '__name__', 'tokenattributes']
>>> from org.apache.lucene.analysis import standard
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: cannot import name standard
Has someone an idea what went wrong?
Ah damn.. I set the CLASSPATH wrong. This works:
% export CLASSPATH=$CLASSPATH:/opt/lucene-4.5.0/analysis/common/lucene-analyzers-common-4.5.0.jar