Win a copy of Event Streams in Action this week in the Java in General forum!

Henrique Ordine

Ranch Hand
+ Follow
since Sep 03, 2004
Brasília - Brazil
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Henrique Ordine

In the OCPJP 8 certification topics, they have this under Java Collections:

- Search for data by using methods, such as findFirst(), findAny(), anyMatch(), allMatch(), and noneMatch()

There are no such methods in Collections though. Don't they mean in streams?

And then they also have this under the same header:

- Develop code that uses the merge(), flatMap(), and map() methods on Java Streams

But they have another header called Java Streams. That's just confusing.
Funny, this.

You can have an Integer in the switch() statement but not in a case statement.
This is ok:


Hi Melinda,

I've tried the same thing, but we use MySQL 5 here. I'm still getting a NoSuchTable error. I read on another forum somewhere, that someone could run his test with Postgree, but had trouble with MySQL. Someone else told him to use DBUnit 2.4.4, but I tried that and I still get the same error.

Is it possible to make DBUnit insert records in 2 different MySQL DataBases/Schemas?

Thanks in advance.
7 years ago
Hi McCormick,

Did you ever manage to solve your problem? I'm getting the same error.

It seems that at runtime some class can't be found (hence the message NoClassDefFoundError) but the name of that class gets lost along the Exception Handling process.

In my classpath, both LogManager and Logger exist.

It's funny that the code seems to fail inside my ThinMPI class, where I do this:


Can anyone help?
7 years ago
Alright, my colleague that I don't even like helped me out. I needed to run mvn eclipse:myeclipse from the command line and then refresh my Eclipse project, and it worked.

Thanks anyway.
7 years ago
Hi everyone,

I've created a new Java Maven Project on Eclipse and I added a DBUnit dependency to my POM, like this:

<dependency>
<groupId>dbunit</groupId>
<artifactId>dbunit</artifactId>
<version>2.1</version>
<scope>test</scope>
</dependency>

Then I ran mvn install from my project's home directory.

When I create a new Class is my src.test.java directory and try to extend DBTestCase, that class is not found.

Isn't it that simple?

Thanks in advance for any help.
7 years ago
Yep, alright, I started a remote app debug configuration and it worked.

Sorry about that, thanks anyway.
7 years ago
I'm debugging from MyEclipse and I started up tomcat from the command line with "mvn cargo:start", so maybe that's the problem.
7 years ago
Hi everyone,

I'm running a JUnit test on a servlet and according to logs the execution does reach my servlet but it doesn't stop at the breakpoints that I set there. It does stop at breakpoints in my test class.
Does anyone know why?

Thanks in advance.

Here's my Test class:


And here's what tomcat's log file says:

[2011-10-14 09:55:13,567] [080-Processor24] DEBUG [eu.liquix.smsservice.tmobile.DeliveryServlet ] : > process()
[2011-10-14 09:55:13,567] [080-Processor24] DEBUG [eu.liquix.smsservice.tmobile.DeliveryServlet ] : It contains [1] message(s)
[2011-10-14 09:55:13,567] [080-Processor24] ERROR [eu.liquix.smsservice.tmobile.DeliveryServlet ] : Failed to process SMS message.
java.lang.NumberFormatException: For input string: "TO"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
at java.lang.Integer.parseInt(Integer.java:449)
at eu.liquix.smsservice.tmobile.DeliveryServlet.convertToASCII(DeliveryServlet.java:145)
at eu.liquix.smsservice.tmobile.DeliveryServlet.process(DeliveryServlet.java:112)
at eu.liquix.smsservice.tmobile.DeliveryServlet.doPost(DeliveryServlet.java:51)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:663)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:637)
7 years ago
I still have doubts about the last solution to the previous problem.

Are they assuming that if A<B then A is one of the lighter coins and B is not? If so, they said that the lighter coins don't necessarily need to have the same weight, so how do you know that they're not both the lighter coins. <br /> <br /> Also, are they assuming that if then they must be both original coins? If so, how do they know that they're not both lighter coins that coincidentally weigh the same weight?>
Oh, thát kind of balance. Yes, makes sense, sorry about that.
Nice try.

1:A
2:B
3:C
4:D

I stopped counting after that.
That's a lot more than 3 weighings.
The problem is not that there's a class missing somewhere, but that you haven't set a connection URL to your Connection.
You can, but if A is a column in the Table table, then you need to do something like this:

Select t.A as B from table as t