552 5.3.4 Error: message file too big - java

I have created a .bat file i.e. launchMonthlyreport.bat to launch monthly report (2 excel files) email sending using JavaMail in my application.
launchMonthlyreport.bat
java -Xms128m -Xmx256m -Dlog4j.configuration="..\\conf\\log4j_batch_sendmailmonthlyreport.xml" -jar "X.jar" BATCH_REPORT_FR
NOTE: Its working properly by manually running the launchMonthlyreport.bat file on the server.
i.e No JavaMail error (message file too big)
But I need to run the bat file periodically i.e monthly.
So I'm using JENKINS to run the launchMonthlyreport.bat periodically using the cron job
But I'm getting the following error while trying to build the job
ERROR:
D:\PROJ\TEST_FOLDER\test>java -Xms128m -Xmx256m -Dlog4j.configuration="..\\conf\\log4j_batch_sendmailmonthlyreport.xml" -jar "X.jar" BATCH_REPORT_FR
INFO - Start for batch type = BATCH_REPORT_FR
INFO - [MONTHLY_BATCH_REPORT_FR]-[EXECUTE_REPORTS] Report for A attached
INFO - [MONTHLY_BATCH_REPORT_FR]-[EXECUTE_REPORTS] Report for B attached
INFO - [MAIL] - [SENDER] Sender email address: XYZ#gmail.com
INFO - [MAIL] - [RECIPIENT] Recipient email address: xyz#gmail.com
ERROR - sentMail Error
com.sun.mail.smtp.SMTPSendFailedException: 552 5.3.4 Error: message file too big
at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:2057)
at com.sun.mail.smtp.SMTPTransport.finishData(SMTPTransport.java:1862)
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1100)
at javax.mail.Transport.send0(Transport.java:195)
at javax.mail.Transport.send(Transport.java:124)
at com.lib.service.tool.impl.MailServiceImpl.sentMail(MailServiceImpl.java:39)
at com.batch.general.BatchReportFR.executeReports(BatchReportFR.java:107)
at com.batch.general.BatchReportFR.run(BatchReportFR.java:57)
at com.batch.general.Launcher.main(Launcher.java:16)
It's giving problem only through running through jenkins.
I think that server is telling that the message is too big. If yes, what configuration I need to add to increase the size limit ?
Any suggestions are most welcome.

Related

Elastic APM Agent Configuration Options are not working

Elasticsearch,kibana and apm-server are installed in a ec2 server
I have installed automatic java agent attach to another server to track jenkins app
Agent is getting attached to the process but dynamic configuration options are not working
Apmagent directory: (command ls)
apm-agent-attach-standalone.jar elasticapm.properties
elasticapm.properties file
service_name="jenkins-dev"
server_url="http://x.x.x.x:8200"
recording=true
enabled=true
log_level="DEBUG"
log_file=_AGENT_HOME_/logs/elastic-apm.log
Attach Command:
sudo java -jar apm-agent-attach-standalone.jar --include '.jenkins.'
->This doesn't pick configuration file but attached the agent
so i used below command to update
sudo java -jar apm-agent-attach-standalone.jar --include '.*jenkins.*' --config recording=false,enabled=false
sudo java -jar apm-agent-attach-standalone.jar --include '.*jenkins.*' --config
config_file=elasticapm.properties log_file=/etc/apmagents/apm.log
Log:
2021-04-12 10:47:20,338 [elastic-apm-server-reporter] ERROR co.elastic.apm.agent.report.IntakeV2ReportingEventHandler - Error trying to connect to APM Server. Some details about SSL configurations corresponding the current connection are logged at INFO level.
2021-04-12 10:47:20,339 [elastic-apm-server-reporter] ERROR co.elastic.apm.agent.report.IntakeV2ReportingEventHandler - Failed to handle event of type JSON_WRITER with this error: Connection refused (Connection refused)
2021-04-12 10:47:20,339 [elastic-apm-server-reporter] INFO co.elastic.apm.agent.report.IntakeV2ReportingEventHandler - Backing off for 36 seconds (+/-10%)
2021-04-12 10:47:24,345 [elastic-apm-remote-config-poller] ERROR co.elastic.apm.agent.configuration.ApmServerConfigurationSource - Connection refused (Connection refused)
Query:
1.Which is the right way to use the configuration options in command line?
2.Do we need to create a log file or it will create if log_file is used..now its polluting the application log
Try to specify the config_file using the following notation:
-Delastic.apm.config_file=elasticapm.properties
The attacher can create the log file depending on the settings configured during startup. See the [1] current code for a better understanding.
[1] https://github.com/elastic/apm-agent-java/blob/0465d479430172c3e745afd2ef5b62a3da6b60aa/apm-agent-attach-cli/src/main/java/co/elastic/apm/attach/AgentAttacher.java#L79

Opentelemetry Java auto-instrumentation data to Jaeger

I'm new to the world of Opentelemetry and would like to send the Spring-petclinic instrumentation data to Jaeger which is running on my remote cloud system
Here is the bat file:
java -javaagent:opentelemetry-javaagent-all.jar -Dotel.exporter=jaeger -Dotel.exporter.jaeger.endpoint=50.18.XXX.XX:14250 -Dotel.otlp.span.timeout=4000 -Dotel.jaeger.service.name=otel-ui -jar target/spring-petclinic-2.4.0.BUILD-SNAPSHOT.jar
When I run the bat file, I'm abe to open the petclinic app in browser (http://localhost:8080), I get the following error in the console:
[opentelemetry.auto.trace 2021-01-06 17:22:21:008 +0530] [grpc-default-executor-1] WARN io.opentelemetry.exporter.otlp.OtlpGrpcSpanExporter - Failed to export spans. Error message: UNAVAILABLE: io exception
How to resolve this issue? Are there any other dependencies to be the added to the petclinic pom.xml or to the code?
gRPC port isn't enabled in your jaeger instance.
You can try a docker-compose file like this
version: "3.6"
services:
jaeger:
image: jaegertracing/all-in-one
ports:
- 5775:5775/udp
- 6831:6831/udp
- 6832:6832/udp
- 5778:5778
- 16686:16686
- 14268:14268
- 14250:14250
- 9411:9411
And you can connect to it without problems
Can you paste the Collector config file? It seems you are using the gRPC protocol and it's not supported on the system where the collector is running.
https://github.com/open-telemetry/opentelemetry-collector/blob/master/exporter/otlpexporter/README.md

ERROR : Exiting Kafka due to fatal exception (kafka.Kafk a$)

I'm running first time Kafka on my windows 7 and getting error starting the Kafka-Service
I downloaded kafka_2.12-2.0.0 and unzipped on C:\kafka_2.12-2.0.0
In C:\kafka_2.12-2.0.0\config\zookeeper.properties changed
dataDir
to
dataDir=C:/kafka_2.12-2.0.0/data/zookeeper
(folder dataDir=C:/kafka_2.12-2.0.0/data/zookeeper created)
In C:\kafka_2.12-2.0.0\config\server.properties changed
log.dirs
to
log.dirs=C:/kafka_2.12-2.0.0/data/kafka
(folder C:/kafka_2.12-2.0.0/data/kafka created)
Run from cmd with admin permission zookeeper server
\bin\windowszookeeper-server-start.bat
C:\kafka_2.12-2.0.0\config\zookeeper.properties
it's running on port 2181 (getting INFO binding to port
0.0.0./0.0.0.0:2181)
Run from another cmd with admin permission kafka server
\bin\windows\kafka-server-start.bat
C:\kafka_2.12- 2.0.0\config\server.properties
I'm getting error : ERROR Exiting Kafka due to fatal exception (kafka.Kafk
a$)
java.io.FileNotFoundException: C:\kafka_2.12- (The system cannot find the file specified)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(FileInputStream.java:195)
You need to give the configuration file location when you start kafka:
bin/kafka-server-start.sh config/server.properties
Also check the getting started page of kafka to check the basic steps to follow in order to validate the installation:
Get started with kafka

RemoteSwingLibraryTimeoutError: Agent port not received before timeout

I am trying to run a basic robotframework test with RemoteSwingLibrary, but I can't seem to get it to work.
I was able to run the following test just fine with SwingLibrary:
*** Settings ***
Library SwingLibrary
*** Test Cases ***
Foobar Test
Start Application fully.qualified.name.of.my.class
I am running it from within Eclipse via the robot framework standalone jar. I put robotframework-3.0.2.jar and swinglibrary-1.9.7.jar on my class path, created a new run configuration using my projects default classpath with the main class being org.robotframework.RobotFramework. In the arguments, I specify the name of my test file.
So, that seems to work fine. Then I tried to do almost exactly the same thing with RemoteSwingLibrary:
*** Settings ***
Library RemoteSwingLibrary
*** Test Cases ***
Foobar Test
Start Application my_app java fully.qualified.name.of.my.class
I replaced the swinglibrary jar on my classpath with remoteswinglibrary-2.2.1.jar and I ran the same test. The output says:
console: Failed to install '': java.nio.charset.UnsupportedCharsetException: cp0.
==============================================================================
Remotetest
==============================================================================
Foobar Test | FAIL |
RemoteSwingLibraryTimeoutError: Agent port not received before timeout
------------------------------------------------------------------------------
Remotetest | FAIL |
1 critical test, 0 passed, 1 failed
1 test total, 0 passed, 1 failed
==============================================================================
Output: C:\<path>\output.xml
Log: C:\<path>\log.html
Report: C:\<path>\report.html
(note that the "console: Failed to install..." part is normal and I don't think I need to be concerned about it)
When I dig into the report for the Start Application Keyword, it says
13:48:40.070 INFO Link to stdout
13:48:40.070 INFO Link to stderr
13:48:40.070 INFO -javaagent:"C:<pathToProject>\__pyclasspath__"=127.0.0.1:63110
13:48:40.071 INFO Starting process:
java fully.qualified.name.of.my.class
13:49:40.145 INFO Failed to start application: Traceback (most recent call last):
File "__pyclasspath__/RemoteSwingLibrary.py", line 307, in start_application
File "__pyclasspath__/RemoteSwingLibrary.py", line 353, in _application_started
File "__pyclasspath__/RemoteSwingLibrary.py", line 373, in _get_agent_address
RemoteSwingLibraryTimeoutError: Agent port not received before timeout
13:49:40.155 INFO Waiting for process to complete.
13:49:40.165 INFO Process completed.
13:49:40.165 INFO STDOUT: Error occurred during initialization of VM
agent library failed to init: instrument
13:49:40.175 INFO STDERR: Error opening zip file or JAR manifest missing : C:<pathToProject>\__pyclasspath__
Picked up JAVA_TOOL_OPTIONS: -javaagent:"C:<pathToProject>\__pyclasspath__"=127.0.0.1:63110
Picked up _JAVA_OPTIONS: -Djava.security.policy="C:\<UserFolder>\
AppData\Local\Temp\2\grant_all_f_vfit.policy"
13:49:40.195 FAIL RemoteSwingLibraryTimeoutError: Agent port not received before timeout
I'm not sure if this hunch is really founded on anything, but my suspicion is that there's a classpath issue. I would think that when I call the Start Application keyword with "java fully.qualified.name.of.my.class" I would probably have to pass along my classpath. I was hoping that maybe I wouldn't since the non-remote version seems to handle that just fine (probably because its running my app in the same JVM as I launched robot framework in, and that already included everything I needed in my classpath).
So if that's the issue, I can probably fix it by using the -cp option in my java command. However, the classpath for this particular project is actually quite long (my project is dependent on a lot of other projects) and I would rather not have to list it all out. Also, when I add a new dependency down the road, I would rather not have to update the classpath in my test file as well.
Is there some magic way that I can pass the current classpath along to the remote app? Or perhaps some other solution to this problem?
Update
I tried again with -cp and my giant classpath and it gave me the same errors, so its possible that my classpath has nothing to do with whatever is going on.
I also tried specifying the port number explicitly and it gives me slightly different output (though it still doesn't work). I also discovered that there's a debug setting that gives a little more detail. Here's me new setup:
*** Settings ***
Library RemoteSwingLibrary debug=True port=8242
*** Test Cases ***
Foobar Test
Start Application my_app java -cp <classpath> <fully.qualified.name.of.my.class> remote_port=8242
And here is my new output:
13:48:40.070 INFO Link to stdout
13:48:40.070 INFO Link to stderr
13:48:40.070 DEBUG Picked old JAVA_TOOL_OPTIONS=''
13:48:40.070 DEBUG Picked old _JAVA_OPTIONS=''
13:48:40.070 INFO -javaagent:"C:<pathToProject>\__pyclasspath__"=127.0.0.1:51509:DEBUG
13:48:40.070 DEBUG Set JAVA_TOOL_OPTIONS='-javaagent:"C:<pathToProject>\__pyclasspath__"=127.0.0.1:8242:APPORT=8242:DEBUG'
13:48:40.070 DEBUG SET _JAVA_OPTIONS='-Djava.security.policy="C:\<UserFolder>\AppData\Local\Temp\4\grant_all_haud6t.policy"'
13:48:40.071 INFO Starting process:
java -cp <classpath> <fully.qualified.name.of.my.class>
13:48:40.071 DEBUG Process configuration:
cwd: C:<PathToProject>
shell: True
stdout: C:<PathToProject>\<someBigPath>.txt
stderr: C:<PathToProject>\<someBigPath>.txt
alias: my_app
env: None
13:48:40.100 DEBUG Returned old JAVA_TOOL_OPTIONS=''
13:48:40.100 DEBUG Returned old _JAVA_OPTIONS=''
13:48:40.102 INFO connection to started application at 127.0.0.1:8242
13:48:40.120 DEBUG remote swinglibrary instantiated
13:48:40.121 DEBUG remote services instantiated
13:48:40.121 INFO waiting for api at 127.0.0.1:8242
13:49:40.145 INFO Failed to start application: Traceback (most recent call last):
File "__pyclasspath__/RemoteSwingLibrary.py", line 307, in start_application
File "__pyclasspath__/RemoteSwingLibrary.py", line 357, in _application_started
File "__pyclasspath__/RemoteSwingLibrary.py", line 344, in _wait_for_api
RuntimeError: Connecting to api at 127.00.1:8242 has failed: ''
13:49:40.155 INFO Waiting for process to complete.
13:49:40.165 INFO Process completed.
13:49:40.165 INFO STDOUT: Error occurred during initialization of VM
agent library failed to init: instrument
13:49:40.175 INFO STDERR: Error opening zip file or JAR manifest missing : C:<pathToProject>\__pyclasspath__
Picked up JAVA_TOOL_OPTIONS: -javaagent:"C:<pathToProject>\__pyclasspath__"=127.0.0.1:8242:APPORT=8242:DEBUG
Picked up _JAVA_OPTIONS: -Djava.security.policy="C:\<UserFolder>\
AppData\Local\Temp\2\grant_all_f_vfit.policy"
13:49:40.195 FAIL Connecting to api at 127.0.0.1:8242 has failed: ''
13:49:40.195 DEBUG Traceback (most recent call last):
File "__pyclasspath__/RemoteSwingLibrary.py", line 498, in run_keyword
File "__pyclasspath__/RemoteSwingLibrary.py", line 307, in start_application
File "__pyclasspath__/RemoteSwingLibrary.py", line 357, in _application_started
File "__pyclasspath__/RemoteSwingLibrary.py", line 344, in _wait_for_api
Yet another update
I think that this may have something to do with the "__pyclasspath__" that shows up in the error message. I put my java command in a .bat file preceded by a "set" command to list my environment variables. I can run the .bat file from the command line just fine (it launches the java app).
Then I modified my .robot file to do:
Foobar Test
Start Application my_app cd robotframework/tests && Run.bat remote_port=8242
I get essentially the same error output that I got before:
Error opening zip file or JAR manifest missing : C:<pathToProject>\__pyclasspath__
Picked up JAVA_TOOL_OPTIONS: -javaagent:"__pyclasspath__"=127.0.0.1:8242:APPORT=8242:DEBUG
Picked up _JAVA_OPTIONS: -Djava.security.policy="C:\\AppData\Local\Temp\1\grant_all_lgirs7.policy"
The environment that my batch script prints out appears the same except for JAVA_TOOL_OPTIONS and _JAVA_OPTIONS (which match with what the error output says). There is no environment variable called __pyclasspath__ so I'm wondering if that's the issue.
I set JAVA_TOOL_OPTIONS in my cmd environment to match the output that I saw from my robot run and now I get the same error message when I try to run my .bat script from the command line, so that environment variable seems to be the issue.
Well, I came up with a fix, though its definitely not an ideal fix.
I found out that when the framework kicks of my remote app, it sets:
JAVA_TOOL_OPTIONS=-javaagent:"C:\<pathToProject>\__pyclasspath__
But __pyclasspath__ is not actually an environment variable. I figured out that the javaagent has to point to the remote framework library, so I decided to just set it explicitly.
So now I changed my robot file to something like this:
*** Settings ***
Library RemoteSwingLibrary
*** Test Cases ***
Foobar Test
Start Application my_app run.bat remote_port=1234
And then made a file called run.bat that does:
set JAVA_TOOL_OPTIONS=-javaagent:"C:\<pathToProject\lib\remoteswinglibrary-2.2.1.jar"=127.0.0.1:1234:APPORT=1234
java -cp <classPath> fully.qualified.name.of.class
This is obviously sort of a hacky solution and it will take a little work to make it portable (I'll need to get rid of the hardcoded "pathToProject" and also make it support Linux environments as well). It also requires hardcoding in a port, whereas it would be nice if the robotframework could just select a port for me.
So, I would definitely like to see a better solution if anyone can find one, but for now, this will at least work.

Unable to deploy in Netbeans 6.7.1 and Glassfish v2.1.1

I am trying to deploy a simple WebService in Netbeans 6.7.1 and Glassfish v2.1.1 and am getting the following error. I am using GlassfishESBv2.2 and windows 7 machine. I have tried googling and implemented things as shown in
http://forums.netbeans.org/topic10055-0-asc-0.html . Still unable to deploy. Though the message says that application server is not started, from the Server tab , I am able to see a message which indicates Glassfish has started.Also , doing a netstat after trying to deploy returns this, which means that Glassfish is running.
C:>netstat -an | findstr "4848"
TCP 0.0.0.0:4848 0.0.0.0:0 LISTENING
I have been trying real hard to get this resolved. Any help is highly appreciated.
Error Message :
The Sun Java System Application Server could not start.
More information about the cause is in the Server log file.
Possible reasons include:
- IDE timeout: refresh the server node to see if it's running now.
- Port conflicts. (use netstat -a to detect possible port numbers already used by the operating system.)
- Incorrect server configuration (domain.xml to be corrected manually)
- Corrupted Deployed Applications preventing the server to start.(This can be seen in the server.log file. In this case, domain.xml needs to be modified).
- Invalid installation location.
C:\Users\xyz\Documents\NetBeansProjects\HWebService\nbproject\build-impl.xml:564: Deployment error:
The Sun Java System Application Server could not start.
More information about the cause is in the Server log file.
Possible reasons include:
- IDE timeout: refresh the server node to see if it's running now.
- Port conflicts. (use netstat -a to detect possible port numbers already used by the operating system.)
- Incorrect server configuration (domain.xml to be corrected manually)
- Corrupted Deployed Applications preventing the server to start.(This can be seen in the server.log file. In this case, domain.xml needs to be modified).
- Invalid installation location.
See the server log for details.
BUILD FAILED (total time: 29 seconds)
I've described the solution please visit here...
http://forums.netbeans.org/post-65058.html

Categories