Win a copy of Machine Learning Systems: Designs that scale this week in the Scala forum
or Xamarin in Action: Creating native cross-platform mobile apps in the Android forum!

Alejandro Barrero

Ranch Hand
+ Follow
since Aug 01, 2005
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Alejandro Barrero

Added a final property, but the errors continued.
Set name to final and the assignment in the constructor is an error.
2 weeks ago

In STS, I am getting the errors
Duplicate method Ingredient() in type Ingredient /taco-cloud/src/main/java/tacos line 12 Java Problem
Duplicate method Ingredient() in type Ingredient /taco-cloud/src/main/java/tacos line 13 Java Problem
Lines 12 and 13 are the lines with the annotations. Why does the compiler thinks that there are two constructors? The problem continues even if I comment out the constructor.
2 weeks ago

I get the errors
Uncaught Error: Template parse errors: Unexpected closing tag "button". It may happen when the tag has already been closed by another tag.
Unexpected closing tag "th". It may happen when the tag has already been closed by another tag.

Searching the web it appears to be a problem with webpack, but I don't know how to handle it.
My apologies; I didn't explained my problem correctly.
Initially I have a simple application created with Angular/cli.
joke.component.ts in src/app/jokes (I want a separate folder for the functionality,jokes)

I use tag 'joke' in app.component.ts as follows

I am not importing joke.component.ts because I have imported and declared it in app.module.ts

What I am seeing is that anything imported and declared in app.module.ts is available to other components (In this case app.component).
For a large program with multiple functionality, I want to create components for different functionalities in separate folders. What I don't want is to import every component in app.module.ts; For every functionality I want to create a module like joke.module.ts

In this module I import and declare the components for the functionality and I was hoping that importing and declaring these modules in app.module.ts would work, but It didn't.
I want to use module joke.module.ts to specify multiple components; in this case I start with JokeComponent in joke/joke.module.ts in src/app; I have this component in src/app/joke

In app.component.ts I want to use joke/joke.module.ts and use the tag 'joke'

I have create module joke.module.ts in src/app/joke

However, when I run the application I am getting the error
Uncaught Error: Template parse errors: 'joke' is not a known element:
1. If 'joke' is an Angular component, then verify that it is part of this module.
Thanks to all; I solved the problem by unzipping objenesis-1.2.jar and added the code to the project.
2 months ago
To answer all the questions; this is what I get running the jar file:

C:\Workspaces\JAR Files>java -jar paperless.jar
java.lang.NoClassDefFoundError: org/objenesis/Objenesis
        at com.paperless.main.PropertiesDialog.dbFileOk(

As I mentioned in a previous response, org/objenesis/Objenesis class shows in the jar file after I unzipped it.
2 months ago
Thank you for your prompt reply. I have no intention of using the classpath; I only posted what is in the jar file. The jar file is created by Eclipse and until yesterday it was working fine. If worse comes to worse, I am willing to modify the jar file, but someone has to tell me how.
2 months ago
Further clarification. The error I receive when executing a batch file with contents "java -jar paperless.jar" is "java.lang.NoClassDefFoundError: org/objenesis/Objenesis"; however, after I unzipped the jar file the file ".classpath" contains:

After unzipping objenesis-2.6.jar I found out that the class is there.
2 months ago
I have an application in Eclipse that runs fine in Eclipse. I have been testing it as a jar file for some time, but today I got the error java.lang.NoClassDefFoundError. After browsing the Internet I have found many discussions but no solution; I have also read answers to similar questions in this forum. Please tell me what do I have to look inside the jar file or what log do I have to look into.
2 months ago
Nowadays double click doesn't work; I'll have to create a bat file wit "java -jar".
2 months ago
Thanks to all. I decided to access the file from the current directory and it is working in Eclipse debug. I am testing on the jar file, but unfortunately the jar file doesn't run; even a jar file from a program with a single class to print "Hello" is not working in Eclipse. I am creating a ne question in this forum.
2 months ago
Thank you for your prompt response. Well, things have changed. My problem now is that I have to find the OutputStream  for the file and I only have the  InputStream from this code:

I am going to dig  for an answer; I would appreciate it if you can help me with this.
2 months ago
This is my code:

PAPERLESS_KEY is "databasepath". In the file I only have the line "databasepath=NO". properties.getProperty is retrieving "NO". roperties.setProperty is returning "NO", but is not setting the vale in the file.
2 months ago
I still don't understand why my old code was generating a huge number of duplicate random numbers

New code with an idea from Carey Brown works like a charm.
8 months ago