This week's book giveaway is in the Programmer Certification forum.
We're giving away four copies of OCP Oracle Certified Professional Java SE 21 Developer Study Guide: Exam 1Z0-830 and have Jeanne Boyarsky & Scott Selikoff on-line!
See this thread for details.

Bernardo Hermont

Greenhorn
+ Follow
since May 20, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Bernardo Hermont

Hi everyone!

Thanks for the replies.

Will last more means that it will take longer to complete.
I just thinking about the logging strategy, I'm not writing any code.

Regards

Bernardo
Hey fellows,

For the logging in a clustered system, I'm planning to store all log information in a database table.
I'm not sure if a SQL INSERT statement WILL LAST MORE than sending a message to a JMS Queue Server.

I'm close to say that a SQL INSERT statement will last more.

Any experiences/comments to share?

Cheers
Thanks Teja, that's was also my guess.
Fellows,

Does anyone described the testing metodology in the part II?
My assignment does not mention the need to describe it.

Is it worth to describe it?

Regards
Arpit,

I guess it is to risky to assume that a system has a webservice server to provide this sort of interface.
I would rather choose for an JCA Architecture approach, since is much more generic for legacy systems conectivity.

Cheers

Instant Messaging does not require a queue, P2P does.

Regards
Nice one Khaleel!

I hope to clear it soon too...
16 years ago
Ho folks,

I got an error while running a @SqlResultSetMapping based query.

org.hibernate.MappingException: Unknown SqlResultSetMapping [AAA]


My Stateless Bean:



@Stateless
@SqlResultSetMapping(name="AAA",
entities={
@EntityResult(entityClass=com.certification.entity.ejb.User.class,
fields={
@FieldResult(name="cpf", column="cpf"),
@FieldResult(name="name", column="name")
}
)
},
columns={
@ColumnResult(name="cep")
}
)

public class StatelessBean implements StatelessBeanLocal, StatelessBeanRemote {


@PersistenceContext
EntityManager em;

...
...
...


public Object joinUserWithCEP(Integer cpf) {

try {
Query q = em.createNativeQuery(
"SELECT usr.cpf AS cpf, " +
"usr.name AS name, " +
"e.cep AS cep, " +
"FROM User usr, Endereco e " +
"WHERE usr.cpf = "+cpf+" ",
"AAA");

return q.getSingleResult();

}
catch (Exception e) {
System.out.println("Erro:"+e.getMessage());
return null;
}
}

}



I'm invoking the function from a session bean which is looked up inside a servlet:


StatelessBeanRemote sbr = (StatelessBeanRemote) initialContext.lookup("SCBCD/"+StatelessBean.class.getSimpleName()+ "/remote");

Object cepUser = sbr.joinUserWithCEP(new Integer(1234));

StatelessBeanRemote sbr = (StatelessBeanRemote) initialContext.lookup("SCBCD/"+StatelessBean.class.getSimpleName()+ "/remote"); Object cepUser = sbr.joinUserWithCEP(new Integer(1234));

Somebody has any clues?

Thanks
Maybe 1099 is not your JNDI port. Check your conf/jboss-service.xml if you are using Jboss.
16 years ago
Hey folks,

Anybody knows how do I specify that an Session Bean is BMT using annotations?

Regards
Hi folks,

I'm currently using JBoss and EJB 3.0, trying to access an EJB that is placed inside another jar:

@Stateless
public class StatelessSessionBean1 implements StatelessSessionBean1Local,StatelessSessionBean1Remote {

@EJB
private StatelessSessionBean2 statelessSessionBean2;

public void accessedByBean2()
{
System.out.println("This bean was accessed by other ejb.jar");
}

public void accessBean2()
{
statelessSessionBean2.accessedByBean1();
}
}

I'm using only annotations, since no ejb-jar setups is required right?
So, my servlet does the following:
StatelessSessionBean1Remote ssb1r = (StatelessSessionBean1Remote) initialContext.lookup(projectName+"/"+StatelessSessionBean1.class.getSimpleName()+ "/remote");

System.out.println("Accessing bean 2...:");
ssb1r.accessBean2();


And I got the following runtime error:

java.lang.RuntimeException: could not resolve global JNDI name for @EJB for container StatelessSessionBean1: reference class: com.certification.session.stateless.beanref2.ejb.StatelessSessionBean2 ejbLink: not used by any EJBs
at org.jboss.injection.EjbEncInjector.inject(EjbEncInjector.java:88)
at org.jboss.ejb3.EJBContainer.start(EJBContainer.java:566)
at org.jboss.ejb3.SessionContainer.start(SessionContainer.java:154)
at org.jboss.ejb3.stateless.StatelessContainer.start(StatelessContainer.java:102)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)


Any clues?