For a given Mathematica code
j[bb, a1, a2] //. {j[bb, ll__] -> List[ll].List[b1, b2]}
I obtain the desired answer which is
a1 b1 + a2 b2
But having a problem with the error
How one can avoid this error message? For this simple case it work perfectly, but I am worried about for some complicated cases that I am going to deal with.

RuleDelayed.j[bb, a1, a2] //. {j[bb, ll__] :> List[ll] . List[b1, b2]}$\endgroup$