Lookup Method unavailable

Topics related to the LSPS SDK and custom development of applications.
Forum rules
Make sure every topic contains information about your LSPS version and if relevant also your server OS, client OS, database name and version, and application server name and version.
scott.warnick
 
Posts: 25
Joined: Mon Jan 16, 2017 10:26 pm

Lookup Method unavailable

Tue Apr 04, 2017 4:12 pm

We are encountering the following error when attempting to register our custom EJB's using customServiceBean.java

2017-04-03 13:33:01,773 WARNING startup Method 'lookup' is not available for 'javax.ejb.EJB'. The old API 'file:/C:/Users/scott.warnick/.m2/repository/org/apache/tomcat/tomcat-annotations-api/7.0.68/tomcat-annotations-api-7.0.68.jar' was found on the classpath.

This error leads to a cascade of other errors which eventually cause the custom EJB's not to register. Worse, the server will not start. I can send our pom.xml files by email if that will help solve the problem.

I find this error baffling because as far as I can tell the jar referenced in the error is that jar that should be used for the version of Tomcat in the embedded server.

scott.warnick
 
Posts: 25
Joined: Mon Jan 16, 2017 10:26 pm

Re: Lookup Method unavailable

Tue Apr 04, 2017 4:17 pm

I am mostly interested in debugging techniques. I think the problem comes from getting the javaee api from javax as opposed to getting it from the TomEE server. As I am sure you all know, the javaee that comes from javax does not include implementations for the methods. I think part of the problem is getting the implementations for the javee 6 methods at runtime. It seems logical to get them from the TomEE server using <scope><provided<scope> but using TomEE to provide Javax is leading us to the error I posted previously.

We are running the embedded TomEE server for LSPS 3.1 on windows 7 using the embedded H2 server.

Roman Kubascik
 
Posts: 57
Joined: Thu Apr 16, 2015 9:05 am

Re: Lookup Method unavailable

Tue Apr 04, 2017 4:42 pm

Hi Scott,

you probably mean you registered custom EJB in the ComponentServiceBean.java.
Lately we improved our documentation where we describe how to implement custom function as an EJB. It's for LSPS 3.2, but for 3.1 it's the same.

If it doesn't help, please send us your EJB class (it can have empty methods) + ComponentServiceBean.

Regards,
Roman

scott.warnick
 
Posts: 25
Joined: Mon Jan 16, 2017 10:26 pm

Re: Lookup Method unavailable

Wed Apr 05, 2017 6:01 pm

Roman,
Thank you for the prompt reply.

I will look for the new documentation on registering components in the LSPS version 3.2 documentation. It would be great to have a link.

I have attached the EJB we are working with and a copy of our ComponentServicesBean.java file. I have also attached the model test we are trying to get to work under LSPS 3.1.

On reflection, the ComponentServicesBean.java I just posted is from our LSPS 2.5 system and is unaltered. I will compare it with the version in the default application and see if the annotations need to change.

I wanted to attach log files but I am having trouble with that. I will try attaching them in a separate reply.
Attachments
BasicBAHModelTest.java
This is the model test we are trying to execute. It inherits from BasicModelTest, which does all of the work of uploading the model, starting execution and getting the test results.
(8.72 KiB) Downloaded 140 times
BAHAuthorizeWorkProductTask.java
This is the task EJB we are testing with
(2.11 KiB) Downloaded 154 times
ComponentServiceBean.java
This is our component service bean. The registrations are commented out because they cause exceptions.
(4.81 KiB) Downloaded 151 times

Roman Kubascik
 
Posts: 57
Joined: Thu Apr 16, 2015 9:05 am

Re: Lookup Method unavailable

Wed Apr 05, 2017 6:46 pm

Link to the documentation is included in my previous post (it's visibility could be better).

Roman Kubascik
 
Posts: 57
Joined: Thu Apr 16, 2015 9:05 am

Re: Lookup Method unavailable

Wed Apr 05, 2017 6:56 pm

Here is an example of the custom TaskType:
https://docs.whitestein.com/lsps/3_2/cu ... sktypeimpl
Code: Select all
Instead of
@EJB(beanName = "AuthorizeWorkProduct")
private ExecutableTask authorizeWorkProduct;
I would use
@EJB(beanName = "BAHAuthorizeWorkProductTask")
private ExecutableTask authorizeWorkProduct;


When you set breakpoint in the method registerCustomComponents, is authorizeWorkProduct properly injected (does it have not null value)?

scott.warnick
 
Posts: 25
Joined: Mon Jan 16, 2017 10:26 pm

Re: Lookup Method unavailable

Wed Apr 05, 2017 7:34 pm

Roman,
I am trying to upload full log files showing the problem I am having but the uploads are failing with the following error:

phpBB Debug] PHP Warning: in file [ROOT]/includes/functions_posting.php on line 456: chmod(): No such file or directory

The files are there on my c: drive and I can open them fine. I suspect there is a file length limitation on this forum.

I emailed the log files to Bryon Glueck with a request to forward them to you. Please check with him.

In the meantime I am posting a document that summarizes the relevant messages from the log files.
Attachments
lsps_3_1_upgrade_issues_20170403.docx
(23.49 KiB) Downloaded 156 times

Roman Kubascik
 
Posts: 57
Joined: Thu Apr 16, 2015 9:05 am

Re: Lookup Method unavailable

Wed Apr 05, 2017 7:47 pm

Have you noticed any change when you changed beanName to "BAHAuthorizeWorkProductTask" in the ComponentServiceBean.java?

scott.warnick
 
Posts: 25
Joined: Mon Jan 16, 2017 10:26 pm

Re: Lookup Method unavailable

Wed Apr 05, 2017 9:27 pm

For what it's worth, I compared our ComponentServicesBean.Java to the one in the default application. There is a significant difference. Our version requires import javax.ejb.EJB to compile. The version in the default application doesn't have that import.

scott.warnick
 
Posts: 25
Joined: Mon Jan 16, 2017 10:26 pm

Re: Lookup Method unavailable

Wed Apr 05, 2017 11:04 pm

I found a fix, or at least a workaround. The @stateless directive in our EJB's need to be elaborated with the bean name. Once I did that the JNDI context name was available and the exceptions went away. I can now start the embedded TomEE server with all of our custom EJB's registered.

Return to SDK

Who is online

Users browsing this forum: No registered users and 0 guests