Cannot get play-mailer gives cannot find symbol - intellij-idea

When trying to use the player-mailer plugin I get the following error while compiling:
[error] /Users/Luuk/Documents/Java/Y2kBooking/app/logic/support/Mails.java:4: package play.libs.mailer does not exist
[error] play.libs.mailer.Email
[error] /Users/Luuk/Documents/Java/Y2kBooking/app/logic/support/Mails.java:5: package play.libs.mailer does not exist
[error] play.libs.mailer.MailerClient
[error] /Users/Luuk/Documents/Java/Y2kBooking/app/logic/support/Mails.java:14: cannot find symbol
[error] symbol: class MailerClient
[error] location: class logic.support.Mails
[error] MailerClient
app/logic/support/Mails.java:24: cannot find symbol
[error] symbol: class Email
[error] location: class logic.support.Mails
This is my mailer:
package logic.support;
import play.Configuration;
import play.libs.mailer.Email;
import play.libs.mailer.MailerClient;
import javax.inject.Inject;
public class Mails {
#Inject
MailerClient mailerClient;
public void sendLoggerEmail(String message, Exception e) {
String fullMessage = "The following error occured:\n" + message;
if (e != null) {
fullMessage += "\n\n" + "Error message:\n" + e.getMessage() + "\n\nStacktrace\n" + org.apache.commons.lang3.exception.ExceptionUtils.getStackTrace(e);
}
Email email = new Email();
email.setSubject("Booking application warning");
email.setFrom("Booking system FROM <" + Configuration.root().getString("adminEmail") + ">");
email.addTo("Webmaster TO <" + Configuration.root().getString("adminEmail") + ">");
email.setBodyText(fullMessage);
mailerClient.send(email);
}
}
In build.sbt:
libraryDependencies ++= Seq( javaJdbc , cache , javaWs , evolutions , "mysql" % "mysql-connector-java" % "5.1.18", "org.mockito" % "mockito-core" % "1.10.19" % "test", "com.typesafe.play" %% "play-mailer" % "3.0.1")
I did clean the project and rebuild, but always the same. I am using Play (Java) 2.4.4
[Edit:]
The jar is present, and IDEA has no problem with it, so it seems that it is just not available at runtime.
[Edit2:]
The problem seems only when Debugging with IDEA. Running from the terminal with activator works fine.

I discovered that it was a problem with the debugging session of IDEA.
Restarting everything solved the problem.

Related

My Kotlinplugin for Minecraft is not working

My Plugin for Fabric 1.19.3 makes an error when i perform a command in chat
Here is the code for the command class
package me.lukas.mcplugin1.commands
import net.kyori.adventure.text.Component
import net.kyori.adventure.text.format.TextColor
import org.bukkit.command.Command
import org.bukkit.command.CommandExecutor
import org.bukkit.command.CommandSender
class TestCommand : CommandExecutor {
override fun onCommand(sender: CommandSender, command: Command, label: String, args: Array<out String>?): Boolean {
sender.sendMessage(Component.text("Test").color(TextColor.color(0 ,200, 0)))
return false
}
}
And Here is the code for the main class
package me.lukas.mcplugin1
import me.lukas.mcplugin1.commands.JumpCommand
import me.lukas.mcplugin1.commands.TestCommand
import org.bukkit.plugin.java.JavaPlugin
class McPlugin1 : JavaPlugin() {
override fun onEnable() {
// Plugin startup logic
logger.info("Du hast es geschafft !")
registerCommands()
}
private fun registerCommands () {
getCommand("jump")?.setExecutor(JumpCommand())
getCommand("test")?.setExecutor(TestCommand())
logger.info("Registered Commands")
}
override fun onDisable() {
// Plugin shutdown logic
logger.info("Tschüss")
}
}
Can anyone Help Me to find the error
I expected that i get the message "test" but it gave me an error
here is the serverconsole error after i enterd the command
[17:54:59 WARN]: Unexpected exception while parsing console command "test"
org.bukkit.command.CommandException: Unhandled exception executing command 'test' in plugin Loginplugin v1.0-SNAPSHOT
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[paper-api-1.19.3-R0.1-SNAPSHOT.jar:?]
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:155) ~[paper-api-1.19.3-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_19_R2.CraftServer.dispatchCommand(CraftServer.java:929) ~[paper-1.19.3.jar:git-Paper-365]
at org.bukkit.craftbukkit.v1_19_R2.CraftServer.dispatchServerCommand(CraftServer.java:892) ~[paper-1.19.3.jar:git-Paper-365]
at net.minecraft.server.dedicated.DedicatedServer.handleConsoleInputs(DedicatedServer.java:494) ~[paper-1.19.3.jar:git-Paper-365]
at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:441) ~[paper-1.19.3.jar:git-Paper-365]
at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1397) ~[paper-1.19.3.jar:git-Paper-365]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1173) ~[paper-1.19.3.jar:git-Paper-365]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:316) ~[paper-1.19.3.jar:git-Paper-365]
at java.lang.Thread.run(Thread.java:1589) ~[?:?]
Caused by: java.lang.NoClassDefFoundError: kotlin/jvm/internal/Intrinsics
at me.lukas.mcplugin1.commands.TestCommand.onCommand(TestCommand.kt) ~[Mcplugin1.0.jar:?]
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[paper-api-1.19.3-R0.1-SNAPSHOT.jar:?]
... 9 more
Caused by: java.lang.ClassNotFoundException: kotlin.jvm.internal.Intrinsics
at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:177) ~[paper-api-1.19.3-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:124) ~[paper-api-1.19.3-R0.1-SNAPSHOT.jar:?]
at java.lang.ClassLoader.loadClass(ClassLoader.java:521) ~[?:?]
at me.lukas.mcplugin1.commands.TestCommand.onCommand(TestCommand.kt) ~[Mcplugin1.0.jar:?]
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[paper-api-1.19.3-R0.1-SNAPSHOT.jar:?]
... 9 more

Ceph RGW unable to upload object if JaegerTracing is implemented

OS : ubuntu 18.04
ceph : octopus
jaeger : master
When I implement jaegertracer in the function that is responsibe for writing file to ceph via RGW, I am unable to upload my file Im getting this error
Warning: failed to create container 'mycontainer': HTTPConnectionPool(host='localhost', port=8000): Max retries exceeded with url: /auth (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f5076b7a990>: Failed to establish a new connection: [Errno 111] Connection refused',))
But when I remove my tracer from the code it uploads the file successfully
source code
void librados::IoCtxImpl::queue_aio_write(AioCompletionImpl *c)
{
auto yaml = YAML::LoadFile("tracerConfig.yaml");
auto config = jaegertracing::Config::parse(yaml);
auto tracer=jaegertracing::Tracer::make(
"Writing",
config,
jaegertracing::logging::consoleLogger()
);
opentracing::Tracer::InitGlobal(
static_pointer_cast<opentracing::Tracer>(tracer)
);
auto span = opentracing::Tracer::Global()->StartSpan("Span1");
get();
ofstream file;
file.open("/home/abhinav/Desktop/write.txt",std::ios::out | std::ios::app);
file<<"Writing /src/librados/IoCtxImpl.cc 288.\n";
file.close();
std::scoped_lock l{aio_write_list_lock};
ceph_assert(c->io == this);
c->aio_write_seq = ++aio_write_seq;
ldout(client->cct, 20) << "queue_aio_write " << this << " completion " << c
<< " write_seq " << aio_write_seq << dendl;
aio_write_list.push_back(&c->aio_write_list_item);
opentracing::Tracer::Global()->Close();
}
When I remove the tracer it compiles fine again
The issue was related to yaml file parsing

while running Rabbit mqqt getting error

I have copied rabbit mqqt code from one article.
import org.eclipse.paho.client.mqttv3.MqttClient;
import org.eclipse.paho.client.mqttv3.MqttConnectOptions;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.eclipse.paho.client.mqttv3.MqttMessage;
public class MqttPublishSample {
public static void main(String[] args) {
String topic = "MQTT Examples";
String content = "Message from MqttPublishSample";
int qos = 0;
String broker = "tcp://127.0.0.1:1883";
String clientId = "pahomqttpublish1";
try {
MqttClient sampleClient = new MqttClient(broker, clientId);
MqttConnectOptions connOpts = new MqttConnectOptions();
connOpts.setUserName("guest");
connOpts.setPassword("guest".toCharArray());
connOpts.setCleanSession(true);
System.out.println("Connecting to broker: " + broker);
sampleClient.connect(connOpts);
System.out.println("Connected");
System.out.println("Publishing message: " + content);
MqttMessage message = new MqttMessage(content.getBytes());
message.setQos(qos);
sampleClient.publish(topic, message);
System.out.println("Message published");
sampleClient.disconnect();
System.out.println("Disconnected");
System.exit(0);
} catch (MqttException me) {
System.out.println("reason " + me.getReasonCode());
System.out.println("msg " + me.getMessage());
System.out.println("loc " + me.getLocalizedMessage());
System.out.println("cause " + me.getCause());
System.out.println("excep " + me);
me.printStackTrace();
}
}
}
Getting error while running this code this not Qos issue
error while connecting sampleClient.connect(connOpts);
**Error on console **
Connecting to broker: tcp://127.0.0.1:1883
reason 32109
msg Connection lost
loc Connection lost
cause java.io.EOFException
excep Connection lost (32109) - java.io.EOFException
Connection lost (32109) - java.io.EOFException atrg.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:146) at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.EOFException at java.io.DataInputStream.readByte(DataInputStream.java:267) at rg.eclipse.paho.client.mqttv3.internal.wire.MqttInputStream.readMqttWireMessage(MqttInputStream.java:65) at org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:107)
Rabbitmq error log
=ERROR REPORT==== 19-Aug-2016::17:24:54 ===
** Generic server <0.469.0> terminating
** Last message in was
{inet_async,#Port<0.12379>,4714,{ok,[16,42,0,4,77,81,84,84,4,194,0,60,0,16,112,97,104,111,109,113,116,116,112,117,98,108,105,
115,104,49,0,5,103,117,101,115,116,0,5,103,117,101,115,116]}}`
** When Server state == {state,#Port<0.12379>,"127.0.0.1:34033 -> 127.0.0.1:1883",true,running,false,none,{proc_state,#Port<0.12379>,
{dict,0,16,16,8,80,48,{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},{{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
{undefined,undefined},{0,nil},{0,nil},undefined,1,undefined,undefined,undefined,{undefined,undefined},undefined,<<"amq.topic">>}}
Reason for termination ==
{{badfun,none},[{rabbit_mqtt_frame,parse,2,[{file,"rabbitmq-mqtt/src/rabbit_mqtt_frame.erl"},{line,39}]},
{rabbit_mqtt_reader,process_received_bytes,2,[{file,"rabbitmq-mqtt/src/rabbit_mqtt_reader.erl"},{line,136}]},{gen_server2,handle_msg,2,[{file,"src/gen_server2.erl"},{line,934}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]}
I think you have installed Rabitmq 3.2.5 through apt-get, please install new version of rabitmq 3.6.5 find here here then try

How do you include multiple activities in the Gradle Liquibase plugin's runList field?

I’m using Gradle 2.7 on Mac Yosemite with Java 8. I’m using the Liquibase 1.1.1 plugin and would like to use it to do a couple of activities (build a test database and build my normal database). So I have
liquibase {
activities {
main {
File propsFile = new File("${project.rootDir}/src/main/resources/liquibase.properties")
Properties properties = new Properties()
properties.load(new FileInputStream(propsFile))
changeLogFile 'src/main/resources/db.changelog-master.xml'
url properties['url']
username properties['username']
password properties['password']
}
test {
url 'jdbc:h2:file:target/testdb'
username 'sa'
}
runList = (
"test"
"main"
)
}
}
But I can’t figure out the proper syntax for runList. I get the error when running the above …
* Where:
Build file '/Users/myuser/Dropbox/cb_workspace/cbmyproject/build.gradle' line: 163
* What went wrong:
Could not compile build file '/Users/myuser/Dropbox/cb_workspace/cbmyproject/build.gradle'.
> startup failed:
build file '/Users/myuser/Dropbox/cb_workspace/cbmyproject/build.gradle': 163: expecting ')', found 'main' # line 163, column 2.
"main"
^
1 error
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
According to one of there example, the runList must be placed after the activity block:
liquibase {
activities {
main {
File propsFile = new File("${project.rootDir}/src/main/resources/liquibase.properties")
Properties properties = new Properties()
properties.load(new FileInputStream(propsFile))
changeLogFile 'src/main/resources/db.changelog-master.xml'
url properties['url']
username properties['username']
password properties['password']
}
test {
url 'jdbc:h2:file:target/testdb'
username 'sa'
}
}
runList = 'test, main'
}
See the example here.
Hope this helps.

Uncaught Error: no such table: test (code 1):

I'm using titanium and testing against an android emulator - but any advice relevant to iOs is also welcome! i am trying to use titanium with a database. I'm using the firefox sql lite plugin to make my db - so i make it, and then i go
var databasewindow=Ti.UI.createWindow({
width:Ti.UI.SIZE,
height:Ti.UI.SIZE,
backgroundColor:"#bb7711",
color:"#fff",
font: { fontSize:48 },
fontFamily:'BurnstownDam-Regular',
layout: 'vertical'
});
var db=Titanium.Database.install('test.sqlite','test');
db.close();
var db = Ti.Database.open('test');
//db.execute('INSERT INTO test(name,age) VALUES('Humayoon','25')');
db.execute('INSERT INTO test(name) VALUES ("Humayoon")');
//db.execute('INSERT INTO test("name","age") VALUES ("'+'Zohaib'+'","'+'23'+'")');
var sql=db.execute('SELECT * FROM test');
while (sql.isValidRow())
{
//var cityId = sql.fieldByName('id');
var Name = sql.fieldByName('name');
//var cityContinent = sql.fieldByName('age');
Ti.API.info(Name);
sql.next();
}
sql.close();
db.close();
databasewindow.open();
error here
[ERROR] : TiExceptionHandler: (main) [134,134] ----- Titanium
Javascript Runtime Error ----- [ERROR] : TiExceptionHandler: (main)
[0,134] - In app.js:15,4 [ERROR] : TiExceptionHandler: (main)
[1,135] - Message: Uncaught Error: no such table: test (code 1): ,
while compiling: INSERT INTO test(name) VALUES ("Humayoon") [ERROR] :
TiExceptionHandler: (main) [0,135] - Source: db.execute('INSERT INTO
test(name) VALUES ("Humayoon")'); [ERROR] : V8Exception: Exception
occurred at app.js:15: Uncaught Error: no such table: test (code 1):
, while compiling: INSERT INTO test(name) VALUES ("Humayoon") [ERROR]
: File: fail readDirectory() errno=2