when I execute my UDF on a local spark cluster it works as expected. When I execute it on docker VMs I get the following error :
Driver stacktrace:] with root cause
java.lang.IllegalStateException: unread block data
at java.io.ObjectInputStream$BlockDataInputStream.setBlockDataMode(ObjectInputStream.java:2934) ~[na:na]
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1704) ~[na:na]
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2431) ~[na:na]
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2355) ~[na:na]
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2213) ~[na:na]
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1669) ~[na:na]
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:503) ~[na:na]
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:461) ~[na:na]
at org.apache.spark.serializer.JavaDeserializationStream.readObject(JavaSerializer.scala:87) ~[spark-core_2.12-3.3.0.jar:3.3.0]
at org.apache.spark.serializer.JavaSerializerInstance.deserialize(JavaSerializer.scala:129) ~[spark-core_2.12-3.3.0.jar:3.3.0]
at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:507) ~[spark-core_2.12-3.3.0.jar:3.3.0]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[na:na]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[na:na]
at java.lang.Thread.run(Thread.java:750) ~[na:na]
The driver code:
StructType structType = new StructType()
.add("number", DataTypes.IntegerType)
.add("factorial", DataTypes.IntegerType);
List<Row> rows = numbers.stream().map(i -> new GenericRowWithSchema(new Integer[]{i, i}, structType)).collect(Collectors.toList());
JavaRDD<Row> words = sparkContext.parallelize(rows);
UserDefinedFunction factorialFunction = udf(
new Factorial(), DataTypes.LongType
);
sparkSession.udf().register("factorialFunction", factorialFunction);
Dataset<Row> dataFrame = sparkSession.createDataFrame(words, structType);
//>>next line fails in cluster mode. local mode works fine
//https://stackoverflow.com/questions/28186607/java-lang-classcastexception-using-lambda-expressions-in-spark-job-on-remote-ser/28367602#28367602
List<Row> result = dataFrame.select(col("number"), factorialFunction.apply(col("factorial"))).collectAsList();
return result.stream().distinct().collect(Collectors.toMap(e -> (Integer) e.get(0), e -> (Long) e.get(1)));
The Spark configuration:
new SparkConf()
.setAppName(appName)
.setMaster(masterUri)
.setJars(new String[]{"target/hello-spark-0.0.1-SNAPSHOT.jar"})
.set("spark.serializer", "org.apache.spark.serializer.KryoSerializer")
.set("spark.kryo.registrationRequired", "true")
.registerKryoClasses(new Class[]{
Factorial.class,
WordCountService.class,
GenericRowWithSchema.class,
StructType.class,
StructField.class,
StructField[].class,
IntegerType$.class,
Metadata.class,
Integer[].class})
The default spring profile executes on the local cluster, the profile 'local' will connect to one master-spark node which delegates to two worker nodes. I also tried the Java serialization which led me to
java.lang.ClassCastException: cannot assign instance of java.lang.invoke.SerializedLambda to field org.apache.spark.rdd.MapPartitionsRDD.f of type scala.Function3 in instance of org.apache.spark.rdd.MapPartitionsRDD
at java.io.ObjectStreamClass$FieldReflector.setObjFieldValues(ObjectStreamClass.java:2301) ~[na:na]
at java.io.ObjectStreamClass.setObjFieldValues(ObjectStreamClass.java:1431) ~[na:na]
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2437) ~[na:na]
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2355) ~[na:na]
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2213) ~[na:na]
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1669) ~[na:na]
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2431) ~[na:na]
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2355) ~[na:na]
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2213) ~[na:na]
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1669) ~[na:na]
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:503) ~[na:na]
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:461) ~[na:na]
at scala.collection.immutable.List$SerializationProxy.readObject(List.scala:527) ~[scala-library-2.12.15.jar:na]
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source) ~[na:na]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:na]
at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1184) ~[na:na]
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2322) ~[na:na]
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2213) ~[na:na]
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1669) ~[na:na]
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2431) ~[na:na]
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2355) ~[na:na]
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2213) ~[na:na]
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1669) ~[na:na]
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2431) ~[na:na]
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2355) ~[na:na]
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2213) ~[na:na]
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1669) ~[na:na]
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:503) ~[na:na]
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:461) ~[na:na]
at org.apache.spark.serializer.JavaDeserializationStream.readObject(JavaSerializer.scala:87) ~[spark-core_2.12-3.3.0.jar:3.3.0]
at org.apache.spark.serializer.JavaSerializerInstance.deserialize(JavaSerializer.scala:129) ~[spark-core_2.12-3.3.0.jar:3.3.0]
at org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:83) ~[spark-core_2.12-3.3.0.jar:3.3.0]
at org.apache.spark.scheduler.Task.run(Task.scala:136) ~[spark-core_2.12-3.3.0.jar:3.3.0]
at org.apache.spark.executor.Executor$TaskRunner.$anonfun$run$3(Executor.scala:548) ~[spark-core_2.12-3.3.0.jar:3.3.0]
at org.apache.spark.util.Utils$.tryWithSafeFinally(Utils.scala:1504) ~[spark-core_2.12-3.3.0.jar:3.3.0]
at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:551) ~[spark-core_2.12-3.3.0.jar:3.3.0]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[na:na]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[na:na]
at java.lang.Thread.run(Thread.java:750) ~[na:na]
I also looked up all the corresponding problems on SO. I can see during startup, that the jar file is loaded:
org.apache.spark.SparkContext: Added JAR target/hello-spark-0.0.1-SNAPSHOT.jar at spark://192.168.178.172:54061/jars/hello-spark-0.0.1-SNAPSHOT.jar with timestamp 1656517689330
Please help, I spent 2 days, still no luck.
Kind Regards
Related
I have an application running on a hosting, and when executing an external API call I get the following error:
2022-10-27 20:29:55.971 ERROR 607248 --- [MessageBroker-7] o.s.s.s.TaskUtils$LoggingErrorHandler : Unexpected error occurred in scheduled task
org.springframework.web.client.HttpClientErrorException: 451 Unavailable For Legal Reasons: "{"error":{"message":"Your country is not supported (Code: 1016)","code":1016}}"
at org.springframework.web.client.HttpClientErrorException.create(HttpClientErrorException.java:145) ~[spring-web-5.3.23.jar:5.3.23]
at org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:168) ~[spring-web-5.3.23.jar:5.3.23]
at org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:122) ~[spring-web-5.3.23.jar:5.3.23]
at org.springframework.web.client.ResponseErrorHandler.handleError(ResponseErrorHandler.java:63) ~[spring-web-5.3.23.jar:5.3.23]
at org.springframework.web.client.RestTemplate.handleResponse(RestTemplate.java:819) ~[spring-web-5.3.23.jar:5.3.23]
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:777) ~[spring-web-5.3.23.jar:5.3.23]
at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:711) ~[spring-web-5.3.23.jar:5.3.23]
at org.springframework.web.client.RestTemplate.getForObject(RestTemplate.java:334) ~[spring-web-5.3.23.jar:5.3.23]
at br.com.example.prj.service.ServiceApiBlz.getCurrent(ServiceApiBlz.java:17) ~[classes/:na]
at br.com.example.prj.service.RecordCherckerService.checker(RecordCherckerService.java:48) ~[classes/:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:567) ~[na:na]
at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:84) ~[spring-context-5.3.23.jar:5.3.23]
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) ~[spring-context-5.3.23.jar:5.3.23]
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[na:na]
at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305) ~[na:na]
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305) ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na]
at java.base/java.lang.Thread.run(Thread.java:847) ~[na:na]
Are the two errors related? And how can I fix? Locally I don't have this error. Thanks
I tested it on a local connection using a proxy from another country to check if it was a block on the destination, but locally I couldn't simulate the error. I imagine it could be something in the hosting.
Spring Boot app work with STOMP and ActiveMQ just on the same host without the container, with config:
#Configuration
#EnableWebSocketMessageBroker
public class MQConfig implements WebSocketMessageBrokerConfigurer {
public final static String ORDER_STREAM = "/stream/newOrder/";
#Override
public void registerStompEndpoints(StompEndpointRegistry registry) {
registry
.addEndpoint("/api/streams")
.setAllowedOrigins("*")
.withSockJS();
}
#Override
public void configureMessageBroker(final MessageBrokerRegistry config) {
config.enableStompBrokerRelay("/stream")
.setRelayHost("localhost")
.setRelayPort(61613)
.setClientLogin(mqClientLogin)
.setClientPasscode(mqClientPasscode);
config.setApplicationDestinationPrefixes("/api");
}
}
And use case:
#Service
#RequiredArgsConstructor
public class StreamServiceImpl implements StreamService {
private final SimpMessagingTemplate simpMessagingTemplate;
#Override
public void distributeNewOrder(#NotNull OrderMessage orderMsg) {
OrderMessage msg = OrderMessage.builder()
.type(orderMsg.getType())
.size(orderMsg.getSize())
.build();
simpMessagingTemplate.convertAndSend(format(
"%s%s", MQConfig.ORDER_STREAM, orderMsg.getStreamId().toString()), msg);
}
#Scheduled(fixedDelay = 1000)
public void test() {
distributeNewOrder(new OrderMessage(UUID.fromString("68b0439b-82e7-4aa0-adec-cdd4e877f7ba"), "test", new BigDecimal(10)));
}
}
And it's work, and messages delivered but in console, I've got an Exceptions:
How I can get rid of its errors?
org.springframework.messaging.MessageDeliveryException: Message broker not active. Consider subscribing to receive BrokerAvailabilityEvent's from an ApplicationListener Spring bean.
at org.springframework.messaging.simp.stomp.StompBrokerRelayMessageHandler.handleMessageInternal(StompBrokerRelayMessageHandler.java:494) ~[spring-messaging-5.3.8.jar:5.3.8]
at org.springframework.messaging.simp.broker.AbstractBrokerMessageHandler.handleMessage(AbstractBrokerMessageHandler.java:281) ~[spring-messaging-5.3.8.jar:5.3.8]
at org.springframework.messaging.support.ExecutorSubscribableChannel$SendTask.run(ExecutorSubscribableChannel.java:144) ~[spring-messaging-5.3.8.jar:5.3.8]
at org.springframework.messaging.support.ExecutorSubscribableChannel.sendInternal(ExecutorSubscribableChannel.java:100) ~[spring-messaging-5.3.8.jar:5.3.8]
at org.springframework.messaging.support.AbstractMessageChannel.send(AbstractMessageChannel.java:139) ~[spring-messaging-5.3.8.jar:5.3.8]
at org.springframework.messaging.support.AbstractMessageChannel.send(AbstractMessageChannel.java:125) ~[spring-messaging-5.3.8.jar:5.3.8]
at org.springframework.messaging.simp.SimpMessagingTemplate.sendInternal(SimpMessagingTemplate.java:187) ~[spring-messaging-5.3.8.jar:5.3.8]
at org.springframework.messaging.simp.SimpMessagingTemplate.doSend(SimpMessagingTemplate.java:162) ~[spring-messaging-5.3.8.jar:5.3.8]
at org.springframework.messaging.simp.SimpMessagingTemplate.doSend(SimpMessagingTemplate.java:48) ~[spring-messaging-5.3.8.jar:5.3.8]
at org.springframework.messaging.core.AbstractMessageSendingTemplate.send(AbstractMessageSendingTemplate.java:109) ~[spring-messaging-5.3.8.jar:5.3.8]
at org.springframework.messaging.core.AbstractMessageSendingTemplate.convertAndSend(AbstractMessageSendingTemplate.java:151) ~[spring-messaging-5.3.8.jar:5.3.8]
at org.springframework.messaging.core.AbstractMessageSendingTemplate.convertAndSend(AbstractMessageSendingTemplate.java:129) ~[spring-messaging-5.3.8.jar:5.3.8]
at org.springframework.messaging.core.AbstractMessageSendingTemplate.convertAndSend(AbstractMessageSendingTemplate.java:122) ~[spring-messaging-5.3.8.jar:5.3.8]
at com.tradeshare.service.StreamServiceImpl.distributeNewOrder(StreamServiceImpl.java:32) ~[classes/:na]
at com.tradeshare.service.StreamServiceImpl.test(StreamServiceImpl.java:38) ~[classes/:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:567) ~[na:na]
at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:84) ~[spring-context-5.3.8.jar:5.3.8]
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) ~[spring-context-5.3.8.jar:5.3.8]
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[na:na]
at java.base/java.util.concurrent.FutureTask.runAndReset$$$capture(FutureTask.java:305) ~[na:na]
at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java) ~[na:na]
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305) ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) ~[na:na]
at java.base/java.lang.Thread.run(Thread.java:831) ~[na:na]
2021-07-26 20:17:38.464 INFO 11928 --- [ent-scheduler-3] o.s.m.s.s.StompBrokerRelayMessageHandler : "System" session connected.
2021-07-26 20:17:38.466 INFO 11928 --- [ent-scheduler-3] o.s.m.s.s.StompBrokerRelayMessageHandler : BrokerAvailabilityEvent[available=true, StompBrokerRelay[ReactorNettyTcpClient[reactor.netty.tcp.TcpClientConnect#4156bfbd]]]
2021-07-26 20:17:43.935 WARN 11928 --- [ealth-indicator] o.s.boot.actuate.jms.JmsHealthIndicator : Connection failed to start within 5 seconds and will be closed.
2021-07-26 20:17:48.944 WARN 11928 --- [)-192.168.0.101] o.s.boot.actuate.jms.JmsHealthIndicator : JMS health check failed
javax.jms.JMSException: Wire format negotiation timeout: peer did not send his wire format.
at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:72) ~[activemq-client-5.16.2.jar:5.16.2]
at org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1421) ~[activemq-client-5.16.2.jar:5.16.2]
at org.apache.activemq.ActiveMQConnection.ensureConnectionInfoSent(ActiveMQConnection.java:1486) ~[activemq-client-5.16.2.jar:5.16.2]
at org.apache.activemq.ActiveMQConnection.start(ActiveMQConnection.java:527) ~[activemq-client-5.16.2.jar:5.16.2]
at org.springframework.jms.connection.SingleConnectionFactory$SharedConnectionInvocationHandler.localStart(SingleConnectionFactory.java:672) ~[spring-jms-5.3.8.jar:5.3.8]
at org.springframework.jms.connection.SingleConnectionFactory$SharedConnectionInvocationHandler.invoke(SingleConnectionFactory.java:610) ~[spring-jms-5.3.8.jar:5.3.8]
at jdk.proxy2/jdk.proxy2.$Proxy108.start(Unknown Source) ~[na:na]
at org.springframework.boot.actuate.jms.JmsHealthIndicator$MonitoredConnection.start(JmsHealthIndicator.java:81) ~[spring-boot-actuator-2.5.2.jar:2.5.2]
at org.springframework.boot.actuate.jms.JmsHealthIndicator.doHealthCheck(JmsHealthIndicator.java:53) ~[spring-boot-actuator-2.5.2.jar:2.5.2]
at org.springframework.boot.actuate.health.AbstractHealthIndicator.health(AbstractHealthIndicator.java:82) ~[spring-boot-actuator-2.5.2.jar:2.5.2]
at org.springframework.boot.actuate.health.HealthIndicator.getHealth(HealthIndicator.java:37) ~[spring-boot-actuator-2.5.2.jar:2.5.2]
at org.springframework.boot.actuate.health.HealthEndpoint.getHealth(HealthEndpoint.java:71) ~[spring-boot-actuator-2.5.2.jar:2.5.2]
at org.springframework.boot.actuate.health.HealthEndpoint.getHealth(HealthEndpoint.java:39) ~[spring-boot-actuator-2.5.2.jar:2.5.2]
at org.springframework.boot.actuate.health.HealthEndpointSupport.getContribution(HealthEndpointSupport.java:99) ~[spring-boot-actuator-2.5.2.jar:2.5.2]
at org.springframework.boot.actuate.health.HealthEndpointSupport.getAggregateHealth(HealthEndpointSupport.java:110) ~[spring-boot-actuator-2.5.2.jar:2.5.2]
at org.springframework.boot.actuate.health.HealthEndpointSupport.getContribution(HealthEndpointSupport.java:96) ~[spring-boot-actuator-2.5.2.jar:2.5.2]
at org.springframework.boot.actuate.health.HealthEndpointSupport.getHealth(HealthEndpointSupport.java:74) ~[spring-boot-actuator-2.5.2.jar:2.5.2]
at org.springframework.boot.actuate.health.HealthEndpointSupport.getHealth(HealthEndpointSupport.java:61) ~[spring-boot-actuator-2.5.2.jar:2.5.2]
at org.springframework.boot.actuate.health.HealthEndpoint.health(HealthEndpoint.java:65) ~[spring-boot-actuator-2.5.2.jar:2.5.2]
at org.springframework.boot.actuate.health.HealthEndpoint.health(HealthEndpoint.java:55) ~[spring-boot-actuator-2.5.2.jar:2.5.2]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:567) ~[na:na]
at org.springframework.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:282) ~[spring-core-5.3.8.jar:5.3.8]
at org.springframework.boot.actuate.endpoint.invoke.reflect.ReflectiveOperationInvoker.invoke(ReflectiveOperationInvoker.java:74) ~[spring-boot-actuator-2.5.2.jar:2.5.2]
at org.springframework.boot.actuate.endpoint.annotation.AbstractDiscoveredOperation.invoke(AbstractDiscoveredOperation.java:60) ~[spring-boot-actuator-2.5.2.jar:2.5.2]
at org.springframework.boot.actuate.endpoint.jmx.EndpointMBean.invoke(EndpointMBean.java:121) ~[spring-boot-actuator-2.5.2.jar:2.5.2]
at org.springframework.boot.actuate.endpoint.jmx.EndpointMBean.invoke(EndpointMBean.java:96) ~[spring-boot-actuator-2.5.2.jar:2.5.2]
at java.management/com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:809) ~[na:na]
at java.management/com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) ~[na:na]
at java.management.rmi/javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1466) ~[na:na]
at java.management.rmi/javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1307) ~[na:na]
at java.management.rmi/javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1399) ~[na:na]
at java.management.rmi/javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:827) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:567) ~[na:na]
at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:357) ~[na:na]
at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:200) ~[na:na]
at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:197) ~[na:na]
at java.base/java.security.AccessController.doPrivileged(AccessController.java:691) ~[na:na]
at java.rmi/sun.rmi.transport.Transport.serviceCall(Transport.java:196) ~[na:na]
at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:587) ~[na:na]
at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:828) ~[na:na]
at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:705) ~[na:na]
at java.base/java.security.AccessController.doPrivileged(AccessController.java:391) ~[na:na]
at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:704) ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) ~[na:na]
at java.base/java.lang.Thread.run(Thread.java:831) ~[na:na]
Caused by: java.io.IOException: Wire format negotiation timeout: peer did not send his wire format.
at org.apache.activemq.transport.WireFormatNegotiator.oneway(WireFormatNegotiator.java:99) ~[activemq-client-5.16.2.jar:5.16.2]
at org.apache.activemq.transport.MutexTransport.oneway(MutexTransport.java:68) ~[activemq-client-5.16.2.jar:5.16.2]
at org.apache.activemq.transport.ResponseCorrelator.asyncRequest(ResponseCorrelator.java:81) ~[activemq-client-5.16.2.jar:5.16.2]
at org.apache.activemq.transport.ResponseCorrelator.request(ResponseCorrelator.java:86) ~[activemq-client-5.16.2.jar:5.16.2]
at org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1392)> ~[activemq-client-5.16.2.jar:5.16.2]
... 50 common frames omitted
2021-07-26 20:18:08.930 INFO 11928 --- [0.1:61613#65232] o.s.j.c.CachingConnectionFactory : Encountered a JMSException - resetting the underlying JMS Connection
javax.jms.JMSException: Channel was inactive (no connection attempt made) for too (>30000) long: tcp://127.0.0.1:61613
at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:54) ~[activemq-client-5.16.2.jar:5.16.2]
at org.apache.activemq.ActiveMQConnection.onAsyncException(ActiveMQConnection.java:1960) ~[activemq-client-5.16.2.jar:5.16.2]
at org.apache.activemq.ActiveMQConnection.onException(ActiveMQConnection.java:1979) ~[activemq-client-5.16.2.jar:5.16.2]
at org.apache.activemq.transport.TransportFilter.onException(TransportFilter.java:114) ~[activemq-client-5.16.2.jar:5.16.2]
at org.apache.activemq.transport.ResponseCorrelator.onException(ResponseCorrelator.java:126) ~[activemq-client-5.16.2.jar:5.16.2]
at org.apache.activemq.transport.TransportFilter.onException(TransportFilter.java:114) ~[activemq-client-5.16.2.jar:5.16.2]
at org.apache.activemq.transport.TransportFilter.onException(TransportFilter.java:114) ~[activemq-client-5.16.2.jar:5.16.2]
at org.apache.activemq.transport.WireFormatNegotiator.onException(WireFormatNegotiator.java:173) ~[activemq-client-5.16.2.jar:5.16.2]
at org.apache.activemq.transport.AbstractInactivityMonitor.onException(AbstractInactivityMonitor.java:345) ~[activemq-client-5.16.2.jar:5.16.2]
at org.apache.activemq.transport.AbstractInactivityMonitor$1$1.run(AbstractInactivityMonitor.java:92) ~[activemq-client-5.16.2.jar:5.16.2]
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)> ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) ~[na:na]
at java.base/java.lang.Thread.run(Thread.java:831) ~[na:na]
Caused by: org.apache.activemq.transport.InactivityIOException: Channel was inactive (no connection attempt made) for too (>30000) long: tcp://127.0.0.1:61613
at org.apache.activemq.transport.AbstractInactivityMonitor$1$1.run(AbstractInactivityMonitor.java:93) ~[activemq-client-5.16.2.jar:5.16.2]
... 3 common frames omitted
UPDATE_1
application.properties
spring.activemq.broker-url=tcp://127.0.0.1:61613
spring.activemq.user=admin
spring.activemq.password=admin
spring.activemq.packages.trust-all=true
spring.activemq.pool.max-connections=500
The problem was in application.properties.
When we're using STOMP had two key configs:
STOMP endpoint.
ActiveMQ endpoint
The problem was in application.properties.
When we're using STOMP had two key configs:
STOMP endpoint.
ActiveMQ endpoint
#Override
public void configureMessageBroker(final MessageBrokerRegistry config) {
config.enableStompBrokerRelay("/stream")
.setRelayHost(mqRelayHost)
.setRelayPort(mqRelayPort)
.setClientLogin(mqUsername)
.setClientPasscode(mqPassword);
config.setApplicationDestinationPrefixes("/api");
}
# Input STOMP
mq.relay.host=127.0.0.1
mq.relay.port=61613
And ActiveMQ settings:
# ActiveMQ (not embedded)
spring.activemq.broker-url=tcp://localhost:61616
spring.activemq.user=admin
spring.activemq.password=admin
spring.activemq.packages.trust-all=true
spring.activemq.pool.max-connections=500
Its different hosts and different ports, STOMP in this case work as a proxy.
i have a client and a server on a kubernetes cluster in the same namespace.
I try to access the server with this code:
public GetDataResponse getData() throws JsonProcessingException {
GetDataResponseXML response = (GetDataResponseXML) getWebServiceTemplate()
.marshalSendAndReceive(REQUEST_PARAMETER, new SoapActionCallback(""));
log.info("Get response data: " + Mapper.objectMapper.writeValueAsString(response));
return mapper.dataResponseXMLToJPAEntity(response);
}
I connect to the endpoint with the DNS
http://<serviceOfServer>.<namespace>.svc.cluster.local/data
But i get always this output:
2020-06-25 07:44:36.128 ERROR 7 --- [ scheduling-1] o.s.s.s.TaskUtils$LoggingErrorHandler : Unexpected error occurred in scheduled task
java.lang.NullPointerException: null
at org.springframework.ws.transport.http.AbstractHttpWebServiceMessageSender.supports(AbstractHttpWebServiceMessageSender.java:63) ~[spring-ws-core-3.0.7.RELEASE.jar!/:na]
at org.springframework.ws.client.support.WebServiceAccessor.createConnection(WebServiceAccessor.java:107) ~[spring-ws-core-3.0.7.RELEASE.jar!/:na]
at org.springframework.ws.client.core.WebServiceTemplate.sendAndReceive(WebServiceTemplate.java:551) ~[spring-ws-core-3.0.7.RELEASE.jar!/:na]
at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:390) ~[spring-ws-core-3.0.7.RELEASE.jar!/:na]
at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:383) ~[spring-ws-core-3.0.7.RELEASE.jar!/:na]
at com.my.adapter.client.SOAPClient.getData(SOAPClient.java:40) ~[classes!/:0.0.1-SNAPSHOT]
at com.my.adapter.scheduler.Scheduler.consumeScheduler(Scheduler.java:33) ~[classes!/:0.0.1-SNAPSHOT]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:84) ~[spring-context-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) ~[spring-context-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[na:na]
at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305) ~[na:na]
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305) ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na]
at java.base/java.lang.Thread.run(Thread.java:834) ~[na:na]
I have this networkpolicy, so the np cannot be the reason
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: allow-all-egress
spec:
podSelector: {}
egress:
- {}
ingress:
- {}
policyTypes:
- Egress
- Ingress
If i do port-forwarding to the server or service, i can access it with my local client. So it should be ok.
I have absolut not a clue why i get a nullpointer exception.
Have anyone an idea?
Thanks a lot for any help!
I have the solution. I dont know why my DNS didn't work, but when i call it only with the service
http://<serviceOfServer>:<port>
It works.....
I create an api to send email via yahoo. On start a get an exception.
My SendMail class:
import com.emo.api.MailService;
import com.emo.api.model.MailModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.stereotype.Service;
#Service
public class SimpleMail implements MailService {
#Autowired
private JavaMailSender javaMailSender;
#Override
public void sendEmail(final MailModel mailModel) {
final SimpleMailMessage message = new SimpleMailMessage();
message.setTo(mailModel.getTo());
message.setSubject(mailModel.getContent());
message.setText(mailModel.getContent());
javaMailSender.send(message);
}
My applications.properties:
server.port=8082
# Email (MailProperties)
spring.mail.host=smtp.mail.yahoo.com
spring.mail.port=587
spring.mail.username=xyz#yahoo.com
spring.mail.password=ABCD
spring.mail.default-encoding=UTF-8
spring.mail.properties.mail.smtp.auth=true
spring.mail.properties.mail.smtp.ssl.enable=true
spring.mail.properties.mail.smtp.ssl.trust=smtp.mail.yahoo.com
spring.mail.properties.mail.smtp.connectiontimeout=5000
spring.mail.properties.mail.smtp.timeout=5000
spring.mail.properties.mail.smtp.writetimeout=5000
# TLS , port 587
spring.mail.properties.mail.smtp.starttls.enable=true
My Main class
#SpringBootApplication
#ComponentScan("com.emo.rest.mail")
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
I use this dependency:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId>
</dependency>
On start:
javax.mail.MessagingException: Could not connect to SMTP host: smtp.mail.yahoo.com, port: 587
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:2211) ~[jakarta.mail-1.6.4.jar:1.6.4]
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:722) ~[jakarta.mail-1.6.4.jar:1.6.4]
at javax.mail.Service.connect(Service.java:342) ~[jakarta.mail-1.6.4.jar:1.6.4]
at org.springframework.mail.javamail.JavaMailSenderImpl.connectTransport(JavaMailSenderImpl.java:518) ~[spring-context-support-5.2.2.RELEASE.jar:5.2.2.RELEASE]
at org.springframework.mail.javamail.JavaMailSenderImpl.testConnection(JavaMailSenderImpl.java:398) ~[spring-context-support-5.2.2.RELEASE.jar:5.2.2.RELEASE]
at org.springframework.boot.actuate.mail.MailHealthIndicator.doHealthCheck(MailHealthIndicator.java:42) ~[spring-boot-actuator-2.2.2.RELEASE.jar:2.2.2.RELEASE]
at org.springframework.boot.actuate.health.AbstractHealthIndicator.health(AbstractHealthIndicator.java:82) ~[spring-boot-actuator-2.2.2.RELEASE.jar:2.2.2.RELEASE]
at org.springframework.boot.actuate.health.HealthIndicator.getHealth(HealthIndicator.java:37) ~[spring-boot-actuator-2.2.2.RELEASE.jar:2.2.2.RELEASE]
at org.springframework.boot.actuate.health.HealthEndpoint.getHealth(HealthEndpoint.java:81) ~[spring-boot-actuator-2.2.2.RELEASE.jar:2.2.2.RELEASE]
at org.springframework.boot.actuate.health.HealthEndpoint.getHealth(HealthEndpoint.java:38) ~[spring-boot-actuator-2.2.2.RELEASE.jar:2.2.2.RELEASE]
at org.springframework.boot.actuate.health.HealthEndpointSupport.getContribution(HealthEndpointSupport.java:108) ~[spring-boot-actuator-2.2.2.RELEASE.jar:2.2.2.RELEASE]
at org.springframework.boot.actuate.health.HealthEndpointSupport.getAggregateHealth(HealthEndpointSupport.java:119) ~[spring-boot-actuator-2.2.2.RELEASE.jar:2.2.2.RELEASE]
at org.springframework.boot.actuate.health.HealthEndpointSupport.getContribution(HealthEndpointSupport.java:105) ~[spring-boot-actuator-2.2.2.RELEASE.jar:2.2.2.RELEASE]
at org.springframework.boot.actuate.health.HealthEndpointSupport.getHealth(HealthEndpointSupport.java:83) ~[spring-boot-actuator-2.2.2.RELEASE.jar:2.2.2.RELEASE]
at org.springframework.boot.actuate.health.HealthEndpointSupport.getHealth(HealthEndpointSupport.java:70) ~[spring-boot-actuator-2.2.2.RELEASE.jar:2.2.2.RELEASE]
at org.springframework.boot.actuate.health.HealthEndpoint.health(HealthEndpoint.java:75) ~[spring-boot-actuator-2.2.2.RELEASE.jar:2.2.2.RELEASE]
at org.springframework.boot.actuate.health.HealthEndpoint.health(HealthEndpoint.java:65) ~[spring-boot-actuator-2.2.2.RELEASE.jar:2.2.2.RELEASE]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
at org.springframework.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:282) ~[spring-core-5.2.2.RELEASE.jar:5.2.2.RELEASE]
at org.springframework.boot.actuate.endpoint.invoke.reflect.ReflectiveOperationInvoker.invoke(ReflectiveOperationInvoker.java:77) ~[spring-boot-actuator-2.2.2.RELEASE.jar:2.2.2.RELEASE]
at org.springframework.boot.actuate.endpoint.annotation.AbstractDiscoveredOperation.invoke(AbstractDiscoveredOperation.java:60) ~[spring-boot-actuator-2.2.2.RELEASE.jar:2.2.2.RELEASE]
at org.springframework.boot.actuate.endpoint.jmx.EndpointMBean.invoke(EndpointMBean.java:121) ~[spring-boot-actuator-2.2.2.RELEASE.jar:2.2.2.RELEASE]
at org.springframework.boot.actuate.endpoint.jmx.EndpointMBean.invoke(EndpointMBean.java:96) ~[spring-boot-actuator-2.2.2.RELEASE.jar:2.2.2.RELEASE]
at java.management/com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:809) ~[na:na]
at java.management/com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) ~[na:na]
at java.management.rmi/javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1466) ~[na:na]
at java.management.rmi/javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1307) ~[na:na]
at java.management.rmi/javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1399) ~[na:na]
at java.management.rmi/javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:827) ~[na:na]
at java.base/jdk.internal.reflect.GeneratedMethodAccessor43.invoke(Unknown Source) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:359) ~[na:na]
at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:200) ~[na:na]
at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:197) ~[na:na]
at java.base/java.security.AccessController.doPrivileged(Native Method) ~[na:na]
at java.rmi/sun.rmi.transport.Transport.serviceCall(Transport.java:196) ~[na:na]
at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:562) ~[na:na]
at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:796) ~[na:na]
at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:677) ~[na:na]
at java.base/java.security.AccessController.doPrivileged(Native Method) ~[na:na]
at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:676) ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na]
at java.base/java.lang.Thread.run(Thread.java:834) ~[na:na]
Caused by: javax.net.ssl.SSLException: Unsupported or unrecognized SSL message
at java.base/sun.security.ssl.SSLSocketInputRecord.handleUnknownRecord(SSLSocketInputRecord.java:439) ~[na:na]
at java.base/sun.security.ssl.SSLSocketInputRecord.decode(SSLSocketInputRecord.java:184) ~[na:na]
at java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:108) ~[na:na]
at java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1151) ~[na:na]
at java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1062) ~[na:na]
at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:402) ~[na:na]
at com.sun.mail.util.SocketFetcher.configureSSLSocket(SocketFetcher.java:602) ~[jakarta.mail-1.6.4.jar:1.6.4]
at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:376) ~[jakarta.mail-1.6.4.jar:1.6.4]
at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:214) ~[jakarta.mail-1.6.4.jar:1.6.4]
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:2160) ~[jakarta.mail-1.6.4.jar:1.6.4]
... 47 common frames omitted
according to this link Unable to connect to SMTP Port no 465
i use a port 465 an get this error on start:
javax.mail.AuthenticationFailedException: 535 5.7.0 (#AUTH005) Too many bad auth attempts.
at com.sun.mail.smtp.SMTPTransport$Authenticator.authenticate(SMTPTransport.java:947) ~[jakarta.mail-1.6.4.jar:1.6.4]
at com.sun.mail.smtp.SMTPTransport.authenticate(SMTPTransport.java:858) ~[jakarta.mail-1.6.4.jar:1.6.4]
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:762) ~[jakarta.mail-1.6.4.jar:1.6.4]
at javax.mail.Service.connect(Service.java:342) ~[jakarta.mail-1.6.4.jar:1.6.4]
at org.springframework.mail.javamail.JavaMailSenderImpl.connectTransport(JavaMailSenderImpl.java:518) ~[spring-context-support-5.2.2.RELEASE.jar:5.2.2.RELEASE]
at org.springframework.mail.javamail.JavaMailSenderImpl.testConnection(JavaMailSenderImpl.java:398) ~[spring-context-support-5.2.2.RELEASE.jar:5.2.2.RELEASE]
at org.springframework.boot.actuate.mail.MailHealthIndicator.doHealthCheck(MailHealthIndicator.java:42) ~[spring-boot-actuator-2.2.2.RELEASE.jar:2.2.2.RELEASE]
at org.springframework.boot.actuate.health.AbstractHealthIndicator.health(AbstractHealthIndicator.java:82) ~[spring-boot-actuator-2.2.2.RELEASE.jar:2.2.2.RELEASE]
at org.springframework.boot.actuate.health.HealthIndicator.getHealth(HealthIndicator.java:37) ~[spring-boot-actuator-2.2.2.RELEASE.jar:2.2.2.RELEASE]
at org.springframework.boot.actuate.health.HealthEndpoint.getHealth(HealthEndpoint.java:81) ~[spring-boot-actuator-2.2.2.RELEASE.jar:2.2.2.RELEASE]
at org.springframework.boot.actuate.health.HealthEndpoint.getHealth(HealthEndpoint.java:38) ~[spring-boot-actuator-2.2.2.RELEASE.jar:2.2.2.RELEASE]
at org.springframework.boot.actuate.health.HealthEndpointSupport.getContribution(HealthEndpointSupport.java:108) ~[spring-boot-actuator-2.2.2.RELEASE.jar:2.2.2.RELEASE]
at org.springframework.boot.actuate.health.HealthEndpointSupport.getAggregateHealth(HealthEndpointSupport.java:119) ~[spring-boot-actuator-2.2.2.RELEASE.jar:2.2.2.RELEASE]
at org.springframework.boot.actuate.health.HealthEndpointSupport.getContribution(HealthEndpointSupport.java:105) ~[spring-boot-actuator-2.2.2.RELEASE.jar:2.2.2.RELEASE]
at org.springframework.boot.actuate.health.HealthEndpointSupport.getHealth(HealthEndpointSupport.java:83) ~[spring-boot-actuator-2.2.2.RELEASE.jar:2.2.2.RELEASE]
at org.springframework.boot.actuate.health.HealthEndpointSupport.getHealth(HealthEndpointSupport.java:70) ~[spring-boot-actuator-2.2.2.RELEASE.jar:2.2.2.RELEASE]
at org.springframework.boot.actuate.health.HealthEndpoint.health(HealthEndpoint.java:75) ~[spring-boot-actuator-2.2.2.RELEASE.jar:2.2.2.RELEASE]
at org.springframework.boot.actuate.health.HealthEndpoint.health(HealthEndpoint.java:65) ~[spring-boot-actuator-2.2.2.RELEASE.jar:2.2.2.RELEASE]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
at org.springframework.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:282) ~[spring-core-5.2.2.RELEASE.jar:5.2.2.RELEASE]
at org.springframework.boot.actuate.endpoint.invoke.reflect.ReflectiveOperationInvoker.invoke(ReflectiveOperationInvoker.java:77) ~[spring-boot-actuator-2.2.2.RELEASE.jar:2.2.2.RELEASE]
at org.springframework.boot.actuate.endpoint.annotation.AbstractDiscoveredOperation.invoke(AbstractDiscoveredOperation.java:60) ~[spring-boot-actuator-2.2.2.RELEASE.jar:2.2.2.RELEASE]
at org.springframework.boot.actuate.endpoint.jmx.EndpointMBean.invoke(EndpointMBean.java:121) ~[spring-boot-actuator-2.2.2.RELEASE.jar:2.2.2.RELEASE]
at org.springframework.boot.actuate.endpoint.jmx.EndpointMBean.invoke(EndpointMBean.java:96) ~[spring-boot-actuator-2.2.2.RELEASE.jar:2.2.2.RELEASE]
at java.management/com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:809) ~[na:na]
at java.management/com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) ~[na:na]
at java.management.rmi/javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1466) ~[na:na]
at java.management.rmi/javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1307) ~[na:na]
at java.management.rmi/javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1399) ~[na:na]
at java.management.rmi/javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:827) ~[na:na]
at java.base/jdk.internal.reflect.GeneratedMethodAccessor42.invoke(Unknown Source) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:359) ~[na:na]
at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:200) ~[na:na]
at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:197) ~[na:na]
at java.base/java.security.AccessController.doPrivileged(Native Method) ~[na:na]
at java.rmi/sun.rmi.transport.Transport.serviceCall(Transport.java:196) ~[na:na]
at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:562) ~[na:na]
at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:796) ~[na:na]
at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:677) ~[na:na]
at java.base/java.security.AccessController.doPrivileged(Native Method) ~[na:na]
at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:676) ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na]
at java.base/java.lang.Thread.run(Thread.java:834) ~[na:na]
I have an error while accessing localhost:9000 the very first time. this is my first 'play run' command. I'm new in play framework and in browser it is written: Compilation failed without reporting any problem!?.
Controller`s code is default:
public class Application extends Controller {
public static Result index() {
return ok(index.render("Your new application is ready."));
}
}
Version of play 2.0.
And my stacktrace in log file is folowing:
2012-06-22 10:25:29,937 - [INFO] - from play in main
Listening for HTTP on port 9001...
2012-06-22 10:25:43,292 - [ERROR] - from application in New I/O server worker #1-1
! Internal server error, for request [GET /] ->
play.api.UnexpectedException: Unexpected exception [Compilation failed without reporting any problem!?]
at sbt.PlayReloader$$anon$2$$anonfun$reload$3$$anonfun$2$$anonfun$apply$11$$anonfun$apply$13.apply(PlayReloade r.scala:225) ~[na:na]
at sbt.PlayReloader$$anon$2$$anonfun$reload$3$$anonfun$2$$anonfun$apply$11$$anonfun$apply$13.apply(PlayReloade r.scala:225) ~[na:na]
at scala.Option.getOrElse(Option.scala:108) ~[scala-library.jar:0.11.2]
at sbt.PlayReloader$$anon$2$$anonfun$reload$3$$anonfun$2$$anonfun$apply$11.apply(PlayReloader.scala:224) ~ [na:na]
at sbt.PlayReloader$$anon$2$$anonfun$reload$3$$anonfun$2$$anonfun$apply$11.apply(PlayReloader.scala:221) ~[na:na]
at scala.Option.map(Option.scala:133) ~[scala-library.jar:0.11.2]
at sbt.PlayReloader$$anon$2$$anonfun$reload$3$$anonfun$2.apply(PlayReloader.scala:221) ~[na:na]
at sbt.PlayReloader$$anon$2$$anonfun$reload$3$$anonfun$2.apply(PlayReloader.scala:219) ~[na:na]
at scala.Either$LeftProjection.map(Either.scala:183) ~[scala-library.jar:0.11.2]
at sbt.PlayReloader$$anon$2$$anonfun$reload$3.apply(PlayReloader.scala:219) ~[na:na]
at sbt.PlayReloader$$anon$2$$anonfun$reload$3.apply(PlayReloader.scala:214) ~[na:na]
at scala.Option.getOrElse(Option.scala:108) ~[scala-library.jar:0.11.2]
at sbt.PlayReloader$$anon$2.reload(PlayReloader.scala:214) ~[na:na]
at play.core.ReloadableApplication$$anonfun$get$1.apply(ApplicationProvider.scala:110) ~[play_2.9.1.jar:2.0]
at play.core.ReloadableApplication$$anonfun$get$1.apply(ApplicationProvider.scala:110) ~[play_2.9.1.jar:2.0]
at akka.dispatch.Future$$anon$3.liftedTree1$1(Future.scala:195) ~[akka-actor.jar:2.0]
at akka.dispatch.Future$$anon$3.run(Future.scala:194) ~[akka-actor.jar:2.0]
at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:83) ~[akka-actor.jar:2.0]
at akka.jsr166y.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1381) ~[akka-actor.jar:2.0]
at akka.jsr166y.ForkJoinTask.doExec(ForkJoinTask.java:259) ~[akka-actor.jar:2.0]
at akka.jsr166y.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:997) ~[akka-actor.jar:2.0]
at akka.jsr166y.ForkJoinPool.runWorker(ForkJoinPool.java:1495) ~[akka-actor.jar:2.0]
at akka.jsr166y.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104) ~[akka-actor.jar:2.0]
sbt.compiler.CompileFailed: null
at sbt.compiler.JavaCompiler$$anon$1.apply(JavaCompiler.scala:26) ~[na:na]
at sbt.AggressiveCompile$$anonfun$5$$anonfun$compileJava$1$1.apply$mcV$sp(AggressiveCompile.scala:76) ~[na:na]
at sbt.classfile.Analyze$.apply(Analyze.scala:93) ~[na:na]
at sbt.AggressiveCompile$$anonfun$5.compileJava$1(AggressiveCompile.scala:75) ~[na:na]
at sbt.AggressiveCompile$$anonfun$5.apply(AggressiveCompile.scala:79) ~[na:na]
at sbt.AggressiveCompile$$anonfun$5.apply(AggressiveCompile.scala:57) ~[na:na]
at sbt.inc.IncrementalCompile$$anonfun$doCompile$1.apply(Compile.scala:21) ~[na:na]
at sbt.inc.IncrementalCompile$$anonfun$doCompile$1.apply(Compile.scala:19) ~[na:na]
at sbt.inc.Incremental$.cycle(Incremental.scala:33) ~[na:na]
at sbt.inc.Incremental$.compile(Incremental.scala:20) ~[na:na]
at sbt.inc.IncrementalCompile$.apply(Compile.scala:17) ~[na:na]
at sbt.AggressiveCompile.compile2(AggressiveCompile.scala:87) ~[na:na]
at sbt.AggressiveCompile.compile1(AggressiveCompile.scala:41) ~[na:na]
at sbt.AggressiveCompile.apply(AggressiveCompile.scala:28) ~[na:na]
at sbt.Compiler$.apply(Compiler.scala:107) ~[na:na]
at sbt.Defaults$$anonfun$compileTask$1.apply(Defaults.scala:479) ~[na:na]
at sbt.Defaults$$anonfun$compileTask$1.apply(Defaults.scala:479) ~[na:na]
at sbt.Scoped$$anonfun$hf2$1.apply(Structure.scala:473) ~[na:na]
at sbt.Scoped$$anonfun$hf2$1.apply(Structure.scala:473) ~[na:na]
at scala.Function1$$anonfun$compose$1.apply(Function1.scala:41) ~[scala-library.jar:0.11.2]
at sbt.Scoped$Reduced$$anonfun$combine$1$$anonfun$apply$11.apply(Structure.scala:295) ~[na:na]
at sbt.Scoped$Reduced$$anonfun$combine$1$$anonfun$apply$11.apply(Structure.scala:295) ~[na:na]
at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40) ~[na:na]
at sbt.std.Transform$$anon$5.work(System.scala:67) ~[na:na]
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:221) ~[na:na]
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:221) ~[na:na]
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:18) ~[na:na]
at sbt.Execute.work(Execute.scala:227) ~[na:na]
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:221) ~[na:na]
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:221) ~[na:na]
at sbt.CompletionService$$anon$1$$anon$2.call(CompletionService.scala:26) ~[na:na]
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) ~[na:1.7.0_01]
at java.util.concurrent.FutureTask.run(Unknown Source) ~[na:1.7.0_01]
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[na:1.7.0_01]
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) ~[na:1.7.0_01]
at java.util.concurrent.FutureTask.run(Unknown Source) ~[na:1.7.0_01]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [na:1.7.0_01]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [na:1.7.0_01]
at java.lang.Thread.run(Unknown Source) [na:1.7.0_01]
Maybe you use another different java version. I created a project A and compiled it using java 6. Now I update my java to 7. So problem occur! Then I run it using java 6! Problem dealt;
But I don't know how to run it in java7. I have tried to clean and compile but also failed. Let me try other methods!
Have you tried going to http://localhost:9001? Since your server is Listening for HTTP on port 9001... this may be the right path ; )