Win a copy of Mastering Corda: Blockchain for Java Developers this week in the Cloud/Virtualization forum!

AgustinC Cardeilhac Banus

Greenhorn
+ Follow
since Dec 23, 2017
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
2
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 AgustinC Cardeilhac Banus

Hi !. I have an issue with the schema from JSF HTML, JSF Core And Primefaces... I have searched a lot and some people say that the following is incorrect:
http://java.sun.com/jsf/core

as other url should be used. The thing is that I have look into jar files to see if I can find the schema for this and I cant work it out...

I am using IntelliJ Idea 2019.3 and my pom file looks like this:


Is there any way to solve this ?. Because Itwould be of great help... If more detailsneed to be provided, please tell me...
1 week ago
HI Campbell !. There isnt code to show; I didnt find a way to upload the pic so I used my google drive... This is happening without even coding anything... I downloaded the zip file, then uncompress it, opened with intellij and then try to run the main class (previously downloaded the dependencies)... No more than that...
By the way, is there a functionality to upload images ?... Havent seen it...
4 months ago
Hi Guys !. While trying to start a spring boot (I was asked to nake a deep dive into spring security), I entered the following the spring initializr to download the skeleton:
https://drive.google.com/file/d/11zSWORLubWQmKbyzcM-TR62xRntC0Nxd/view?usp=sharing
The image above show the configuration...

But when I try to run the main class (without even coding anything), it says something like:
Error: Could not find or load main class com.example.demo.DemoApplication

I cant realize why this is happening because I have another project which is working and I have the same config...
4 months ago
Dave Tolls. Thanks for answering... Sorry about the delay... It seems some columns of my table had values and they were of type Blob and the java type was not suitable I believe. Thankx for your time
Hi Guys !. I have the following Serialization issue while reading from the database with the Hibernate ORM:
org.hibernate.type.SerializationException: could not deserialize......

java.io.EOFException
java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2675)
java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:3150)
java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:859)
java.io.ObjectInputStream.<init>(ObjectInputStream.java:355)
org.hibernate.internal.util.SerializationHelper$CustomObjectInputStream.<init>(SerializationHelper.java:328)
org.hibernate.internal.util.SerializationHelper$CustomObjectInputStream.<init>(SerializationHelper.java:318)
org.hibernate.internal.util.SerializationHelper.doDeserialize(SerializationHelper.java:237)
org.hibernate.internal.util.SerializationHelper.deserialize(SerializationHelper.java:306)
org.hibernate.type.descriptor.java.SerializableTypeDescriptor.fromBytes(SerializableTypeDescriptor.java:155)
org.hibernate.type.descriptor.java.SerializableTypeDescriptor.wrap(SerializableTypeDescriptor.java:130)
org.hibernate.type.descriptor.java.SerializableTypeDescriptor.wrap(SerializableTypeDescriptor.java:44)
org.hibernate.type.descriptor.sql.VarbinaryTypeDescriptor$2.doExtract(VarbinaryTypeDescriptor.java:71)
org.hibernate.type.descriptor.sql.BasicExtractor.extract(BasicExtractor.java:64)
org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:267)
org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:263)
org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:253)
org.hibernate.type.AbstractStandardBasicType.hydrate(AbstractStandardBasicType.java:338)
org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2969)
org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1695)
org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1627)
org.hibernate.loader.Loader.getRow(Loader.java:1514)
org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:725)
org.hibernate.loader.Loader.processResultSet(Loader.java:952)
org.hibernate.loader.Loader.doQuery(Loader.java:920)
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:354)
org.hibernate.loader.Loader.doList(Loader.java:2553)
org.hibernate.loader.Loader.doList(Loader.java:2539)
org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2369)
org.hibernate.loader.Loader.list(Loader.java:2364)
org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:126)
org.hibernate.internal.SessionImpl.list(SessionImpl.java:1682)
org.hibernate.internal.CriteriaImpl.list(CriteriaImpl.java:380)
com.dgs.databaseServices.dao.impl.GroupsDaoImpl.getRootNodes(GroupsDaoImpl.java:196)

Any clue of why I am getting this ???
Because non of the data types involved are not Serializable !... I dont know what to do...

I am getting this error while reading the following entity:



I am using Java 8 with the following Spring and Hibernate versions:
1) Spring Framework: 4.3.0.RELEASE
2) Spring Security: 4.2.2.RELEASE
3) Hibernate: 4.3.6.FINAL
4) MySQL Connector: 5.1.31
     
Obviously, the code in the image needs some structure and order, but at least I could manage to to see what was the magic needed with yours help. Thankx again
3 years ago
Here it's me again... The thing I did to solve the issue was the following:
Considering the following image:
Raw Code

I made a code to load a controller class with all the related dependencies. To avoid the need of the user to provide parameters, I did the following:
1) Read the application POM file and get the 'dependencies' tag.
2) Get a reference to the Maven Local Repo and with all the related dependencies from the application (Point 1), I got a list (List<File>) of JARS needed to load the classes annotated with "Controller" or "RestController".
3) Create a "URLClassLoader" object which receives an array of type "URL[]" (which would I would be getting by applying the intermediate operation "map" and doing to every file ".toURL()").
4) Then, when loading a controller in the following way ("com.sports.soccer.PlayerController"), the loading won't fail as the JAR dependencies would be load also. In the URL array from point 3, it should be added a reference to the bytecode dir of the app.

Thankx for all the help.
3 years ago
Guys... I am currently doing my gym routine but I was able to to solve the issue. I will post a picture hosted in my google drive as soon as I get to my house. Thankx for all the replies...
3 years ago
I was able to load a class from my hosted application, but a simple one. Zero related dependencies. When I try to load a controller, it seems that it tries to load the associated dependencies and the loading fails.
Please cheack the attached picture...
3 years ago
Rob. I am trying to run my maven plugin as a standalone one... No relation to any maven phase... Should I change this in order to be able to load them in class files ?.
3 years ago
Hi Knute Storm. Thankx for your reply. No, I wouldnt be needing to access that dir. What I am needing is to create a "Class" instance of every RestController / Controller, so as to get or obtain metadata of it by reflection.

I could read the dir "src/main/java" but I am not able to create the class instances. Its like being and not being inside the context of my webapp.
3 years ago
Hi Guys !. I am building a Maven plugin to read the classpath from my webapp and then filter if the class is a controller or a service or something else. I could read the "/src/main/java" dir but I wasnt able to get a class intance from the .java files as I keep on getting "ClassNotFoundException". How could I bypass this and get this instance ?. Is there an object from the plugincontext that allows this ?.
For example: In my WebApp, I could have:
com.sports.soccer.ManagerController

From my maven plugin, I would need to do something like:
Class.forName("com.sports.soccer.ManagerController").isAnnotationPresent(Controller.class)

To check if the class is a controller !. Obviously this is an example... I would be reading the classpath and the amount of controllers would not be always the same from project to project....
3 years ago